- Provide source positions for some ConstantInstrs.
- Classify all other ConstantInstrs.
- Use the token position of ++ rather than x in the expr: "x++;" for the add, constant 1, and final load operations.
- More tests
- Improvements to the test helpers.
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1576583003 .
Super initializer calls get implicitly moved to the end of the initializer list, so we don't need the two-phase constructor protocol anymore.
Ryan, can you please look at the mirror changes and check wether I've missed something?
BUG=
R=asiva@google.com, rmacnak@google.com
Review URL: https://codereview.chromium.org/1569213003 .
Arguably method extractors, invoke-field dispatchers and noSuchMethod dispatchers should also have their token position as kNoSourcePos instead of 0, but this would complicate how parser initializes its token iterator, so I'm leaving them as is.
R=hausner@google.com, johnmccutchan@google.com
Review URL: https://codereview.chromium.org/1566553003 .
There were two exception handlers with the same index added to the code so that only the one added
last was executed. In case of an exception that means that a re-throw may be omitted, causing invalid
control flow.
Also, add assertion to ensure unique try-index for exception handlers.
BUG=#25333
R=hausner@google.com
Review URL: https://codereview.chromium.org/1569523002 .
Evaluate and canonicalize the parameters to the built-in function
identical(a,b) if they are strings. This guarantees that
identical(“ab”, “a”+”b”) evaluates to true.
Note: when the parser parses “a”+”b”, it doesn’t know whether the
expression will be used in a context that may require a
constant value. The canonicalization is thus deferred until it is
known that it is required.
BUG=25024
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1558033002 .
When --move_super is true (the default value), the super constructor call
is moved to the end of the initializer list. In that case, the phase parameter
is not necessary. This change eliminates the check of the phase parameter in the constructor code, but does not yet eliminate the phase parameter.
BUG=
R=srdjan@google.com
Review URL: https://codereview.chromium.org/1544703002 .
Introduce --warn_super flag to print a warning when a super call is found that is not at the end of the initializer list.
Mark failing tests as Fail, OK.
In a later step, we can eliminate the implicit 'phase' parameter in constructors.
BUG=
R=iposva@google.com
Review URL: https://codereview.chromium.org/1540673002 .
Three types of fixes:
1. Remove redundant const_cast
2. Remove const_cast by adding const when appropiate.
3. Remove const_cast by removing const (e.g. places where we call free with it)
For now I only fixed places where the fix is local enough - i.e. does not require
changed a large amount of code.
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1526123002 .
Each script has an associated top-level class in which the top-level functions and fields are stored, and the reference to the script. All other fields in the TL class are unused. There are 380 TL classes in corelib alone; eliminating them saves space.
This CL eliminates all TL classes but one per library. All TL functions and fields in the library are stored in that TL class. Because scripts are not stored directly in functions and fields, but are accessible via their owner class, the owner of TL entities are now PatchClasses, rather than classes.
Before:
Size of vm isolate snapshot = 930813
New space (0k of 0k) Old space (1184k of 1624k)
VM Isolate: Number of symbols : 14909
Size of isolate snapshot = 261873
New space (0k of 2048k) Old space (987k of 1024k)
After:
Size of vm isolate snapshot = 931101
New space (0k of 0k) Old space (713k of 1156k)
VM Isolate: Number of symbols : 14907
Size of isolate snapshot = 256956
New space (0k of 1024k) Old space (514k of 768k)
R=iposva@google.com
Review URL: https://codereview.chromium.org/1410383020 .
This removes most of the compiler-related code from dart_precompiled:
x64 stripped binary size 13M -> 9.1M
ARM stripped binary size 12M -> 8.3M
The precompiled build defines the DART_PRECOMPILED macro. This
stubs out the public interface to the compiler/parser with empty
function bodies.
Use gcc options -ffunction-sections and --gc-sections to make the linker remove
unused functions/symbols.
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1459443002 .
Instead of collecting closures functions in each class object, maintain one list per isolate. This is a step towards getting rid of top-level classes.
I'd appreciate if John could take a look at the service isolate and coverage related change.
I'd appreciate if Ryan could take a look at the precompilation related change.
When compiling all of corelib, the list of closures in the isolate is about 600 entries long. If this linear list should become a bottleneck, I'll deal with it later. (Sadly, some code relies on the fact that a closure can be identified with a list index, so making it a hash table instead of an array does not work.)
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1436243005 .
Moving the construction of ?? into the parser using LetNode, so that the await-transformations are properly applied.
a ?? b becomes { temp = a; temp !== null ? temp : b; }
a ??= b becomes { temp = a; temp != null ? temp : a = b; }
BUG=issue #24392R=hausner@google.com
Review URL: https://codereview.chromium.org/1417733007 .
Change the compile-time constant map to use a pair (url, token_pos) as
the key. Previously, the two values were concatenated into a string, which creates a lot of new strings.
BUG=
R=srdjan@google.com
Review URL: https://codereview.chromium.org/1424393002 .
Also, avoid creating duplicate method extractors with explicit closurization:
Before the compiler would create one extractor per site when using the explicit
#-closurization operator.
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1404163002 .
--move_super directs the VM compiler to move the super initializer
of a constructor to the end of the initializer list. The default
value is false. If we opt to enable this functionality, the implicit
phase parameter of constructors can be eliminated, simplifying
constructors significantly.
BUG=
R=regis@google.com
Review URL: https://codereview.chromium.org/1382533003 .