Commit graph

46132 commits

Author SHA1 Message Date
Zachary Anderson e79354546d Update DEPS for BUILD.gn in func package
R=jacobr@google.com

Review-Url: https://codereview.chromium.org/2820713003 .
2017-04-14 13:26:35 -07:00
Stephen Adams 7e301f767b dart2js: Avoid inserting redundant HTypeKnown
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2815403004 .
2017-04-14 11:40:12 -07:00
Konstantin Shcheglov 2d0d000611 Flush on write in FileByteStore.
We see (rarely, but still) situations when FileState attempts to read
a *.unlinked file, but the file is empty. We think that this happens
when the user's machine crashes, so files are created, but not fully
written to disk.

This change has its cost - increase of FileByteStore.put() CPU usage
from 7% to 10% on Mac.

R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2821683002 .
2017-04-14 10:53:22 -07:00
Kevin Moore 1120d10daf Finish cleaning up analyzer warnings
Also Updated pubspec to use the SDK version of kernel

Closes https://github.com/dart-lang/sdk/issues/28454

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2815383003 .
2017-04-14 10:28:07 -07:00
Jennifer Messerly b76e2d67cf fix #29346, ensure all nodes are implemented by DDC's code generator
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2822633003 .
2017-04-14 10:10:50 -07:00
Mike Fairhurst 37aeef8d6e Tick angular analyzer DEPS to 0.0.8
BUG=
R=whesse@google.com

Review-Url: https://codereview.chromium.org/2814793006 .
2017-04-14 08:22:57 -07:00
Brian Wilkerson fcac30e080 Reland: Fix more parser bugs
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2812243006 .
2017-04-14 07:26:29 -07:00
Konstantin Shcheglov 95cfe76812 Add a flag for caching all analysis results in the driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2818623003 .
2017-04-13 19:17:48 -07:00
Emily Fortuna 93a908fde0 Remove BackendClasses and JavaScriptBackendClasses.
BUG=
R=johnniwinther@google.com, sra@google.com

Review-Url: https://codereview.chromium.org/2813093002 .
2017-04-13 17:22:54 -07:00
Stephen Adams a7a1811f18 dart2js: type analysis: yield escapes its argument
BUG= https://github.com/dart-lang/sdk/issues/29046
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2811993006 .
2017-04-13 13:41:01 -07:00
Stephen Adams d15da7d900 dart2js: Capture typedef arguments once
The type Map<T, Foo<Set<T>>> contains one type variable referenced twice,
so there are two inputs into the HTypeInfoExpression instruction.

If Foo is a typedef, T can be reused, e.g.

    typedef E Foo<E>(E a, E b);

As the typedef is expanded (to Function(Set<T>, Set<T>) => Set<T>) it
should not consume additional types from the to-level input.  We
prevent this by capturing the types and using the captured type
expressions inside the typedef expansion.

TODO: We should make the type subexpression Foo<...> be a second
HTypeInfoExpression, with Set<T> as its input (a third
HTypeInfoExpression). This would share all the Set<T> subexpressions
instead of duplicating them. This would require HTypeInfoExpression
inputs to correspond to type variables AND typedefs.

BUG= https://github.com/dart-lang/sdk/issues/28749
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2812393003 .
2017-04-13 12:45:32 -07:00
Ben Konyi c8e1e2aad7 Fixed spelling mistakes in HttpRequest documentation.
BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2805133002 .
2017-04-13 11:49:34 -07:00
Ben Konyi d7c55fb926 Updated status file to allow for RuntimeErrors in raw_synchronous_socket_tests temporarily while the cause of flakiness is found.
BUG=
R=alanknight@google.com

Review-Url: https://codereview.chromium.org/2822523002 .
2017-04-13 11:29:35 -07:00
Mike Fairhurst bffe47e678 First stab at #29153 range check in as-casts. Mostly working.
Having an issue forwarding Symbol::InTypeCheck into dart and back;
without it, the exceptions that are thrown are `TypeError`s and not
`CastError`s.

Certainly a bit longform to read, as well.

Committing for feedback/suggestions/help

BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2805903004 .
2017-04-13 10:44:57 -07:00
Mike Fairhurst d55dc29727 Temp fix to allow plugins to serve the getErrors APIs.
Had to allow a means of supplementing existing errors/line info, but
then also for where dart has no response whatsoever (like html), need a
way to provide analysis options and line info in addition to errors.

Happy to clean it up, but also not very motivated to make it perfect
since it should be temporary.

BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2815643004 .
2017-04-13 10:37:39 -07:00
Alan Knight 7bf59fac63 Revert "Fix more parser bugs"
This reverts commit 65f8d25aa0.

