Commit Graph

11858 Commits

Author SHA1 Message Date
Ryan Macnak bcf2900a26 Reapply "Shuffle around deopt id allocation to give the flow graph builder a chance to record other data as they are allocated".
- Fix inlining of new List(n) to propogate deopt id.
 - Fix CreateArrayOpt to check for a Smi length.

R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2900963008 .
2017-05-25 10:12:22 -07:00
Peter von der Ahé 27761fd369 Read SDK and patches from a JSON file.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2895983002 .
2017-05-25 15:57:57 +02:00
Alexander Aprelev 1333f97b9a Mark more dartk tests as failing with vm switched to DFE parser
TBR=siva

BUG=https://github.com/dart-lang/sdk/issues/28264

Review-Url: https://codereview.chromium.org/2901103006 .
2017-05-24 21:54:59 -07:00
Alexander Aprelev 16c0db1022 Revert "Revert "With this change 'tools/test.py -cdartk vm' will run vm tests with Dart Frontend parser.""
This reverts commit e0cdea811a.

Update status of vm tests, that don't work with DFE yet.

BUG=https://github.com/dart-lang/sdk/issues/28264
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2895153005 .
2017-05-24 20:16:48 -07:00
Siva Annamalai 91c1202fc8 Add ability to run the hot reload unit tests using the '--dfe' option
R=aam@google.com

Review-Url: https://codereview.chromium.org/2899043005 .
2017-05-24 19:29:20 -07:00
Ryan Macnak 14ec8fa979 Use assembly instead of C array literals to link the core snapshot into the VM.
Allows for including instructions.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2901163002 .
2017-05-24 14:38:15 -07:00
Zachary Anderson 58c0cacefb Remove unused <sys/syscall.h> inclusion on Fuchsia
Fuchsia doesn't specify its syscall interface in this header. In fact,
the header is empty, and we will soon remove it. So don't include it.

R=zra@google.com
BUG=

Review-Url: https://codereview.chromium.org/2904963002 .
2017-05-24 14:23:16 -07:00
Zachary Anderson f6ca2fc63a [Fuchsia] Fix arm64 build
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2897173006 .
2017-05-24 12:12:49 -07:00
Ryan Macnak 93864c0db9 Revert "Shuffle around deopt id allocation to give the flow graph builder a chance to record other data as they are allocated."
This reverts commit c94bebf289.

Review-Url: https://codereview.chromium.org/2904733003 .
2017-05-24 11:55:56 -07:00
Zachary Anderson 61300d19c6 [dart:io] Re-limit the number of IO Service ports per Isolate
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 #29702

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2903013002 .
2017-05-24 10:22:26 -07:00
Zachary Anderson 3310e0cebd [dart:io] Remove collisions from IO Service port dispatch
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 .
2017-05-23 23:58:07 -07:00
Siva Annamalai ae57eca504 Read builtin source files directly only under a flag which is off by default.
BUG=27860
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2903693003 .
2017-05-23 18:14:00 -07:00
Ryan Macnak c94bebf289 Shuffle around deopt id allocation to give the flow graph builder a chance to record other data as they are allocated.
We'll use deopt-id -> context-level or deopt-id -> scope mappings to find what variables are in scope for the debugger and async stack trace machinery.

R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2896903002 .
2017-05-23 16:56:14 -07:00
Vyacheslav Egorov 13f5616ef6 VM: Fix snapshoting slow-down caused by 99c6a18a1b.
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 .
2017-05-23 22:01:45 +02:00
Zachary Anderson 904aefe6e3 [Fuchsia] Implements the thread interrupter for CPU profiling.
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2796143002 .
2017-05-23 10:22:07 -07:00
Zach Anderson 299c5f15fd [windows] Don't set/restore the code page if it's already been set
Fixes some messy ninja output during the build.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2894353002 .
2017-05-22 15:02:24 -07:00
Alexander Aprelev ddab610d53 Revert "Revert "Use Kernel frontend from run_vm_tests.""
This reverts commit 530a0df8f3.

