Commit graph

11834 commits

Author SHA1 Message Date
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
Ryan Macnak e3a07d3145 Resolve inconsistent treatment of stubs in kAppJIT snapshots in favor of writing stubs in the snapshot.
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 .
2017-05-09 10:04:24 -07:00
Alexander Aprelev 5f9ec0abe8 Use latent breakpoints list when looking up or removing breakpoints.
BUG=https://github.com/dart-lang/sdk/issues/29566
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2869573002 .
2017-05-09 05:58:37 -07:00
Ryan Macnak c301c62b1f Avoid error in Observatory about trying to load file not included in the Observatory assets.
Related to issue #29577

R=zra@google.com

Review-Url: https://codereview.chromium.org/2870713002 .
2017-05-08 14:00:11 -07:00
Ryan Macnak 98d31056a7 Change build.py to be like ninja.py and only use a single GN/Ninja invocation to cross-build the SDK. This step alone would fix #29580. This breaks cross-building the SDK with GYP.
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 .
2017-05-08 13:06:09 -07:00
Florian Loitsch 8e01f69305 Void is not required to be null anymore.
In checked mode, `void` now accepts any value.

Fixes #28937.
Fixes #28938.

BUG= http://dartbug.com/28937
BUG= http://dartbug.com/28938
R=johnniwinther@google.com, kmillikin@google.com, lrn@google.com, regis@google.com

Committed: 521dc6620f
Reverted: a3c0cb65af
Committed: 4e52c457a9
Reverted: 4b35d3995b
Committed: 6caf9ef443
Reverted: 30d9bf2ed3
Review-Url: https://codereview.chromium.org/2718513002 .
2017-05-08 11:31:37 +02:00
Jens Johansen 2074c40919 Add more text output to service test pause_on_start_then_step_test
This test has timed out on the bots, but it isn't clear when exactly
it 'stops responding'.

This CL adds a few more lines of output in an attempt to make it
more clear (on any new timeout) where it stops responding.

See https://github.com/dart-lang/sdk/issues/29568 for example timeout.

R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2861673008 .
2017-05-08 08:39:33 +02:00
Zachary Anderson 7fb361907b [infra] Make gclient runhooks gn for Android on supported platforms
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 .
2017-05-06 23:52:26 -07:00
Zachary Anderson 1f5a55cb77 Update ASAN status for clang roll
IsolateReload tests that were failing on x64 asan are now also failing
on ia32 asan.

related #28349

Review-Url: https://codereview.chromium.org/2869583002 .
2017-05-06 23:05:35 -07:00
Bob Nystrom 4145a49503 Move Dart versions of math.min() and math.max() into VM patch file.
For DDC and dart2js, we call the corresponding JS function. This is
shorter and avoids a strong mode type error in the Dart implementation.

R=jmesserly@google.com, lrn@google.com

Review-Url: https://codereview.chromium.org/2858353003 .
2017-05-05 15:15:21 -07:00
Kevin Millikin fbb6c121e6 Add an optional bound to type parameter references
This allows us to represent type parameters with promoted bounds which
are different from the bound at the declaration.  A missing promoted
bound indicates that the type parameter has the original bound at the
declaration.

This is a representation-only change, the optional bound is always
`null`.  Closes #29529.

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

Review-Url: https://codereview.chromium.org/2866593003 .
2017-05-05 23:33:13 +02:00
Jens Johansen 30d9bf2ed3 Revert "Void is not required to be null anymore."
This reverts commit 6caf9ef443.

Commit breaks vm-kernel-linux-debug-x64-be.

Triggers asserts like
../../runtime/vm/flow_graph_compiler_x64.cc: 658: error: expected: dst_type.IsMalformedOrMalbounded() || (!dst_type.IsDynamicType() && !dst_type.IsObjectType() && !dst_type.IsVoidType())

Quick-check with python tools/test.py -cdartk -t120 --builder-tag no_ipv6 --vm-options --no-enable-malloc-hooks isolate

BUG=

Review-Url: https://codereview.chromium.org/2865603003 .
2017-05-05 08:56:26 +02:00
Kevin Millikin 27cae0bb60 Move a definition to fix a compiler error
BUG=

Review-Url: https://codereview.chromium.org/2866503003 .
2017-05-04 23:35:42 +02:00
Kevin Millikin 92cc26eb7a Avoid triggering an assert
Child::operator= has an assert that it does not overwrite a non-null
pointer.  Avoid triggering the assert by casting to another type.

BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2860163003 .
2017-05-04 23:29:36 +02:00
Kevin Millikin 04f7ba272a Remove the Kernel setup_builtin_library transformation
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 .
2017-05-04 20:29:44 +02:00
Ryan Macnak 02c54a6aa6 Rename InstructionsReader to ImageReader for symmetry with ImageWriter.
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2860883002 .
2017-05-04 09:59:33 -07:00
Florian Loitsch 6caf9ef443 Void is not required to be null anymore.
In checked mode, `void` now accepts any value.

Fixes #28937.
Fixes #28938.

BUG= http://dartbug.com/28937
BUG= http://dartbug.com/28938
R=johnniwinther@google.com, lrn@google.com, regis@google.com

Committed: 521dc6620f
Reverted: a3c0cb65af
Committed: 4e52c457a9
Reverted: 4b35d3995b
Review-Url: https://codereview.chromium.org/2718513002 .
2017-05-04 16:27:52 +02:00
Siva Annamalai 9b1412031b Fixes issue 29539 with the workaround of initializing libnotify early by calling localtime_r in OS::InitOnce().
BUG=Fixes #29539
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2854303005 .
2017-05-03 18:24:39 -07:00
Kevin Millikin 9935e86688 Introduce classes for string and name indexes
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 .
2017-05-04 00:43:19 +02:00
Kevin Millikin f13bcbcab6 Support BottomType in the VM Kernel reader
Implement the boilerplate necessary to support BottomType.  In the VM
we use the type Null.

BUG=
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2863493002 .
2017-05-03 23:17:33 +02:00
Kevin Millikin 514281b8a7 Move the Kernel canonical name table into the VM's heap
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 .
2017-05-03 19:27:11 +02:00
Florian Loitsch 4b35d3995b Revert "Void is not required to be null anymore."
This reverts commit 4e52c457a9.

BUG=

Review-Url: https://codereview.chromium.org/2863463002 .
2017-05-03 19:22:22 +02:00
Florian Loitsch 4e52c457a9 Void is not required to be null anymore.
In checked mode, `void` now accepts any value.

Fixes #28937.
Fixes #28938.

BUG= http://dartbug.com/28937
BUG= http://dartbug.com/28938
R=johnniwinther@google.com, lrn@google.com, regis@google.com

Committed: 521dc6620f
Reverted: a3c0cb65af
Review-Url: https://codereview.chromium.org/2718513002 .
2017-05-03 17:43:23 +02:00
Florian Loitsch a3c0cb65af Revert "Void is not required to be null anymore."
This reverts commit 521dc6620f.

BUG=

Review-Url: https://codereview.chromium.org/2855173002 .
2017-05-03 17:36:39 +02:00
Florian Loitsch 521dc6620f Void is not required to be null anymore.
In checked mode, `void` now accepts any value.

Fixes #28937.
Fixes #28938.

BUG= http://dartbug.com/28937
BUG= http://dartbug.com/28938
R=johnniwinther@google.com, lrn@google.com, regis@google.com

Review-Url: https://codereview.chromium.org/2718513002 .
2017-05-03 17:31:21 +02:00