Commit Graph

1989 Commits

Author SHA1 Message Date
Terry Lucas 0585e74b63 Fixed analyzer test to use dart2js not dartium
R=paulberry@google.com

Committed: https://github.com/dart-lang/sdk/commit/704de3bb3e27313c0eb6eb5ebc03173a5396dd1e
Review-Url: https://codereview.chromium.org/3004153002 .
2017-09-01 09:03:16 -07:00
William Hesse a8cab7a205 Revert "Removed Dartium SDK libs"
This reverts commit 4a58918382.
That commit seems to have broken docgen on the html libraries.

BUG=
TBR=terry@google.com

Review-Url: https://codereview.chromium.org/3004173002 .
2017-09-01 00:47:57 +02:00
Terry Lucas 4a58918382 Removed Dartium SDK libs
First stage remove the libraries that are no longer part of 1.25 and beyond.

R=alanknight@google.com, sigmund@google.com

Committed: https://github.com/dart-lang/sdk/commit/a18908461adc431af2ee0114ed5ea9ef781bfb67
Committed: https://github.com/dart-lang/sdk/commit/d96561af083777ac9529c75ae05b6e89f8f06a6c
Review-Url: https://codereview.chromium.org/3008563002 .
2017-08-31 07:17:23 -07:00
Terry Lucas f1269525a8 Revert: Removed Dartium SDK libs
Review-Url: https://codereview.chromium.org/3005913003 .
2017-08-30 20:47:07 -07:00
Terry Lucas d96561af08 Removed Dartium SDK libs
First stage remove the libraries that are no longer part of 1.25 and beyond.

R=alanknight@google.com, sigmund@google.com

Committed: https://github.com/dart-lang/sdk/commit/a18908461adc431af2ee0114ed5ea9ef781bfb67
Review-Url: https://codereview.chromium.org/3008563002 .
2017-08-30 20:07:15 -07:00
Terry Lucas 05ca90aa8c Removed Dartium test exceptions
R=alanknight@google.com

Committed: https://github.com/dart-lang/sdk/commit/84f079f24c75aec51a53c17f1ebe0027b2adbb0c
Review-Url: https://codereview.chromium.org/2983033002 .
2017-08-29 07:15:06 -07:00
Terry Lucas a18908461a Removed Dartium SDK libs
First stage remove the libraries that are no longer part of 1.25 and beyond.

R=alanknight@google.com

Review-Url: https://codereview.chromium.org/3008563002 .
2017-08-29 06:38:53 -07:00
Régis Crelier b3a7dd6e9d [VM generic function reification] Support generic functions in Invocation class.
Make VM object TypeArguments a Dart instance.
Add a test verifying that noSuchMethod works with generic functions.

R=floitsch@google.com, rmacnak@google.com

Review-Url: https://codereview.chromium.org/3007603002 .
2017-08-28 17:00:39 -07:00
Lasse R.H. Nielsen c8b6c19314 Revert "Add ticks counter to Timer."
Tests broken in DDC

Review-Url: https://codereview.chromium.org/3011503002 .
2017-08-28 13:14:09 +02:00
Lasse R.H. Nielsen 39c8f64ea3 Add ticks counter to Timer.
Avoid VM scheduling multiple timer events if it gets delayed. This doesn't
scale for processes that are suspended for extended amounts of time.

R=floitsch@google.com

Review-Url: https://codereview.chromium.org/3003853002 .
2017-08-28 12:57:45 +02:00
Ryan Macnak 60a7160273 Reapply "[vm] Prevent non-fatal errors from causing timers to be dropped."
Fix Linux event handler to re-arm the timer_fd after handling a wakeup.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2996243003 .
2017-08-18 13:38:08 -07:00
Ryan Macnak 9ce7fb5929 Revert "Reapply "Eliminate dependencies on assemblers and code stubs in precompiled runtime.""
This reverts commit 8ee4436355.

This change caused a 63% increase in AOT snapshot size of Flutter Gallery.

Issue #30472

