Commit Graph

981 Commits

Author SHA1 Message Date
Janice Collins 51cc9689b3 Remove corelib and corelib_strong and migrate last two remaining tests.
This includes a migration of linked_hash_map_from_iterable_test and
stacktrace_current_test, which were migrated without changes.

BUG=
R=rnystrom@google.com, whesse@google.com

Review-Url: https://codereview.chromium.org/3004073002 .
2017-09-01 08:11:15 -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
Vijay Menon e96be63fd5 Fix ddc build_sdk step
R=leafp@google.com

Review-Url: https://codereview.chromium.org/3011753002 .
2017-08-31 13:53:18 -07: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
Zachary Anderson d0295c873c [dart:io] Namespaces for file IO
Fuchsia requires the ability to sandbox Isolates w.r.t. file IO.
When a new Isolate starts, Fuchsia will pass the Isolate an object
called a namespace. We can translate the namespace object into a
file descriptor suitable for passing to the *at() family of
POSIX file system calls. The file system calls will then
have visibility only into the specified namespace.

We also plumb Namespaces through on all the other platforms as well to
make the change easier to test and so that in the future we can
implement e.g. per-isolate cwds.

This change adds a new internal class to dart:io called _Namespace,
which is implemented in a patch file. See:

sdk/lib/io/namespace_impl.dart
runtime/bin/namespace_patch.dart

The embedder can set up a non-default namespace by calling
_Namespace._setupNamespace during Isolate setup.

Instances of _Namespace have a native field that holds a pointer
to a native Namespace object. See:

runtime/bin/namespace.h

Calls from e.g. file_impl.dart are now also passed a
_Namespace object. The implementations in e.g. file.cc and
file_linux.cc then extract the namespace, and use it to compute a
file descriptor and path suitable for passing to e.g. openat().

related US-313

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

Review-Url: https://codereview.chromium.org/3007703002 .
2017-08-30 09:34:36 -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
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
Jennifer Messerly 4466c461f0 optimize extension member symbols in DDC, issue #30531
This approach preserves our current semantics. There's room for further optimizations, though, as it's still not as fast as string names

R=vsm@google.com

Review-Url: https://codereview.chromium.org/3002393002 .
2017-08-25 18:36:41 -07:00
Jennifer Messerly 087c5c6a81 fix list_test for strong mode, and fix DDC List constructors
R=vsm@google.com

Review-Url: https://codereview.chromium.org/3009623002 .
2017-08-25 18:32:43 -07:00
Jennifer Messerly 45592ee4bb improve DDC's type checks
fixes #30495 - optimize subtype cache
fixes #30464 - optimize `is List`

