Previous change removed the limit, but this causes too many
threads to be spawned at the same time on Windows, which
crashes the VM. This change restores the limit, but continues
use of the free-list approach, which still avoids the blocking
problem fixed by the previous change.
fixes#29702R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2903013002 .
This change prevents IO Service requests from colliding on the same
IO Service port. If requests can collide, a request that could otherwise
be serviced immediately can become blocked on a request that is blocked.
To avoid collisions, this change maintains a free list of IO Service
ports. If the free list is empty, we allocate a new IO Service port.
R=bkonyi@google.com
Review-Url: https://codereview.chromium.org/2903593004 .
Only reload packages map when we are actually doing the isolate reload.
Snapshotting creates and destroys and loader object every time it loads a dart
file - which means kInitLoader is on the hot path and we should avoid rereading
packages map.
R=asiva@google.com, rmacnak@google.com
Review-Url: https://codereview.chromium.org/2901093002 .
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.
This is a reapplication of https://codereview.chromium.org/2893553002/
after issues were fixed in https://codereview.chromium.org/2888413002/
and https://codereview.chromium.org/2896583002/R=vegorov@google.com
BUG=
Review-Url: https://codereview.chromium.org/2895183002 .
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.
This relands the original commit 746ab58f46
with a fix for precompiler crashes: ArgumentError.value constructor is
added to the precompiler roots.
TBR=erikcorry@google.com
Review-Url: https://codereview.chromium.org/2897803002 .
For BinarySmiOpInstr and ShiftMintOpInstr we use range information to both
decide if instruction can deopt and decide which checks should be emitted
when emitting native code for this instruction.
However because range information is attached to the definition and not
uses it often gets out of sync as we mutate the graph. For example we might
first make a decision that an instruction can't deoptimize based on more
precise range information but then use less precise information in the
backend for deciding which parts of the instruction to emit (because
redifinition or a phi-instruction was removed from the graph). This mismatch
can lead to a crash if less precise information tells backend that one of the
inputs need to be checked - because there is no deoptimization label to jump
to.
This CL is addressing this problem by ensuring that range information is
cached at the use and both ComputeCanDeoptimize() and backend use the same
range information.
Additionally this CL kills overly generic MergedMath instruction and replaces it
with TruncDivModInstr.
BUG=https://github.com/dart-lang/sdk/issues/29620R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2891113002 .
This has a few advantages:
- We can track dependencies more precisely
- ninja can assemble things in parallel as they're ready rather than
sequentially all at once.
- It is easier to customize SDKs depending on target platform, e.g.
Fuchsia.
This CL also has a number of cleanups:
- Defining is_fuchsia and is_fuchsia host so we don't always have to check
- Piping through toolchain overrides in more places
- Fixing bugs in copy_tree.py, not using list_files.py, which is broken on Windows
related #29558R=whesse@google.com
Review-Url: https://codereview.chromium.org/2848943003 .
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 .