Review-Url: https://codereview.chromium.org/2997993002 .
2017-08-17 13:33:37 -07:00
Ryan Macnak c536c82521 Revert "[vm] Prevent non-fatal errors from causing timers to be dropped."
This reverts commit 8692f618f6.

This change caused co19/LibTest/isolate/Isolate/spawn_A06_t06 to timeout.

Review-Url: https://codereview.chromium.org/3001863002 .
2017-08-17 13:19:48 -07:00
Ryan Macnak 8692f618f6 [vm] Prevent non-fatal errors from causing timers to be dropped.
Issue #30425

R=zra@google.com

Review-Url: https://codereview.chromium.org/2995103002 .
2017-08-17 11:34:30 -07:00
Régis Crelier 1829af87e9 [VM mirrors and reified generic functions] Mirrors do not (and will probably
never) support reification of generic functions. However, instead of crashing
with an UNIMPLEMENTED, reify function type parameters to dynamic.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2997083002 .
2017-08-17 11:11:05 -07:00
Zachary Anderson 734beef062 [infra] Translate _sources.gypi files to _sources.gni files
Also deletes code that becomes dead as a result.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2996903002 .
2017-08-14 21:54:36 -07:00
Aske Simon Christensen 8ee4436355 Reapply "Eliminate dependencies on assemblers and code stubs in precompiled runtime."
Also exclude references to disassembler in precompiled mode.

New edits are in patch set #2.

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

Review-Url: https://codereview.chromium.org/2994863002 .
2017-08-12 02:15:23 +02:00
Ryan Macnak 3afd223f90 [gardening] Revert "Eliminate dependencies on assemblers and code stubs in precompiled runtime."
This reverts commit 46c53882cc.

This changes introduced link errors on Windows.

Review-Url: https://codereview.chromium.org/3001463002 .
2017-08-09 15:49:51 -07:00
Aske Simon Christensen 46c53882cc Eliminate dependencies on assemblers and code stubs in precompiled runtime.
Guard all excluded code behind conditional compilation.

Removed precompiled runtime flag. Only preprocessor flag remains.

BUG= https://github.com/dart-lang/sdk/issues/30045
R=rmacnak@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2976723003 .
2017-08-09 22:21:34 +02:00
Ryan Macnak 8879e6a2c0 [vm, gardening] Move --trace-service output to stderr.
Prevents interleaving with output on stdout that is parsed. E.g.,

R=cbernaschina@google.com

FormatException: Invalid character (at character 24)
http://127.0.0.1:59909/[+400ms] Isolate kernel-service.dart.snapshot$main-5...
Review-Url: https://codereview.chromium.org/2998713002 .
2017-08-09 13:06:14 -07:00
Alexander Markov b64014c624 [corelib] Add explicit overflow checks to int.parse
In the --limit-ints-to-64-bits mode, when Dart integers are limited
to 64 bits, int.parse() should detect and reject large integers.
This CL adds explicit overflow checks into int.parse() implementation.

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

Issue: https://github.com/dart-lang/sdk/issues/30103
Review-Url: https://codereview.chromium.org/2987003002 .
2017-07-31 08:31:46 -07:00
Zachary Anderson 633ed4cf83 [corelib] dart:developer timeline flow events
This change adds an API to dart:developer Timeline for
adding flow events to the timeline. For details see the
changes in:

sdk/lib/developer/timeline.dart

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2985253002 .
2017-07-31 07:46:52 -07:00
Florian Loitsch ee46026671 Don't use LinkedList in the core libraries anymore.
R=lrn@google.com

Committed: https://github.com/dart-lang/sdk/commit/fe17b5b2bc24454dd2f596d8ce6e2e7661e87f10
Reverted: https://github.com/dart-lang/sdk/commit/5d4a786f4466ebcb06c36ed44f262c9e120a7273
Review-Url: https://codereview.chromium.org/2975443002 .
2017-07-28 21:14:11 +02:00
Erik Corry 8f5a106e2f VM: Remove old LinkedHashMap implementation that is no longer used
There may be some reason that I am overlooking why we can't do this.
It works fine in the default VM config.
R=zra@google.com
BUG=