Additional changes:
- optimize double type checks
- optimize Object type checks
- optimize FutureOr<T> checks
- optimize interface checks for some dart:core and dart:async types (List, Map, Iterable, Future, Stream, and StreamSubscription )
- optimize checks for generic class default instantiations and exact instantiation (e.g. `C<dynamic>` on any instance `C<T>`, and `C<T> on an instance of C<T>`
- optimize checks for native types
- optimize getReifiedType
- optimize dcall/dsend/dput checks to use faster Type._check pattern
- optimize instanceOf/cast functions by moving special cases to appropriate types
- optimize Object.runtimeType
- optimize JS interop type checks
- optimize all function type checks

There's more we can do (especially for class/interface types) but this should cover a lot of cases.

R=leafp@google.com

Review-Url: https://codereview.chromium.org/3003613002 .
2017-08-25 12:45:13 -07:00
Jennifer Messerly d0072fa73f Fix the return type of String.split in DDC to be correct
It wasn't actually a List<String>, so it could fail a strong mode cast, and also permitted non-Strings to be added.

R=leafp@google.com

Review-Url: https://codereview.chromium.org/3005533002 .
2017-08-25 11:24:54 -07:00
Leaf Petersen 19a1393ae7 Address additional comments on nullability
Address some post-submit comments on a previous CL, and fix some
unrelated analyzer hints in passing.

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/3007533002 .
2017-08-24 15:37:43 -07:00
Leaf Petersen 1b8f4ac1e7 Optimize DDC private runtime library files.
Eliminate numerous type checks not needed in strong mode.  Use
private nullability annotations instead of inline JS to mark known
non-null variables, and to make the compiler generate null checks
for null checked variables. Use nullability annotations and code refactoring to
remove redundant null checks and to move checks out of loops.

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2994203002 .
2017-08-23 10:28:45 -07:00
Jennifer Messerly 65e609548d fix #28988, remove throw on Dart1 incompatible is-checks for dartdevc
We've had this flag off in testing for quite a while. This should not affect user code because it's removing a throw.

R=leafp@google.com

Review-Url: https://codereview.chromium.org/2996573002 .
2017-08-07 16:41:18 -07:00
Vijay Menon 4ead726a8c Check for cross-frame violation
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2991353003 .
2017-08-03 16:53:40 -07:00
Jennifer Messerly d705cff08e fix #30290, assertion messages that contain yield
also fixes list_sort_test to work in strong mode.

R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2985333002 .
2017-07-31 14:20:21 -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
Jennifer Messerly f0c8fe6763 remove redundant type check in DDC's SDK implementation
Review-Url: https://codereview.chromium.org/2985063002 .
2017-07-25 18:33: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
Vijay Menon 19a19f4423 Fix getSetterType in presence of metadata
R=jmesserly@google.com, rnystrom@google.com

Review-Url: https://codereview.chromium.org/2986673002 .
2017-07-23 19:56:06 -07:00
Jennifer Messerly 04f3c8835f implement Invocation.typeArguments in DDC
also fixes various bugs:
* setters now use the correct memberName symbol, fixes #30223
* object members work for callable classes, fixes #30213
* some test fixes to work in strong mode
* a few other small cleanups (e.g. obsolete `dart.list` is removed)

R=vsm@google.com

Review-Url: https://codereview.chromium.org/2979353002 .
2017-07-21 15:51:16 -07:00
Vijay Menon 87ee6cc0d6 Polyfill only once
Avoid dcall on polyfill.

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2983903002 .
2017-07-19 13:42:23 -07:00
Vijay Menon 99e672d1cb Registration-based approach to cross frame support.
This approach installs all Dart extension types onto a window whenever
that window is accessed.

See #28326

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2980853002 .
2017-07-19 12:53:43 -07:00
Vijay Menon 12e32e230d Add hook to register global object
DDC will use this in a later CL.

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

Stephen: I assume this will get compiled out be dart2js.
Review-Url: https://codereview.chromium.org/2983813002 .
2017-07-19 05:46:07 -07:00
Vijay Menon ab39958ac5 Dummy DDC implementation of MirrorSystem
It's a bit absurd that a bunch of tests are passing with this.

R=leafp@google.com

Review-Url: https://codereview.chromium.org/2978223002 .
2017-07-18 13:00:23 -07:00
Vijay Menon 8913dd97df Update ddc dart:html
This is just a straight copy of the dart2js version to pick up sra's range fix.

TBR=sra@google.com,alanknight@google.com

Review-Url: https://codereview.chromium.org/2983693002 .
2017-07-17 12:14:30 -07:00
Leaf Petersen 9f059e58b4 Move null check out of getExtensionType
BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2980133002 .
2017-07-14 17:02:09 -07:00
Jennifer Messerly 418d11fbd6 fix #30094, assert should work with a function
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2971243003 .
2017-07-13 22:51:45 -07:00
Leaf Petersen 4f7fa8a930 Check for null when getting the extension type.
isJsInterop can call this with null.

BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2983523002 .
2017-07-13 16:48:25 -07:00
Leaf Petersen 4a87156b13 Move NullError into interceptors
Put the NullError class into interceptors so that it will be picked
up as a native type.

BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2976173002 .
2017-07-13 14:38:39 -07:00
Vijay Menon d952055a7e Support ClassMirror.newInstance on factory constructors
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2976133002 .
2017-07-13 13:07:37 -07:00
Natalie Weizenbaum 5a74d8ab09 Properly handle Windows file: URLs on Node.js (#30098)
This adds logic to the JS implementation of URI to determine whether
the code is running on Windows under Node.js.
2017-07-12 14:57:01 -07:00
Vijay Menon 5b742853c7 Treat JS TypeError as Dart NSM
Fixes #30134

R=jacobr@google.com

Review-Url: https://codereview.chromium.org/2979613002 .
2017-07-11 05:44:22 -07:00
Jennifer Messerly 5533a256cb fix #30030, fix #27327 - fix tearoffs and various Object member bugs
this includes various cleanups found along the way:
* various issues with JS annotations, see #30043
* getGenericClass is now optimized when used in a JS builtin with a Type literal
* typed list literals should be slightly faster to create
* memoized getters used by dart:_runtime should be faster
* registerExtension should be a tad faster, and now understands JSArray
* dart.bind "safeName" hack gone in codegenerator
* JSArray<E>.runtimeType returns List<E>
* JSArray<E>.noSuchMethod works
* cleans up code that generates `setExtensionBaseClass` (used only by JSArray)
* _throwUnsafe helper for generating a `throw` in --unsafe compile mode
* fix tearoff of JS interop types (_emitSimpleIdentifier)
* fix TODO about splitting LazyJSType and AnonymousJSType
* fix is/as/cast methods on TypeRep and related classes
* fix codegenerator to not tearoff "hashCode" and "runtimeType" (they are not methods)
* fix NoSuchMethodError.toString()   (update via dart2js sdk impl)

R=vsm@google.com

Review-Url: https://codereview.chromium.org/2962263002 .
2017-07-05 14:17:53 -07:00
Bob Nystrom 52a9e3d9c6 Fix build_pkgs.dart to not mutate arguments list. (#30078)
* Fix build_pkgs.dart to not mutate arguments list.

Also remove build of when package since it's apparently gone now.

* Use sublist to remove element.
2017-07-05 12:20:58 -07:00
Leaf Petersen 6f73694bb7 Generate better code for '==', core.identical, and dart.test.
Avoid falling back to the dart.equal runtime helper where possible based on static types.  Also uses JS `==` or `===` in some cases.

Treat core.identical as a compiler intrinsic, based on type.

Make dart.test assume correct types, use dart.dtest for combined cast and nullability check only when required.

Fixes https://github.com/dart-lang/sdk/issues/29851
Fixes https://github.com/dart-lang/sdk/issues/29772
BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2926613003 .
2017-06-30 15:04:29 -07:00
Bob Nystrom 24743461c9 Fix test.sh to not run non-existent shell script.
R=leafp@google.com

Review-Url: https://codereview.chromium.org/2964123002 .
2017-06-29 17:25:17 -07:00
Leaf Petersen 24f9478550 Fix handling of inline JS types in DDC.
DDC was incorrectly interpreting inline JS types, and hence marking
some things as non-nullable which were nullable.  This fixes that, and
also slightly improves the analyzers treatment of inline JS types.
Also fixes some incorrect inline JS type annotations in DDC patch
files.

BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2965633002 .
2017-06-29 16:02:04 -07:00
Bob Nystrom 0b2c9b048d Dynamically load packages for dartdevc tests in test.dart.
This involves a few pieces:

- Add support to DDC for specifying the module name associated with a
  given summary. This lets test.dart invoke DDC using summaries in the
  build directory outside of the directory containing the test itself.

- Add support to the build scripts for building the packages. This adds
  a new GN target that builds everything needed to run test.dart with
  dartdevc. In particular, it invokes build_pkgs.dart to compile the
  relevant packages to JS+summary so that the tests can use them.

  This requires some changes to build_pkgs.dart so it can output to a
  given directory.

- In test.dart, when tests are compiled with dartdevc, pass in the
  summaries for the packages so they don't get compiled in. Then, when
  the test is run, configure require.js with the right paths to their
  JS files so they can be loaded.

  I also removed a bunch of unneeded buildDir parameters being passed
  around the various CompilerConfiguration class methods now that they
  have direct access to the configuration.

Fix #29923.

R=vsm@google.com, whesse@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2955513002 .
2017-06-29 13:45:57 -07:00
Vijay Menon fd6164cce4 Handle toString on DOM types
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2952363003 .
2017-06-27 09:22:25 -07:00
Erik Corry 029b1cb948 Spelling fixes e to i.
R=kevmoo@google.com
BUG=

Review-Url: https://codereview.chromium.org/2957593002 .
2017-06-24 13:41:39 +02:00
Vijay Menon 7d73159017 Fix ddc build
Not sure why this just started breaking.  I don't think Ben added this
param - just a use of it.  Our patch script might not be catching the
mismatch.

TBR=jmesserly@google.com,bkonyi@google.com

Review-Url: https://codereview.chromium.org/2954513003 .
2017-06-22 14:27:22 -07:00
Vijay Menon ecca1e1c2a Add FallThroughError patch
TBR=jensj@google.com,rnystrom@google.com

Review-Url: https://codereview.chromium.org/2953693002 .
2017-06-21 16:33:31 -07:00
Jennifer Messerly 070f31a899 optimize null safe ops by using DDC's let abstraction
We were already using it for most other things (increment ops, op assign, ??, cascades, etc)

R=vsm@google.com

Review-Url: https://codereview.chromium.org/2944413002 .
2017-06-20 10:31:30 -07:00
Jennifer Messerly 1f50f0d126 fix mixins with factory constructors
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2935933005 .
2017-06-13 15:58:50 -07:00
Alan Knight 9e3fdbf94d Update DDC core patch for ConstantExpressionError
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2941593002 .
2017-06-13 13:57:42 -07:00