- uses thread execution status transition to track when a thread is in a safepoint or needs to block for a safepoint
- introduces a monitor per Thread object
- uses a per thread safepoint handshake between the thread requesting a safepoint and the requested thread.
The ThreadRegistry class now contains only the thread list for an isolate and the functionality of scheduling a thread onto an Isolate and unscheduling it from teh isolate. We could fold this functionality into the Isolate class in a different CL.
R=rmacnak@google.com, zra@google.com
Review URL: https://codereview.chromium.org/1541073002 .
They were used as the class of closure instances and as the type class of
function types.
All closure instances now have class _Closure and function types are represented
by a new class FunctionType extending AbstractType.
Fix issue 24567 and add regression test.
R=asiva@google.com, rmacnak@google.com
Review URL: https://codereview.chromium.org/1584223006 .
- Rework token position address space.
- Use ClassifyingTokenPositions::kMethodExtractor for the token position of a method extractor.
- Plumb token positions through all of Ast Transformer.
- Plumb token positions for temporary expressions, etc in Flow Graph Builder.
- Add token positions for parts of the await machinery.
- Move ClassifyingTokenPositions into token.h.
- Remove default token position of Scanner::kNoSourcePos for many IR instructions.
- A couple of unit tests.
- Use synthetic token positions for synthetic AstNodes.
- Fix SLEB128 encoding / decoding + test
- s/Scanner::kNoSourcePos/Token::kNoSourcePos.
- Remove >= 0 and < 0 checks against token positions and use helpers instead.
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1589643002 .
Also take the opportunity to add the ability to report an error after a given token position. This way, the missing semicolon gets reported where it should: at the end of the line rather than the first token on the following line, when the error is actually detected.
BUG= 23761
R=regis@google.com
Review URL: https://codereview.chromium.org/1574213005 .
- Give AwaitMarkerNode a token position.
- Make it possible to provide a token position for SaveContext, RestoreContext, StoreContext, and CurrentContext.
- Pass in a token position to internally generated StoreLocal and LoadLocal instructions for try-catch-finally.
- Introduce a Context ClassifyingTokenPosition to be used when we can't attribute a context related instruction to a source position.
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1575953005 .
- 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 .