Review-Url: https://codereview.chromium.org/2984683002 .
2017-07-28 14:17:20 +02:00
Ryan Macnak 3f7771912c [vm, mirrors] Remove Dartium's dart:io hack.
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2990823002 .
2017-07-26 17:54:09 -07:00
Zachary Anderson 9e7e66602f Compute the script Uri lazily
Previously, the string set up by the embedder was eagerly passed to
Uri.parse during Isolate startup. This is expensive both in time and
memory footprint. This CL causes Uri.parse() to be called only
when needed. This change will allow reducing the memory footprint
of Fuchsia's Dart content handler on hello world by ~1MB.

fixes #25603

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2988613002 .
2017-07-24 12:56:21 -07:00
Alexander Markov bda3c9c2b2 Simplify and fix implicit closure check, speed up Closure_equals, v2
This is the re-application of 44e8da3ecd
with fixes:
* Dartanalyzer error is fixed in the new test isolate/message4_test
* The new test is skipped in the status file in dart2j/non-d8 modes,
  issue #30247 is created.
* Minor tweak of Closure_equals: other.IsClosure() is tested earlier.

Original CL review:

https://codereview.chromium.org/2989493002/

Original CL description:

This CL introduces a new Function kind, kImplicitClosureFunction, in
order to simplify check for implicit closures and make it more
efficient.

This CL also fixes Function::IsImplicitStaticClosureFunction(RawFunction*)
to correctly handle implicit closures created from static native
functions.

Closes #30203.

As the result of a faster check for implicit closures and slight
refactoring of Closure_equals, micro-benchmark exercising Closure_equals
speeds up from 9618ms to 6700ms for implicit closures case and
insignificantly for other cases.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2987703002 .
2017-07-24 09:43:52 -07:00
Alexander Markov 45dddb2807 Revert "Simplify and fix implicit closure check, speed up Closure_equals"
This reverts commit 44e8da3ecd.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2984083002 .
2017-07-21 15:39:20 -07:00
Alexander Markov 44e8da3ecd Simplify and fix implicit closure check, speed up Closure_equals
This CL introduces a new Function kind, kImplicitClosureFunction, in
order to simplify check for implicit closures and make it more
efficient.

This CL also fixes Function::IsImplicitStaticClosureFunction(RawFunction*)
to correctly handle implicit closures created from static native
functions.

Closes #30203.

As the result of a faster check for implicit closures and slight
refactoring of Closure_equals, micro-benchmark exercising Closure_equals
speeds up from 9618ms to 6700ms for implicit closures case and
insignificantly for other cases.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2989493002 .
2017-07-21 14:26:56 -07:00
Zachary Anderson 350ad3a4dc Special-case Timeline.{start,finish}Sync for Fuchsia
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2984603002 .
2017-07-21 08:06:36 -07:00
Alexander Markov 203955bc48 Reapply "Improve hashCode for closure objects" with fixes.
This CL includes the following fixes:
* Fix for incorrect non-nullable assumption about _Closure._hash field.
* Add error handling into BecomeMapTraits::Hash.
* Correct assertions for validating layout of Closure objects.
* Add identityHashCode to the list of VM entry points in precompiler.

Closes #30211.

Original code review:

https://codereview.chromium.org/2983823002/

Original CL description:

This performance improvement is inspired by Flutter listeners stored in
the HashSet (see ObserverList) and frequently checked using
HashSet.contains(). If there are many such listeners and they are
implicit instance closures (for example, created by
'new Listenable.merge(...)'), HashSet.contains() becomes very slow.
It spends a lot of time in Closure_equals native method due to hash
collisions between closure objects with same function
but different receivers.

This CL improves hashCode() calculation for implicit instance closures
by mixing function hashcode with identity hashcode of the receiver.
For explicit closures and static implicit closures hashCode() is
improved by using identityHashCode() of a closure object.