This relands https://codereview.chromium.org/2881953002/ that had to be reverted because it caused Dartium build regression. Now fix for Dartium build on mac is in place with Dartium order file update(https://codereview.chromium.org/2887183003) and corresponding Dartium DEPS rollforward(https://codereview.chromium.org/2888283003/).

BUG=https://github.com/dart-lang/sdk/issues/28264
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2898743003 .
2017-05-22 15:00:30 -07:00
Zachary Anderson 34f601a8db Fix ARMv6 Linux cross-build
related #29676

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2892413002 .
2017-05-22 13:15:33 -07:00
Peter von der Ahé 4fddc2e4d5 Move code for instantiating Invocation to Target.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2897683002 .
2017-05-22 15:59:06 +02:00
Erik Corry cad93bb844 Fix x64 precompiled target after prologue changed size
R=vegorov@google.com
BUG=

Review-Url: https://codereview.chromium.org/2897943002 .
2017-05-22 14:30:49 +02:00
Erik Corry aa60a2ea90 More compact string representation on 64 bit.
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 .
2017-05-22 10:04:59 +02:00
Vyacheslav Egorov 20a0e75ef8 VM: Constant fold more loads from constants in the optimizer.
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 .
2017-05-21 19:45:38 +02:00
Vyacheslav Egorov 0eb44ec68f Use same range info when emitting code and computing if instruction can deopt.
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/29620
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2891113002 .
2017-05-21 19:01:49 +02:00
Zachary Anderson 81e428fd39 [infra] Assembles the SDK using GN rather than create_sdk.py
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 #29558

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2848943003 .
2017-05-20 23:30:09 -07:00
Siva Annamalai 7aed6c0a74 Minor code reorg to ensure we don't include parts of the Library tag handler in the precompiled runtime builds.
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2896523003 .
2017-05-19 13:41:23 -07:00
Siva Annamalai 92a516e703 Pull loader.[cc|h] file out of libdart_builtin rule and instead include it in each of the targets (dart|gen_snapshot|dart_bootstrap) that need it. It is not needed in dart_precompiled_runtime but to really remove it from there some refactoring of main.cc is needed. This CL does not address that.
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2887153006 .
2017-05-19 13:27:43 -07:00
Vyacheslav Egorov 1040fefdea Revert "VM: Constant fold more loads from constants in the optimizer."
This reverts commit 746ab58f46.

Reason: precompiler tests broke

    python tools/test.py -mrelease -cprecompiler -rdart_precompiled -aarm -sandroid --use-blobs -t480 corelib/string_test
    python tools/test.py -mrelease -cprecompiler -rdart_precompiled -aarm -sandroid --use-blobs -t480 corelib/list_test/none
    python tools/test.py -mrelease -cprecompiler -rdart_precompiled -aarm -sandroid --use-blobs -t480 corelib/list_test/01

TBR=kustermann@google.com
BUG=

Review-Url: https://codereview.chromium.org/2894913002 .
2017-05-19 17:17:52 +02:00
Erik Corry bd6f0800fc Fix flaky test that makes assumptions about other things on the heap
R=whesse@google.com
BUG=

Review-Url: https://codereview.chromium.org/2896583002 .
2017-05-19 16:58:35 +02:00
Vyacheslav Egorov 746ab58f46 VM: Constant fold more loads from constants in the optimizer.
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 .
2017-05-19 16:06:59 +02:00
Aske Simon Christensen c8f9e0f3f9 Use Function::ZoneHandle for StaticCallInstr targets
R=kustermann@google.com
BUG=

Review-Url: https://codereview.chromium.org/2897643002 .
2017-05-19 15:56:38 +02:00
Aske Simon Christensen 9a1b6c3198 Eliminated PolymorphicInstanceCallInstr with_checks_ field
Create static calls instead of polymorphic calls without checks

R=rmacnak@google.com, vegorov@google.com
BUG=

Review-Url: https://codereview.chromium.org/2877713003 .
2017-05-19 13:36:56 +02:00
Asger Feldthaus 1ea216e6de Add metadata annotations to library definitions.
BUG=
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2893803003 .
2017-05-19 11:35:26 +02:00
Erik Corry 5182eeab26 Remove unused variable
TBR=kustermann@google.com
BUG=