BUG=

Review-Url: https://codereview.chromium.org/2821483003 .
2017-04-13 10:07:40 -07:00
John McCutchan 6f039b508b Kill dead code
BUG=

Review-Url: https://codereview.chromium.org/2819573002 .
2017-04-13 09:55:13 -07:00
Brian Wilkerson 65f8d25aa0 Fix more parser bugs
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2817873003 .
2017-04-13 09:26:31 -07:00
John McCutchan 7399d4bdec DBC follow up CL
- [x] Hoist handle out of loop.
- [x] Avoid allocating a handle.

BUG=

Review-Url: https://codereview.chromium.org/2819523003 .
2017-04-13 07:38:15 -07:00
Brian Wilkerson b277f1023c Fix parser error
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2809213005 .
2017-04-13 06:14:05 -07:00
Ben Konyi cf6165c767 Fixed status file to not expect a raw_synchronous_socket_test crash on the analyzer bots.
TBR=zra@google.com
BUG=

Review-Url: https://codereview.chromium.org/2811363003 .
2017-04-12 16:16:35 -07:00
Ryan Macnak 00c2af904f GN: Remove dead target 'libdart' and dead flag 'dart_experimental_interpreter'.
R=zra@google.com

Review-Url: https://codereview.chromium.org/2819453002 .
2017-04-12 16:05:37 -07:00
Ryan Macnak 39040a8a15 Never erase parameter types in the JIT.
Even in unchecked mode with mirrors disabled, we need to be able to forward parameter types to lazily generated implicit closure functions.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2808763008 .
2017-04-12 15:40:42 -07:00
Ben Konyi 9745386d63 Added sync_socket_unsupported.cc to sources file
BUG=

Review-Url: https://codereview.chromium.org/2814293002 .
2017-04-12 15:22:41 -07:00
John McCutchan 024ccd3095 Mark language/vm/optimized_stacktrace_test slow on reload bots
BUG=

Review-Url: https://codereview.chromium.org/2814743008 .
2017-04-12 15:15:11 -07:00
Ben Konyi 7549bc6b48 Added missing sync_socket_unsupported.cc and fixed issues in test which were causing analysis errors
BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2814283002 .
2017-04-12 15:13:10 -07:00
John McCutchan 9af072399e Fix reload bots
BUG=

Review-Url: https://codereview.chromium.org/2812373003 .
2017-04-12 14:36:38 -07:00
Ryan Macnak 5cffc591aa Refactor AOT deduplication steps so they can run before an app-jit snapshot as well.
Additionally dedup PcDescriptors, deopt entries, deopt lists, and await token position lists.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2815533003 .
2017-04-12 14:23:49 -07:00
Ben Konyi 6fbdd19ddb Various fixes for sync socket implementation.
Revert "Revert "Added sync_socket.h include in sync_socket_win.cc""

This reverts commit 2bd6168e1ebf35f6dbd9b2724339362c493377fc.

Revert "Revert "Added synchronous socket implementation to dart:io.""

This reverts commit a47bce03f5502dac7fb12e777e87b5aa1cfc830b.

BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2814773004 .
2017-04-12 14:20:48 -07:00
Brian Wilkerson e30b56ccbe Fix another parser bug
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2808403005 .
2017-04-12 14:17:23 -07:00
Ryan Macnak 91da7428f3 Add --print_stacktrace_at_api_error.
Should be helpful in tracking down flutter/flutter#8612.

Prefer stack bounds from pthreads when available to be able to see frames below the Dart entry frame.

R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2813283002 .
2017-04-12 14:09:19 -07:00
John McCutchan 99c6a18a1b Attempt 2 -- Fix updating packages map on reload and add a regression test
- [x] Update the isolate's .packages path when requested.
- [x] Always refresh package map when loader is initialized.
- [x] Add regression test.

Review-Url: https://codereview.chromium.org/2810223003 .
2017-04-12 14:02:19 -07:00
Konstantin Shcheglov 54f845cfd2 Support for generic function as type arguments in DeclarationResolver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2814223002 .
2017-04-12 13:47:23 -07:00
John McCutchan f0734f99b3 Detect unhandled exceptions in async functions without an awaiter
- [x] Produce an awaiter stack trace even when there is no awaiter.
- [x] Fix fetching the saved context from Closure.call (fixes --trace_debugger_stacktrace)

Fixes #29200

Example code:

```
main(List<String> args) async {
  var f = new Foo();
  print(f.a.length);
  print('Should not get here');
}

class Foo {
  String a;
}
```

BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2815863002 .
2017-04-12 13:15:41 -07:00
Brian Wilkerson 23f08ec04a Fix another parser issue with generic function types
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2814183002 .
2017-04-12 12:41:54 -07:00
Konstantin Shcheglov 5f28891e61 [Reapply] Pass ElementImpl as a context for resynthesizing types.
I added a couple of changes for link.dart to use context in getLinkedType().
I was not able to create a unit test for this case :-/

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2818543002 .
2017-04-12 11:54:23 -07:00
Jennifer Messerly 9bdc5bb751 add scripts to run/debug DDC output on simple test cases
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2815913002 .
2017-04-12 11:36:23 -07:00
Brian Wilkerson e520fc2a45 More parser fixes for generic function types
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2817753002 .
2017-04-12 11:35:21 -07:00
Alan Knight 04bb68bb09 Better DDC sourcemap generation for lambdas
This doesn't fix the entire problem, there's still a Chrome issue that it's not clear we can work around, but it helps some. https://bugs.chromium.org/p/chromium/issues/detail?id=676388

There are three distinct issues here affecting Chrome sourcemap usage for DDC programs with single-line lambdas.

1 - We may introduce a synthetic "as SomeType" in a parameter. The synthetic token ends up with a large negative length, from its offset to the beginning of the file, which can confuse sourcemaps.

2 - We have no entry for the blank line following the lambda. The devtools asks for the mapping from (selectedLine, 0) to (selectedLine +1, 0) and if there's no mapping for either it refuses to set the breakpoint. So this artificially forces the mapping from the last character on the line to be to the beginning of the next line instead.

3 - With a lambda we introduce a constructed Return JS node and make a block. Those nodes weren't getting annotated, so they had no source information.

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2815443003 .
2017-04-12 11:31:16 -07:00
Regis Crelier 25dbc9b28a Fix look-ahead parsing code in the VM (fixes #29243).
Add regression test.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2812323002 .
2017-04-12 11:04:21 -07:00
Konstantin Shcheglov cb5bba03e2 Revert "Pass ElementImpl as a context for resynthesizing types."
This reverts commit d2a1bdff4a.

It causes an exception during pkg/analyzer analysis.

package:analyzer/src/fasta/mock_element.dart;package:analyzer/src/fasta/mock_element.dart;MockElement;accept
Unhandled exception:
NoSuchMethodError: Class 'CompilationUnitElementInDependency' has no instance getter 'typeParameterContext'.
Receiver: Instance of 'CompilationUnitElementInDependency'
Tried calling: typeParameterContext

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2814163002 .
2017-04-12 10:45:41 -07:00
pq 1d4d0d769f CLI support for enableAssertInitializers.
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2809793004 .
2017-04-12 10:38:30 -07:00
Konstantin Shcheglov 7696ec5f31 Support for using generic function types in other AST structures.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2814063003 .
2017-04-12 10:12:30 -07:00
Brian Wilkerson dd150dd348 Correctly recognize non-constant enum children (issue 29306)
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2815093002 .
2017-04-12 09:43:14 -07:00
Konstantin Shcheglov 2143087734 Build GenericFunctionTypeElementImpl in both ApiElementBuilder and LocalElementBuilder.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2809423003 .
2017-04-12 09:39:31 -07:00
Konstantin Shcheglov d2a1bdff4a Pass ElementImpl as a context for resynthesizing types.
We need to do this in order to associate resynthesized
GenericFunctionTypeElementImpl instances with these enclosing ElementImpl
instances. The same enclosing ElementImpl can also be used to get
the TypeParameterizedElementMixin for accessing type parameters.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2813543007 .
2017-04-12 09:35:56 -07:00
Brian Wilkerson 492eab84ec Fix parsing of generic function types as return types
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2809773005 .
2017-04-12 07:27:39 -07:00
Karl Klose 7b5010d440 [Gardening] Mark regress_29025_test as crashing in precompiled-debug
R=kustermann@google.com

Review-Url: https://codereview.chromium.org/2817683002 .
2017-04-12 16:12:13 +02:00
Martin Kustermann 0de8c02b6c Try work around issues executing powershell scripts on windows on the bots
R=ricow@google.com

Review-Url: https://codereview.chromium.org/2817553005 .
2017-04-12 12:28:20 +02:00
Johnni Winther 1973b42b00 Lesser direct Compiler use in SSA
This is a step towards using data object rather than Compiler and
JavaScriptBackend in codegen. This is needed to support a shift in
element models between resolution and codegen.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2811593006 .
2017-04-12 11:33:11 +02:00