Also, hashcode is calculated once and cached in each closure instance.
The size of a closure instance doesn't grow up because there was unused
word-size padding both on 32-bit and 64-bit architectures.

The execution time of the following micro-benchmark is reduced from
47665ms to 135ms on my Linux/x64 box.

-------------------------------------

import "dart:collection";

class Foo {
  int _a;
  Foo(this._a);
  void bar() {}
}

main() {
  HashSet hs = new HashSet();
  for (int i = 0; i < 1000; ++i) {
    hs.add(new Foo(i).bar);
  }

  var watch = new Stopwatch()..start();

  for (int i = 0; i < 1000; ++i) {
    for (var c in hs) {
      hs.contains(c);
    }
  }

  int time = watch.elapsedMilliseconds;
  print("Time: ${time}ms\n");
}

-------------------------------------

R=zra@google.com

Review-Url: https://codereview.chromium.org/2988493002 .
2017-07-20 15:22:18 -07:00
Alexander Markov 51d580d8bf Revert "Improve hashCode for closure objects"
This reverts commit b1197eb714.

Revert "Correct assertions for validating layout of Closure objects"

This reverts commit b1215faa59.

Revert "Add identityHashCode to the list of VM entry points in precompiler"

This reverts commit e1d04cc242.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2983973002 .
2017-07-20 08:34:28 -07:00
Alexander Markov b1197eb714 Improve hashCode for closure objects
This performance improvement is inspired by Flutter listeners stored in
the HashSet (see ObserverList) and frequently checked using
HashSet.contains(). If there are many such listeners and they are
implicit instance closures (for example, created by
'new Listenable.merge(...)'), HashSet.contains() becomes very slow.
It spends a lot of time in Closure_equals native method due to hash
collisions between closure objects with same function
but different receivers.

This CL improves hashCode() calculation for implicit instance closures
by mixing function hashcode with identity hashcode of the receiver.
For explicit closures and static implicit closures hashCode() is
improved by using identityHashCode() of a closure object.

Also, hashcode is calculated once and cached in each closure instance.
The size of a closure instance doesn't grow up because there was unused
word-size padding both on 32-bit and 64-bit architectures.

The execution time of the following micro-benchmark is reduced from
47665ms to 135ms on my Linux/x64 box.

-------------------------------------

import "dart:collection";

class Foo {
  int _a;
  Foo(this._a);
  void bar() {}
}

main() {
  HashSet hs = new HashSet();
  for (int i = 0; i < 1000; ++i) {
    hs.add(new Foo(i).bar);
  }

  var watch = new Stopwatch()..start();

  for (int i = 0; i < 1000; ++i) {
    for (var c in hs) {
      hs.contains(c);
    }
  }

  int time = watch.elapsedMilliseconds;
  print("Time: ${time}ms\n");
}

-------------------------------------

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

Review-Url: https://codereview.chromium.org/2983823002 .
2017-07-19 14:36:42 -07:00
Zachary Anderson 952345ff84 Remove the debugger_ field from Isolate in a PRODUCT build.
This is the first in a series of CL in which I am removing fields from
classes that aren't used in PRODUCT mode. This CL removes the
debugger_ field from Isolate.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2981173002 .
2017-07-18 13:29:40 -07:00
Alexander Markov 15e1136e3e Add comments for constants which replaced large integer literals
R=regis@google.com, zra@google.com

Issue: https://github.com/dart-lang/sdk/issues/30103
Review-Url: https://codereview.chromium.org/2980243002 .
2017-07-17 13:28:39 -07:00
Alexander Markov bc937b3b6b Reapply CL "Option to truncate integers to 64 bits, part 2"
This is the 2nd attempt to land the CL
abed3c2a70

Original review: https://codereview.chromium.org/2982823002
No extra changes were made. Large literals in the Dart core library
which caused failures during the previous attempt to land this CL have
been fixed separately.

Description of the CL:

