Clean up the VM's dart:core and dart:async library patches so that
they are clean according to the patching rules implemented in the
analyzer. Specifically:
- If a member is patched in a patch file, it must be declared external
in the SDK.
- If a member is introduced in a patch file, it must be private.
- A non-private superclass member cannot be overridden in a patch
file.
BUG=
R=lrn@google.com, sigmund@google.com
Review-Url: https://codereview.chromium.org/2563633002 .
Resolution is delayed to properly handle generic results of generic functions.
Resolution has to be done in the library declaring the function and not in the
library declaring a mixin application mixing in the function.
R=hausner@google.com
Review URL: https://codereview.chromium.org/2549443005 .
- [x] Add three public fields to the "BoundVariable" service type: declarationTokenPos, visibleStartTokenPos, and visibleEndTokenPos. (naming suggestions welcome!)
- [x] Extend LocalVarDescriptors to hold the declaration token position (it already had the scope visibility boundaries).
- [x] Extend ContextScope to hold the declaration token position.
- [x] Add a unit test which verifies this works for local variables, function parameters, and closure captured variables.
Fixes https://github.com/dart-lang/sdk/issues/25569
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/2419013004 .
When running with --load-deferred-eagerly, we don't need to collect
functions for invalidation, but instead insert runtime checks if
the prefix if loadLibrary was called loaded or not.
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/2415743004 .
Read and write parent_level field of function type parameters in snapshots.
Update TypeParameter::ToCString() to handle function type parameters.
Address Siva's comments in previous cl.
R=asiva@google.com
Review URL: https://codereview.chromium.org/2359543003 .
Eliminate the need to invoke an execute-once function to compute
type literals and implicit closures. This reduces the number of
execute-once invocations from 6000 to 60 when compiling all of
the greentea sources, about 1MB of generated code. Sadly, no
significant runtime gain was observed.
Also simplify the caching of computed compile-time constants.
Reinstate the compiler stat counter for number of constants cached.
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/2338463003 .
Dartium test html/async_spawnuri_test is failing when legacy
patch class syntax parsing is removed.
Once dartium is fixed, this change can be re-applied.
TBR=terry
Review URL: https://codereview.chromium.org/2274663004 .
Take two. (This version adds status file entries for checked
tests.)
Type parameters and arguments are parsed but ignored. Proper
handling of the parameters will be added subsequently.
The feature must be enabled with --generic-method-syntax.
Compiling all of dart2js consumes about 2.2% more tokens with
this change, due to the necessary lookahead to distinguish
generic functions from generic types.
===== with this change =========
Number of tokens: 1056691
Source length: 5850143 characters
Number of source tokens: 936226
Total tokens consumed: 3628934 <<<<<
Classes parsed: 2457
Tokens consumed: 977999
Functions parsed: 49607
Tokens consumed: 2430638
===== without this change ======
Number of tokens: 1056691
Source length: 5850143 characters
Number of source tokens: 936226
Total tokens consumed: 3547765 <<<<<
Classes parsed: 2457
Tokens consumed: 942536
Functions parsed: 49607
Tokens consumed: 2371357
(This reverts commit a1edb1766fd16b1268f3506feb7c9856b32bedfc.)
BUG= 25869
Review URL: https://codereview.chromium.org/2269693002 .
Type parameters and arguments are parsed but ignored. Proper
handling of the parameters will be added subsequently.
The feature must be enabled with --generic-method-syntax.
Compiling all of dart2js consumes about 2.2% more tokens with
this change, due to the necessary lookahead to distinguish
generic functions from generic types.
===== with this change =========
Number of tokens: 1056691
Source length: 5850143 characters
Number of source tokens: 936226
Total tokens consumed: 3628934 <<<<<
Classes parsed: 2457
Tokens consumed: 977999
Functions parsed: 49607
Tokens consumed: 2430638
===== without this change ======
Number of tokens: 1056691
Source length: 5850143 characters
Number of source tokens: 936226
Total tokens consumed: 3547765 <<<<<
Classes parsed: 2457
Tokens consumed: 942536
Functions parsed: 49607
Tokens consumed: 2371357
BUG=25869
R=asiva@google.com
Review URL: https://codereview.chromium.org/2260693002 .
Allow members of patch classes to be annotated with @patch. The VM
ignores the annotation. I simply replaces the original method
if the name matches, or reports an error if field names match.
Adding a bit is_patched to members to do more checking remains a
TODO. There are currently no unused bits available, and I don’t want
to increase the size of Function objects for this.
BUG=
R=asiva@google.com
Review URL: https://codereview.chromium.org/2230383003 .
Annotate patch classes and top-level patch functions with @patch
instead of the pseudo-keyword patch. This allows the analyzer
to read patch files, and matches the syntax that dart2js uses.
The deprecated syntax is still supported, but a warning is printed when detected.
BUG=
Review URL: https://codereview.chromium.org/2220883004 .
When generating the scopes in an await-for loop, make sure the scope
of the loop block is a proper sub-range of the block surrounding
the loop.
This eliminates the last case where the compiler generated context
info of the same range, but with contradicting context level info.
BUG=26941
R=regis@google.com
Review URL: https://codereview.chromium.org/2201203002 .