Review-Url: https://codereview.chromium.org/2892793004 .
2017-05-19 09:07:27 +02:00
Erik Corry 4aa5e1d7aa Cleanup: Make CheckClassId instruction more general so it
can be used uniformly in the polymorphic inliner.

R=kustermann@google.com
BUG=

Review-Url: https://codereview.chromium.org/2891713002 .
2017-05-19 08:49:41 +02:00
Erik Corry bd01ce38ce Fix off-by-one error in DBC interpreter
TBR=zra@google.com
BUG=

Review-Url: https://codereview.chromium.org/2888413002 .
2017-05-19 08:46:30 +02:00
Ryan Macnak 03a2c24edf vm-service: Add optional 'scope' parameter to 'evaluate' and 'evaluateInFrame'.
Closes #29535

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2872503004 .
2017-05-18 18:02:49 -07:00
Régis Crelier 9aafded095 Pass type argument vector to generic functions (if --reify-generic-functions is
true, still false per default).
Work in progress, not functional yet (passed vector is still ignored in callee).

R=vegorov@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2859673002 .
2017-05-18 14:03:47 -07:00
Asger Feldthaus 876db33bf4 Add import/export declaration AST node boilerplate to kernel.
Previously only deferred imports were represented. They have been
merged with the general form.

BUG=
R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2852373002 .
2017-05-18 14:38:08 +02:00
Dmitry Stefantsov e5f93a068f Revert "More compact string representation on 64 bit."
This reverts commit 5c8e472c82.

TBR=erikcorry@google.com

Review-Url: https://codereview.chromium.org/2889723005 .
2017-05-18 14:23:12 +02:00
Erik Corry 5c8e472c82 More compact string representation on 64 bit.
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 .
2017-05-18 11:54:40 +02:00
William Hesse 530a0df8f3 Revert "Use Kernel frontend from run_vm_tests."
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 .
2017-05-18 10:41:45 +02:00
Alexander Aprelev d91f228766 Use Kernel frontend from run_vm_tests.
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/28264
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2881953002 .
2017-05-17 21:25:56 -07:00
Alexander Aprelev 8d647ad9b8 Fix test by using private_key parameter.
This fixes error introduced by my previous cl https://codereview.chromium.org/2869573002.

BUG=
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2877293002 .
2017-05-15 09:36:59 -07:00
Jens Johansen 73d3aedc6d [kernel] Fix call to NameIndex(NULL)
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 .
2017-05-15 09:45:16 +02:00
Jens Johansen d26558b7be [kernel] [partial] Streaming of kernel binary without AST nodes
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 .
2017-05-15 09:01:22 +02:00
Erik Corry efe0e76fed Add AddImmediate(reg, int) to ARM64 assembler
It's easier to port code between ARM and ARM64 if the
assemblers support the same methods where possible.
R=vegorov@google.com
BUG=

Review-Url: https://codereview.chromium.org/2874763003 .
2017-05-11 10:46:08 +02:00
Erik Corry 8bce36dab9 Use off-heap data for class check instructions
This continues the work from https://codereview.chromium.org/2842753002/
- see the motivation there.

R=vegorov@google.com
BUG=

Review-Url: https://codereview.chromium.org/2856543002 .
2017-05-11 10:01:05 +02:00
Erik Corry 37b320d381 Avoid scanning huge freelists for large enough free blocks.
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 #29588

R=kustermann@google.com

Review-Url: https://codereview.chromium.org/2872883003 .
2017-05-11 09:41:50 +02:00
Ryan Macnak 1bf31322ad Omnibus Observatory UI fixes:
- 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 .
2017-05-09 17:00:34 -07:00
Ryan Macnak 51ce2ba5e8 Clarify presentation of the target in retaining paths.
Update styles etc to fix missing italics.

R=aam@google.com

Review-Url: https://codereview.chromium.org/2862383002 .
2017-05-09 13:37:33 -07:00