In --limit-ints-to-64-bits mode:
* Integer constructors return Integer::null if integer is out of range.
* Error is reported for integer literals which are out of range.
* Dart API is revised to return errors if integers are out of range.

Bigint::IsDisabled() method is introduced to be able to enable/disable
Bigints independently of --limit-ints-to-64-bits mode in future.

Deprecated constructor Integer::NewFromUint64 is replaced with
Integer::New in certain cases.

R=regis@google.com

Issue: https://github.com/dart-lang/sdk/issues/30103
Review-Url: https://codereview.chromium.org/2980223002 .
2017-07-17 12:20:17 -07:00
Vyacheslav Egorov c6815e8522 Reapply 0489249d29 with a fix for front_end tests.
Proper sequencing of _asyncStackTraceHelper in Kernel

This helper function was being called before its argument was
initialized so it was passing null.  Instead, it should be called
after its argument is initialized.

Because the initialization happens in Kernel code, it is simplest to
insert the call explicitly in Kernel code as well as part of the async
transformation.  This has the consequence that we now call the helper
function even when the flag causal_async_stacks is false.

Fixes issue #29771.
Fixes issue #30178
Fixes issue #30058

BUG=
R=aam@google.com, asiva@google.com

Review-Url: https://codereview.chromium.org/2936793003 .
Review-Url: https://codereview.chromium.org/2982943002 .
2017-07-17 20:56:28 +02:00
Alexander Markov a2388dd370 Avoid Bigint literals in Dart core library
This CL is a step towards preparation of Dart core library for 64-bit
integers in Dart. In the new --limit-ints-to-64-bits mode integer
literals which are out of range will be rejected, so such literals
should not be used in the core library.

R=zra@google.com

Issue: https://github.com/dart-lang/sdk/issues/30103
Review-Url: https://codereview.chromium.org/2983633002 .
2017-07-17 08:04:59 -07:00
Alexander Markov 776aef9ff0 Revert "Option to truncate integers to 64 bits, part 2"
This reverts commit abed3c2a70.

TBR

Review-Url: https://codereview.chromium.org/2977143002 .
2017-07-14 14:40:58 -07:00
Alexander Markov abed3c2a70 Option to truncate integers to 64 bits, part 2
In --limit-ints-to-64-bits mode:
* Integer constructors return Integer::null if integer is out of range.
* Error is reported for integer literals which are out of range.
* Dart API is revised to return errors if integers are out of range.

Bigint::IsDisabled() method is introduced to be able to enable/disable
Bigints independently of --limit-ints-to-64-bits mode in future.

Deprecated constructor Integer::NewFromUint64 is replaced with
Integer::New in certain cases.

R=zra@google.com

Issue: https://github.com/dart-lang/sdk/issues/30103
Review-Url: https://codereview.chromium.org/2982823002 .
2017-07-14 13:24:53 -07:00
Alexander Markov 031533f04d Remove unused native methods ByteData_ToEndian<T>
It seems like these native methods are defined in C++ code but not used
from Dart code. This CL cleans them up.

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

Digging into history reveals that the following CL replaced
these native methods with Dart implementation:
https://codereview.chromium.org//860963002
Review-Url: https://codereview.chromium.org/2983433002 .
2017-07-13 10:08:45 -07:00
Zachary Anderson 6cd8a79078 VM: Re-format to use at most one newline between functions
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Ryan Macnak f20b32b793 [vm] Enable mirrors in product mode. Allows building a product mode SDK.
Fixes https://github.com/dart-lang/sdk/issues/29972

R=zra@google.com

Review-Url: https://codereview.chromium.org/2972883002 .
2017-07-12 12:55:58 -07:00
Aske Simon Christensen ab7d9a5720 Omit JIT compiler from precompiled runtime on ARM, ARM64 and IA32.
Saves about a megabyte on the size of the precompiled runtime VM.

Next step will be to eliminate the assemblers and code stubs as well. This requires some more disentangling.

Until then, the X64 build still includes the compiler, since its assembler has a dependency on locations.cc, which is part of the compiler.

