We have limited support for folding away length loads from constant
arrays and strings. However we were not folding away loads in code
like:
enum E { V }
isV(flags) => (flags & (1 << E.V.index)) != 0;
Here we would emit load index and shift for mask computation
instead of simply emitting 1.
This change fixes the oversight by enabling folding away loads
of final fields from constants.
BUG=
R=erikcorry@google.com
Review-Url: https://codereview.chromium.org/2897603002 .
This moves the hash code into the header word for strings on 64 bit
platforms. With the old layout, 9 character strings became 48-byte
objects. With the new layout you have to go to 17 characters before
you are bumped from 4 to 6 words (32 to 48 bytes).
As a side effect, the class ID field is now 16 bits on all platforms
instead of having two different sizes, and the size field is 8 bits
on all platforms.
This also paves the way for moving the hash code for instance objects
into the header, so we won't need the side-lookup in the
hash-table-of-hash-codes on 64 bit platforms.
R=vegorov@google.com
BUG=
Review-Url: https://codereview.chromium.org/2893553002 .
This reverts commit d91f228766.
The commit causes a failure in
tools/build/mac/verify_order _ChromeMain "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}":
unordered symbols in out/Release/Chromium Framework.framework/Versions/A/Chromium Framework:
BUG=
R=dmitryas@google.com
Review-Url: https://codereview.chromium.org/2884383005 .
With this change one can run run_vm_tests and pass to it reference to kernel parser snapshot. For example,
out/DebugX64/run_vm_tests --dfe=out/DebugX64/gen/kernel-service.dart.snapshot Debugger_RemoveBreakpoint
As this represents first step, this change enables only tests in debugger_test.cc to run with kernel frontend. There will be follow-up cls that enable all of the VM tests to use kernel frontend.
BUG=https://github.com/dart-lang/sdk/issues/28264R=asiva@google.com
Review-Url: https://codereview.chromium.org/2881953002 .
Previous commit had 3 instances of "NameIndex(NULL)" which workes locally.
Some of the build bots complain about
"implicit conversion of NULL constant to 'int'".
This should fix that.
BUG=
R=kmillikin@google.com
Review-Url: https://codereview.chromium.org/2878393002 .
This CL allows for streaming big parts of the binary,
i.e. without using the AST nodes.
It is thus a stepping-stone in getting rid of the AST nodes in the VM.
Generally, all Expressions except "FunctionExpression",
and all Statements except "FunctionDeclaration" can be streamed.
There are currently not streamed because they create new functions,
which has a pointer to an AstNode (which we don't have when streaming).
Once we no longer need AstNodes at all these can be streamed as well.
This is, I think, mostly a matter of streaming the ScopeBuilder as well,
something that is not currently done.
The way the streaming is build, one has to stream an entire subtree.
That means, that if an expression (or statement), A, that is generally
streamable contains an expression or a statement, B, that is not streamable,
A cannot be streamed.
The way this is build is by marking AstNodes as streamable or not
("cannot_stream_" field). That way we know up front whether we can stream
a subtree or not.
The streaming is done via "kernel_binary_flowgraph".
In this file there are many obvious comments, e.g.
```
TokenPosition position = ReadPosition(); // read position.
```
This has been done in an attempt to add a comment to everything that
reads from the binary to make it stand out more.
All changes from kernel_to_il up to and including May 2nd 2017
should be included.
R=kmillikin@google.com
Review-Url: https://codereview.chromium.org/2854393002 .
The current old-space allocation implementation performs a
linear search in a single (potentially *very long*) free list for
allocations > 2k.
This CL will change this behavior to limit the number of free list
entries traversed, falling back to allocate a new page if the maximum
number of steps was reached. The new page will be pushed onto the
front of the free list, therefore making new allocations go there
immediately.
For the new tests/standalone/fragmentation_test.dart we
- pay around 11-12% increase in memory
- to gain a 6x speedup (125x speedup with sweepers disabled)
I tried a much more complicated version that had power-of-two
buckets for freelist items > 2k. This turned out to regress
dart2js and splay for reasons that I could not determine. This
version is much simpler and fixes the issue as observed in the
bug.
Closes#29588R=kustermann@google.com
Review-Url: https://codereview.chromium.org/2872883003 .
- Globally replace InstanceRepository with ObjectRepository. In general, instances may reference non-instances, so we should not assume we'll only get instances from the fields of instances.
- Allow expanding context and closure refs like regular instance refs.
- Fix display of a mirror reference's referent, which is never an instance or context.
R=aam@google.com, mfairhurst@google.com
Review-Url: https://codereview.chromium.org/2873013004 .
Remember Instructions offsets using the object id weak table. Fixes duplication of instruction objects in non-product kAppJIT snapshots. Also provides a good basis for referencing VM isolate Instructions from an isolate snapshot.
R=asiva@google.com
Review-Url: https://codereview.chromium.org/2859913002 .
Remove hack in bin/snapshot_utils.cc that avoided building a true app-jit snapshot for ARM, ARM64 and MIPS because of the multiple invocations above.
Add GN flags to choose to build script snapshots instead of app-jit snapshots, avoiding a slow training run inside a simulator.
Fixes#29580.
R=zra@google.com
Review-Url: https://codereview.chromium.org/2871713002 .
Make GN run for Android configurations on supported host platforms
on a gclient runhooks. This should fix the vm-precomp-android-* bots
Review-Url: https://codereview.chromium.org/2861363002 .
This transformation replaces the body of _getMainClosure in
dart:_builtin with `return main` for the script's main if there is one
and removes the body if there is no main.
Without this transformation fasta will compile `return null` and dartk
will compile `return throw new NoSuchMethodError...`. Both of these
patterns will be patched in the VM when dart:_builtin is compiled from
Kernel.
BUG=
R=sigmund@google.com
Review-Url: https://codereview.chromium.org/2861023002 .
In the VM's Kernel representation, introduce wrapper classes for
string and name indexes so it is obvious which one is which. For
convenience there is an implicit conversion so that they can each be
used where an int is allowed. However, there is no implicit
conversion _to_ either of these types.
BUG=
R=vegorov@google.com
Review-Url: https://codereview.chromium.org/2860823002 .
The canonical name table is copied into a typed data array in the VM's
heap. The encoding is the same as in the binary except that the
integer indexes are fixed-size.
Canonical names are now integer indexes instead of objects allocated
in the C++ heap.
BUG=
R=jensj@google.com, vegorov@google.com
Review-Url: https://codereview.chromium.org/2853423002 .