- Add a zone parameter to TokenStream::Iterator
- Add IsXXXX() functions in raw_object.h using GetClassId()
- Modify
- Function::owner
- Function::origin
- Type::IsMalformed
- Type::IsMalbounded
- Type::error
to not create a Handle in the common path
R=regis@google.com
Review URL: https://codereview.chromium.org/1952023002 .
- Use TokenDescriptor instead of intptr_t for all token positions.
- Use TokenDescriptor in raw_object instead of int32_t.
- TokenDescriptor is a POD with an int32_t (this shrinks the size of AST and IR nodes by 32-bits on 64-bit architectures).
There are some cleanups I plan on doing as a follow up CL:
- Replace TokenDescriptor::value() with TokenDescriptor::TokenPos()
R=iposva@google.com, rmacnak@google.com
Review URL: https://codereview.chromium.org/1644793002 .
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 .
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 .
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 .
--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 .
Prints the stats into a zone-allocated string that can either be dumped to the console, or displayed as a whole in the observatory.
Distinguish token consumption between class parsing and function parsing when compiling.
Change stat counter macros use thread instead of isolate.
Review URL: https://codereview.chromium.org//1300033002 .
Compile-time constant values are maintained in a cache, keyed
by script and token position. When the same code is compiled
again later, e.g. by the optimizing compiler, the value is
found in the cache and does not need to be computed again.
In this version, the key is a string concatenated from the
script url and the token position. That’s probably more overhead
than we want.
Added two compiler stat counters for number of cached constants
and number of cache hits. Running dart2js to compile a hello world
program results in about 1400 cached values and 85 cache hits.
BUG=
R=srdjan@google.com
Review URL: https://codereview.chromium.org//1308073005 .
One detail that isn't implemented yet is canonicalization of constructor tear-offs. At the moment, two tear-offs of the same constructor result in closures that are not equal.
BUG=
R=regis@google.com
Review URL: https://codereview.chromium.org//1255063005 .
The most substantial change is in Parser and ParsedFunction, which now cache their calling thread. (A similar change was tried unsuccessfully in the past, but can now be safely implemented thanks to the ThreadRegistry state saving.)
Only remaining users are the Object::Handle(Isolate*, [...]) methods. Then, this deprecated interface will be removed.
BUG=
R=asiva@google.com
Review URL: https://codereview.chromium.org//1242343002 .
The helper functions in Parser to resolve classes in the library
and prefix scope created an unnecessary handlescope. With libraries
caching previous lookups, and with namespaces now using dictionaries,
there are just a handful (so to speak) of handles allocated for the
lookup. That does not warrant a handlescope. Removed the helper
functions.
R=asiva@google.com
Review URL: https://codereview.chromium.org//1087463005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45399 260f80e4-7a28-3924-810f-c04153c831b5
Make sure we add the implicit return node into the sequence
node that contains the function’s code. Previously, we added
the implicit return in the outermost sequence. If the outermost
sequence is at a different context level than the sequence that
contains the function’s code, the debugger cannot access the
captured variables when stopped at the return statement.
R=regis@google.com
Review URL: https://codereview.chromium.org//1037183003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44826 260f80e4-7a28-3924-810f-c04153c831b5
This saves space in unoptimized code for implicit closures. In optimized code the
original method's code will often be inlined into the implicit closure dispatcher so that
there won't be a performance impact.
The static case just calls the original method. For implicit instance closures, the
this-parameter is loaded from the context and passed to the original method.
The coverage test is affected since the dispatcher has the original method's token position
associated with it. This means that the line with the method declaration is considered to
have executable code. Setting the token position to 0 (Scanner::kNoSourcePos) does not work
because it coincides with the first line (and first token) in the script.
R=hausner@google.com
Review URL: https://codereview.chromium.org//1024563004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44655 260f80e4-7a28-3924-810f-c04153c831b5
When using mixins, the constructor of a super-class was incorrectly
invoked twice if the super() call was not at the end of the initializer
list.
When generating the super constructor call in an implicit constructor, pass
along the phase parameter that comes in instead of invoking all phases.
BUG=dartbug.com/22604
TEST=tests/language/constructor_with_mixin_test.dart
R=hausner@google.com
Review URL: https://codereview.chromium.org//973843005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44242 260f80e4-7a28-3924-810f-c04153c831b5