BUG= https://github.com/dart-lang/sdk/issues/30045
R=rmacnak@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2960413002 .
2017-07-11 12:01:49 +02:00
Alexander Markov 7a20b6b8d8 Option to truncate integers to 64 bits, part 1 (core VM changes)
This changeset revises --limit-ints-to-64-bits option to
change range of integers from unlimited to int64.
On overflow, integer arithmetic operations silently wrap around and
discard extra bits. No Bigints are allocated in case of overflow.

This changeset is the 1st part in the series of changes, it revises the implementation of integer arithmetic operations. More changes will follow.

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

Issue: https://github.com/dart-lang/sdk/issues/30103
Review-Url: https://codereview.chromium.org/2974633003 .
2017-07-10 15:16:40 -07:00
Florian Loitsch 5d4a786f44 Revert "Don't use LinkedList in the core libraries anymore."
This reverts commit fe17b5b2bc.

Review-Url: https://codereview.chromium.org/2974073002 .
2017-07-10 14:58:04 +02:00
Florian Loitsch fe17b5b2bc Don't use LinkedList in the core libraries anymore.
R=lrn@google.com

Review-Url: https://codereview.chromium.org/2975443002 .
2017-07-10 14:09:24 +02:00
Vyacheslav Egorov d24040af02 VM(CoreLib): Work around JIT optimization issue revealed by cec963f028
Array Bounds Check Generalization pass attempts to hoist CheckArrayBound
instructions out of loops by generalizing them: for example in the loop
like

  for (var i = 0; i < L; i++) {
    // a[i]
    CheckArrayBound(i, a.length)
    LoadIndexed(a, i)
  }

we hoist CheckArrayBound(i, a.length) by turning it into
CheckArrayBound(L - 1, a.length):

  CheckArrayBound(L - 1, a.length)
  for (var i = 0; i < L; i++) {
    // a[i]
    LoadIndexed(a, i)
  }

However this leads to deoptimizations if the loop never executes: e.g. if
L = 0 then L - 1 is -1 which does not pass generalized bounds check.

We prevent repeated deoptimizations by disabling this optimization if any
of the generalized bounds checks deoptimizes. However this does not work
as intended because we only check this flag on an outermost function, so
if function with a problematic bounds check get inlined into a lot of places
it ends up causing a lot of deoptimizations in different places.

This is why cec963f028 caused performance issues
in dartdoc: _GrowableList._grow is now called with length == 0 whenever we
add an element to an empty list. This causes deoptimization in a lot of different
functions in dartdoc because _GrowableList._grow ends up inlined into a lot
of different places.

Fixes https://github.com/dart-lang/sdk/issues/30090

This CL will be reverted once a better solution for the underlying problem is in place (tracked by https://github.com/dart-lang/sdk/issues/30102)

BUG=
R=askesc@google.com, erikcorry@google.com

Review-Url: https://codereview.chromium.org/2971303002 .
2017-07-07 14:34:52 +02:00
Erik Corry 955a4b6e71 VM: Reland Inline instance object hash code into object header on 64bit.
Inline instance object hash code into object header on 64 bit.

64 bit objects have 32 bits of free space in the header word.
This is used for the hash code in string objects. We take it
for the default hash code on all objects that don't override
the hashCode getter.

This is both faster and a memory reduction. Eg it makes the
MegaHashCode part of the Megamorphic benchmark 6 times faster.

This is a reland of https://codereview.chromium.org/2954453002/
which fixes an issue that made script snapshots generated on
64 bit platforms incompatible with 32 bit VMs.

BUG=
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2965723002 .
2017-07-03 09:26:46 +02:00
Ryan Macnak f1b7e8ed8c Add gdb helper functions for creating a handle and using ToCString with RawObjects.
Improves gdb debugging when Object::Handle() is optimized away.

Replace some intermediate static_libraries with source_sets to fix export issue.

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

Review-Url: https://codereview.chromium.org/2957843002 .
2017-06-29 14:31:44 -07:00