Commit Graph

1709 Commits

Author SHA1 Message Date
Sigmund Cherem 053e0ee720 Minor adjustments to patch files
The implementation of patching in analyzer checks that signatures are identical.
This is stricter than it needs to be, but the required fixes in dart:core are
pretty simple.

BUG=
R=hausner@google.com

Review-Url: https://codereview.chromium.org/2655223005 .
2017-01-27 14:24:06 -08:00
Martin Kustermann 89de0c9267 Reland "VM: Fix memory leaks during isolate spawning"
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2649283003 .
2017-01-24 12:04:41 +01:00
Martin Kustermann 50150deaf6 Revert "VM: Fix memory leaks during isolate spawning"
This reverts commit d7e884b05f.

Review-Url: https://codereview.chromium.org/2654443003 .
2017-01-24 10:32:59 +01:00
Martin Kustermann d7e884b05f VM: Fix memory leaks during isolate spawning
Fixes #28351

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2650693004 .
2017-01-24 09:59:13 +01:00
Ryan Macnak b46af1e75f Refactor snapshots pieces to include a section for loading instructions into the heap of a regular isolate.
Progress toward allowing each isolate to load a different snapshot.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2622053002 .
2017-01-23 10:25:02 -08:00
Benjamin Dopplinger bf5597c95a Fix "classs" typos (#28469) 2017-01-23 17:00:24 +01:00
Ryan Macnak 508e735b8f More ifdefs to make everything build at -O0 and without --gc-sections.
R=regis@google.com

Review-Url: https://codereview.chromium.org/2644163002 .
2017-01-19 12:16:48 -08:00
Martin Kustermann e97bcc5475 VM: [Kernel] Partial support for metadata annotations
The CL adds metadata support for Fields/Classes/Functions/Constructors. There
are other places where annotations can be put in the Dart language but the
Kernel IR currently does not store it in the AST.

Whenever a element (e.g. a function) gets annotated, the VM will make a [Field] for this
element whos value is an array of evaluated constant metadata annotations.

This CL attaches to these [Fields] a `kernel_function` which is then used to do the constant
evaluation.

R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2632253002 .
2017-01-18 10:51:24 +01:00
Ryan Macnak 26a364f998 Support spawnUri in app snapshots.
- Don't mark core_isolate_snapshot_buffer as a const pointer.
 - Update app snapshots without code to not rewrite the VM isolate snapshot, as already done by app snapshots with code.

Fixes #28368

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2637193002 .
2017-01-17 15:59:41 -08:00
Ryan Macnak 12a3699301 Revert "Support spawnUri in app snapshots."
Failures on IA32.

This reverts commit c6ecfe1746.

Review-Url: https://codereview.chromium.org/2631893002 .
2017-01-13 15:52:36 -08:00
Ryan Macnak c6ecfe1746 Support spawnUri in app snapshots.
Don't mark core_isolate_snapshot_buffer as a const pointer.

Fixes #28368

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2623423007 .
2017-01-13 15:18:27 -08:00
Ryan Macnak f89056f6cd Revert "Support spawnUri in app snapshots."
This reverts commit 593d4504b0.
This reverts commit 113aa64b98.
This reverts commit 422afa2ead.

Review-Url: https://codereview.chromium.org/2633543003 .
2017-01-13 11:02:44 -08:00
Ryan Macnak 593d4504b0 Support spawnUri in app snapshots.
Fixes #28368

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2628283002 .
2017-01-13 10:37:51 -08:00
Florian Schneider 2dd8946fc4 Fix service isolate initialization in PRODUCT mode.
My previous CL (removing noopt) incorrectly refactored this code and
broke PRODUCT mode.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2627203002 .
2017-01-11 18:08:35 -08:00
Florian Schneider bef4967ea1 Remove dart_noopt and related parts from the VM.
dart_noopt is not needed anymore because we have testing
and builbot integration of the real precompilation pipeline in place now.

Fixes #24569
Fixes #25726
Fixes #25845

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2624393002 .
2017-01-11 16:55:55 -08:00
Ryan Macnak 2ec03cba70 Fix leak of message snapshot buffer when attempting to send an illegal object.
Fix leak with FLAG_enable_debug_break.

R=asiva@google.com, fschneider@google.com

Review-Url: https://codereview.chromium.org/2629533002 .
2017-01-11 16:50:04 -08:00
Florian Loitsch 2547caab25 Reapply "reflectType() dynamic type arguments support (#26012)"
This was a pull request: 8a8033a417

MirrorsUsed doesn't transitively include reflective information. However, it must still be able to create TypeMirrors for types that are used as return- or parameter types.

Initially, the patch checked that TypeMirrors had the correct number of arguments for generic types. This is now disabled.

A better approach would be to know if a class has full reflective information, or not. But this would require much bigger changes to the system.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2615943004 .
2017-01-10 15:53:21 +01:00
Asger Feldthaus 6bae3151e2 Revert "reflectType() dynamic type arguments support (#26012)"
This reverts commit 8a8033a417.

There are a bunch of dart2js mirror tests that fail.

Issue https://github.com/dart-lang/sdk/pull/26012

BUG=

Review-Url: https://codereview.chromium.org/2617163002 .
2017-01-06 19:12:27 +01:00
Anatoly Pulyaevskiy 8a8033a417 reflectType() dynamic type arguments support (#26012)
* Basic implementation of reflecting generic types using dynamic list of type arguments

* Removed redundant expectation in test

* Added basic support for dynamic type arguments in reflectType of js_mirrors

* Fixes according to code review comments: major cleanup, added more test cases and updated docs

* Updated JS mirrors reflectType() to match behavior of VM implementation

* Terminate exception messages with a dot; Improved error handling for empty argument list and type checks;

* Use NumTypeParameters when checking provided argument list size

* Check if type arguments are malbounded; added test cases for typedefs and mixins

* Uncommented a test case

* Updated lib.status to mark some tests as failing in dart2js due to limitations in JS mirrors

* Fixed mixin test mock definition; updated configuration for tests requiring checked mode

* Handle nested generic types in type argument parsing (JS)
2017-01-06 06:05:14 -08:00
Regis Crelier dc0605012f Move Null type to the Bottom in the VM (fixes #28025).
Fix wrong comments.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2608373002 .
2017-01-05 10:05:31 -08:00
Kevin Millikin 50348f5f22 Fixes to patch files necessary to use the analyzer
The analyzer has a stricter patch parser than the VM.  Patch files
cannot change signatures of patched members.  Specifically, they cannot
change:

  - the return type
  - a parameter's name
  - a parameter to an initializing formal
  - an optional parameter's default value

BUG=
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2612043002 .
2017-01-05 12:23:51 +01:00
Kevin Millikin e2ee86b3f7 Fix dart:typed_data runtimeType getters.
The proper way to override runtimeType in the VM is not to provide an
overriding getter in Dart code but to rely on Class::UserVisibleName.
This works both with optimizations and also with external typed data.

Closes https://github.com/dart-lang/sdk/issues/28183

BUG=
R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2610513004 .
2017-01-05 11:28:22 +01:00
Lasse R.H. Nielsen 44594277e1 Make core libraries use generic method syntax.
Removes comment syntax where possible for the following platform libraries:
* async
* collection
* convert
* core
* internal
* io
* math

The HTML related libraries are not changed. The templates used to build them
must be changed as well.

R=floitsch@google.com

Committed: https://github.com/dart-lang/sdk/commit/68818315b5cc6c63fea0e10e90f515f6083ec095
Committed: https://github.com/dart-lang/sdk/commit/3f74b8d82edca8c342c43306714e68ddf84548e1
Review-Url: https://codereview.chromium.org/2529393002 .
2017-01-03 12:05:40 +01:00
Regis Crelier 3334c2402a Second try: Fix resolution and canonicalization of typedefs and function types
in preparation of the new typedef syntax.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2606993002 .
2016-12-28 14:53:23 -08:00
Regis Crelier 4980107a96 Revert "Fix resolution and canonicalization of typedefs and function types..."
Review-Url: https://codereview.chromium.org/2600313002 .
2016-12-27 17:54:00 -08:00
Regis Crelier 291ed0c545 Fix resolution and canonicalization of typedefs and function types in
preparation of the new typedef syntax.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2592263004 .
2016-12-27 16:55:21 -08:00
Florian Schneider 7615e899be Cache hash code for closures.
Computing the hash code for closures is fairly expensive since
it involves the function name and signature strings.

This CL caches the hash code in the ClosureData object.

Fixes #28161.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2598623002 .
2016-12-23 11:39:23 +01:00
Kevin Millikin d9f80a9ac1 Turn the VM's dart:typed_data into a patch
Before, the VM's dart:typed_data was a complete replacement of the SDK's
dart:typed_data implementation instead of a patch.  This is unlike all
the other SDK libraries.  This difference requires special-casing for
dart:typed_data in tools that handle the SDK libraries (e.g., the
Analyzer's patching support, the GN build).

This change makes dart:typed_data back into a patch to the SDK's
implementation.  It reintroduces a distinction between abstract
interface and concrete implementation classes, so there are more
classes.

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

Committed: https://github.com/dart-lang/sdk/commit/a9b906d319c32525a0600c75c008c92753591d86
Review-Url: https://codereview.chromium.org/2571563005 .
2016-12-22 10:57:21 +01:00
Kevin Millikin f97440848f Revert "Turn the VM's dart:typed_data into a patch"
This reverts commit a9b906d319.

A lot of things were broken by the changes to implementation class
names.

BUG=

Review-Url: https://codereview.chromium.org/2598603002 .
2016-12-21 12:28:33 +01:00
Kevin Millikin a9b906d319 Turn the VM's dart:typed_data into a patch
Before, the VM's dart:typed_data was a complete replacement of the SDK's
dart:typed_data implementation instead of a patch.  This is unlike all
the other SDK libraries.  This difference requires special-casing for
dart:typed_data in tools that handle the SDK libraries (e.g., the
Analyzer's patching support, the GN build).

This change makes dart:typed_data back into a patch to the SDK's
implementation.  It reintroduces a distinction between abstract
interface and concrete implementation classes, so there are more
classes.

BUG=
R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2571563005 .
2016-12-21 08:34:52 +01:00
Kevin Millikin 9ab1f22b41 Make some VM libraries patch cleanly using the analyzer.
Modify the following VM dart: library patches: collection, convert,
developer, _internal, isolate, math, mirrors, profiler, vmservice_io,
_vmservice, _builtin, nativewrappers, and io.

The modifications are mostly because:

    - Patches should not be able to introduce new public members to a
      library's API.  In cases where the VM's patches introduce public
      members, the patches are rewritten to introduce private members
      instead.

    - Patches should not be able to replace arbitrary members, only
      ones declared external.  In cases where the VM's patches replace
      arbitrary members, those members are declared external in the
      SDK sources and dart2js's patch files are rewritten to use the
      original SDK implementation.

BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2564383002 .
2016-12-15 11:30:20 +01:00
Kevin Millikin f7b6f0cf1c Make the VM's dart:core and dart:async library patches clean.
Clean up the VM's dart:core and dart:async library patches so that
they are clean according to the patching rules implemented in the
analyzer.  Specifically:

  - If a member is patched in a patch file, it must be declared external
    in the SDK.

  - If a member is introduced in a patch file, it must be private.

  - A non-private superclass member cannot be overridden in a patch
    file.

BUG=
R=lrn@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2563633002 .
2016-12-15 10:10:09 +01:00
Matthias Hausner 2c0b605a96 Add optional message argument to assert statements in the VM.
Add flag --assert-message to control the feature.

BUG=#24215
R=regis@google.com

Review-Url: https://codereview.chromium.org/2574003003 .
2016-12-14 11:05:19 -08:00
Lasse Reichstein Holst Nielsen 3f74b8d82e Make core libraries use generic method syntax.
Removes comment syntax where possible for the following platform libraries:
* async
* collection
* convert
* core
* internal
* io
* math

The HTML related libraries are not changed. The templates used to build them
must be changed as well.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2529393002 .

Committed: https://github.com/dart-lang/sdk/commit/68818315b5cc6c63fea0e10e90f515f6083ec095
2016-12-14 12:24:36 +01:00
Lasse Reichstein Holst Nielsen 68818315b5 Make core libraries use generic method syntax.
Removes comment syntax where possible for the following platform libraries:
* async
* collection
* convert
* core
* internal
* io
* math

The HTML related libraries are not changed. The templates used to build them
must be changed as well.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2529393002 .
2016-12-14 11:32:16 +01:00
Ben Konyi 7eef11a0e8 Added method to IsolateVisitor to check for special isolates (i.e., service / vm isolates) since this check is done frequently.
BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2567193002 .
2016-12-12 14:54:05 -08:00
John McCutchan f125cc7d0b Improve the casing of Stackmap and Stacktrace.
- [x] Stackmap -> StackMap
- [x] Stacktrace -> StackTrace

This makes us consistent with the Dart language (StackTrace) and
corrects the casing of StackMap.

BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2572563004 .
2016-12-12 14:51:30 -08:00
Matthias Hausner 156fdef01d Revert "Add optional message argument to assert statements in the VM."
This reverts commit 67e83dd79d.

BUG=

Review-Url: https://codereview.chromium.org/2558993005 .
2016-12-09 09:50:27 -08:00
Matthias Hausner 67e83dd79d Add optional message argument to assert statements in the VM.
Add flag --assert-message to control the feature.

Fixes issue #24215
BUG= http://dartbug.com/24215

This replaces Lasse’s CL  1307363005

patch from issue 1307363005 at patchset 140001 (http://crrev.com/1307363005#ps140001)

R=lrn@google.com

Review-Url: https://codereview.chromium.org/2564623003 .
2016-12-09 09:25:58 -08:00
Lasse Reichstein Holst Nielsen 3eee2e69b2 Avoid bigints entering non-bigint gcd implementation.
R=regis@google.com

Review URL: https://codereview.chromium.org/2557713002 .
2016-12-08 07:36:18 +01:00
John McCutchan 6bf86eacd7 Add getIsolateID to Service class in dart:developer
Fixes https://github.com/dart-lang/sdk/issues/23924

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2542003002 .
2016-12-01 12:48:49 -08:00
Lasse Reichstein Holst Nielsen 7957a1c256 Make EfficientLength extend Iterable.
This should help least-upper-bound computations to not think of EfficientLength
as completely separate from Iterable even though they are always used together.

It doesn't solve all problems with the least-upper-bound computation,
but at least some of the more often occuring ones.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2467113003 .

Committed: https://github.com/dart-lang/sdk/commit/b08fb1373f88121bb4056adce9b71849a5bede2a
2016-11-28 08:04:04 +01:00
Vyacheslav Egorov 2403444eba VM: Optimize RegExp.matchAsPrefix(...) by generating a sticky RegExp specialization.
This is the same as a sticky RegExp flag in ES2015.

Overlay some RegExp fields on top of each other - given that they should never be used simultaneously.

BUG=http://dartbug.com/27810
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2510783002 .
2016-11-17 17:46:21 +01:00
Florian Schneider 86d62d66f2 Allocate generic types in new-space before canonicalizing.
A previous CL missed the second allocation site (https://github.com/dart-lang/sdk/commit/6418f8f36caf4f6af2f575c2f1a7ca828d82ee00) in Instance::GetType.

Pass space used in GetType() explicitly to use old-space when invoked from the background compiler.

Fixes #27663.

R=regis@google.com

Review URL: https://codereview.chromium.org/2509013002 .
2016-11-16 12:41:32 -08:00
Vyacheslav Egorov 23fd1a184b VM: Support bootstrapping core libraries from Kernel binaries instead of source.
BUG=http://dartbug.com/27590
R=asiva@google.com

Review URL: https://codereview.chromium.org/2485993002 .
2016-11-16 13:56:20 +01:00
Florian Schneider 2a40a14c7a Improve noSuchMethod error message for type objects.
This CL improves the message when trying to invoke 'call' on _Type objects. This often happens
when 'new' is forgotten ("C()" instead of "new C()")

Fixes #27651.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2507493003 .
2016-11-15 15:20:17 -08:00
Regis Crelier 80f289e54d Remove getter p on double in the VM to control fractional precision.
R=asiva@google.com

Review URL: https://codereview.chromium.org/2489713002 .
2016-11-09 10:56:55 -08:00
Zachary Anderson 2e4dfd3a2d clang-format runtime/lib
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2468093007 .
2016-11-04 12:14:41 -07:00
Ryan Macnak 6cf5c3baa3 Revert "Make EfficientLength extend Iterable."
This reverts commit b08fb1373f.

TBR=lrn@google.com

Review URL: https://codereview.chromium.org/2467283003 .
2016-11-02 13:20:41 -07:00
Lasse R.H. Nielsen b08fb1373f Make EfficientLength extend Iterable.
This should help least-upper-bound computations to not think of EfficientLength
as completely separate from Iterable even though they are always used together.

It doesn't solve all problems with the least-upper-bound computation,
but at least some of the more often occuring ones.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2467113003 .
2016-11-02 14:05:35 +01:00