Commit Graph

1589 Commits

Author SHA1 Message Date
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
Leaf Petersen f744dea741 Fix DDC presubmit status.
Update some status entries and fix a few miscellaneous issues.

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/3002133002 .
2017-08-22 16:29:18 -07:00
Jennifer Messerly ed5ced82b1 Re-land "fix #30423, covariant parameter tearoff type should be Object"
This is the original CL plus status file fixes.

Disables auto-generated function_type tests that are not working for the Dart 2 runtime behavior, and filed #30462 to track. Also removes the separate status that was skipping these tests in DDC when $checked was unset. $checked is not a thing for Dart 2, and DDC test status should never depend on it.

This reverts commit 1b0b1a4913.

R=leafp@google.com

Review-Url: https://codereview.chromium.org/3001053002 .
2017-08-16 23:23:36 -07:00
Brian Wilkerson 1b0b1a4913 Gardening: Revert "fix #30423, covariant parameter tearoff type should be Object" (TBR)
Review-Url: https://codereview.chromium.org/2995973002 .
2017-08-15 17:02:49 -07:00
Jennifer Messerly d09868c02f fix #30423, covariant parameter tearoff type should be Object
some tests needed to be updated to reflect the informal spec semantics.

R=leafp@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2995813002 .
2017-08-15 14:27:06 -07:00
Konstantin Shcheglov 5b29ae48ad Don't record dependencies in SummaryDataStore.
It was added for DDC, but DDC does not use it anymore. At the same time,
URIs operations are expensive, and this code is showing in Observatory.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2996783002 .
2017-08-09 17:45:13 -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
Leaf Petersen d3344ed466 Fix incorrect nullability inference for ??
Fix bug where (a?.foo) was being incorrectly inferred to be
non-nullable if `foo` was non-nullable.

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2996523003 .
2017-08-04 15:31:01 -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 62303b6711 enable batch mode for dartdevc tests, also fix status so ddc bots pass
R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2987393002 .
2017-08-03 14:39:45 -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
Jennifer Messerly 951e9a5f88 fix DDC travis bot
It appears to have been broken by the language_2 test migration.

Review-Url: https://codereview.chromium.org/2991063002 .
2017-07-28 17:04:32 -07:00
Leaf Petersen 61e071e3e7 Avoid string interpolation in templates.
Replace some constant string interpolation with literal strings.

BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2971453002 .
2017-07-27 13:47:40 -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
Vijay Menon 598b98bd09 Fix DDC travis status
A few more passes, but perhaps one regression:

Chrome 59.0.3071 (Mac OS X 10.12.5)  corelib/date_time10_test FAILED
       Error: Expect.equals(at index 1: Expected <0100-01-01 00:00:00.000Z...>, Found: <0099-01-01 00:00:00.000Z...>) fails.
           at finish (test/browser/language_tests.js:807:59)

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

Review-Url: https://codereview.chromium.org/2983403003 .
2017-07-25 08:36:20 -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
Jennifer Messerly 34361bb02a fix #30138, reland with windows fix
Revert "Revert "fix #30138, synethic nodes causing crash generating source maps""

This reverts commit b7e3d9185d.

R=vsm@google.com

Review-Url: https://codereview.chromium.org/2977183002 .
2017-07-17 15:58:24 -07:00
Jennifer Messerly 87c0b757cb fix #27320, better DDC temp generation
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2980113002 .
2017-07-17 14:33:30 -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 b7e3d9185d Revert "fix #30138, synethic nodes causing crash generating source maps"
This reverts commit 52880e9c4c.

Review-Url: https://codereview.chromium.org/2977163002 .
2017-07-14 15:54:23 -07:00
Jennifer Messerly 52880e9c4c fix #30138, synethic nodes causing crash generating source maps
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2977943002 .
2017-07-14 12:46:22 -07:00
Jennifer Messerly cc167f5901 fix #30108, mock support for callable classes
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2975273002 .
2017-07-14 12:42:16 -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
Vijay Menon d7544d2452 Fix bad merge
R=leafp@google.com

Undo this:
https://github.com/dart-lang/sdk/commit/90380dfdfa4c0feb1ed2a896c4ad9fb20774aa64#diff-faec4ab5f53e175ed283041f1fe3c0bf
Review-Url: https://codereview.chromium.org/2980623002 .
2017-07-11 11:23:33 -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
Bob Nystrom 7b17a3dd01 Use "|" as the separator between module path and name. (#30106)
* Use "|" as the separator between module path and name.

":" is already a path character in Windows. This is why the
dartdevc tests aren't working on Windows. Because they try to do:

-sC:/some/path/blah.dart:blah

And it splits at the first ":". Oops.

* Switch to "=" for separating module path from name.

It looks a little funny when used with "--summary=", but it works fine
and is very unlikely to be used for anything else on any platform
(since we already use it as the separator between arg name and value).
2017-07-07 17:13:43 -07:00
Jacob MacDonald 666b8713d4 fix libraries getter
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2965283002 .
2017-07-06 14:38:28 -07:00
Jennifer Messerly 90380dfdfa fix #27259, implement covariance checking for strong mode and DDC
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2954523002 .
2017-07-06 14:31:35 -07:00
Jennifer Messerly 79cace0848 fix #29028, understand promoted type parameters
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2969373002 .
2017-07-06 13:16:23 -07:00
Jacob MacDonald 7c1e0bea36 add reload to dart_library
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2970283002 .
2017-07-06 13:16:14 -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
Vijay Menon 7b766556a1 Update test status
See #30075

TBR=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2967193002 .
2017-07-05 10:16:25 -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
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
Jennifer Messerly 94af6bf093 fix #29733, handle variables that completely shadow parameters
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2961863003 .
2017-06-29 10:39:09 -07:00
Vijay Menon e84fd776cb Improve runtime error when a module is not loaded
R=alanknight@google.com

Review-Url: https://codereview.chromium.org/2959323002 .
2017-06-29 08:09:26 -07:00
Devon Carew 83d9e3fc91 Fix a few unused imports and symbol warnings.
BUG=
R=messick@google.com

Review-Url: https://codereview.chromium.org/2961013002 .
2017-06-28 09:44:38 -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 daf960d5a4 Fix Object method tearoffs
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2953933002 .
2017-06-22 15:59:45 -07:00