Commit graph

2545 commits

Author SHA1 Message Date
Stephen Adams 94df5a0c24 dart2js: Avoid empty else clauses in generators.
R=sigurdm@google.com

Committed: a02c5798a4

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

Reverted: 803826256d
2016-07-26 09:58:34 -07:00
Jacob Richman 9648db46be TBR. Add back line that should not have been removed.
BUG=

Review URL: https://codereview.chromium.org/2179253002 .
2016-07-25 17:53:27 -07:00
Jacob Richman 96ca5db7e5 Add JSNative utility class with static methods methods to efficiently manipulate typed JSInterop objects in cases where the member name is not known statically. These methods would be extension methods on JSObject if Dart supported extension methods. Update package js to export these methods. Implement in Dart2JS. Implement JS$ in dart2js.
BUG=
R=alanknight@google.com, sra@google.com

Review URL: https://codereview.chromium.org/2150313003 .
2016-07-25 09:59:01 -07:00
Johnni Winther 6549cd24af Split serialization tests further
+ add helpers to compute the split for reuse between tests.

R=whesse@google.com

Review URL: https://codereview.chromium.org/2162053005 .
2016-07-25 10:36:37 +02:00
William Hesse 5790e88f00 Update status for co19 test that also fails on linux Chrome 53.
Also change status for dart2js_native/native_call test from compile-time
error to a runtime error.

BUG=
R=jacobr@google.com

Review URL: https://codereview.chromium.org/2173653004 .
2016-07-22 18:51:22 +02:00
William Hesse ca49303576 Revert "Add fast-mode Uri class."
This reverts commit 00090a0c72.

Revert "Add fast-mode Uri class."

This reverts commit 323ca7e410.

Revert "Fix regression for the one case where we deliberately don't follow the RFC."

This reverts commit b39e048c4b.

Revert "Cache hashCode in Uri implementations to improve performance when used as, e.g., Map key."

This reverts commit a11ad27723.

BUG=https://github.com/dart-lang/sdk/issues/26917
TBR=keertip@google.com

Review URL: https://codereview.chromium.org/2167663002 .
2016-07-20 14:32:52 +02:00
Harry Terkelsen c5728623b9 remove dependency on compiler from resolution
This is the first step of a refactoring that splits the resolution
phase from the backend. The end goal is that resolution can be run
without having to instantiate an entire compiler.

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/2123073003 .
2016-07-18 10:40:21 -07:00
Johnni Winther 941691650c Split out long-running serialization test and add timings to output
BUG=
R=whesse@google.com

Review URL: https://codereview.chromium.org/2156033002 .
2016-07-18 14:09:53 +02:00
Johnni Winther 3305201211 Serialize this-types in NativeBehavior separately.
BUG=
R=het@google.com

Review URL: https://codereview.chromium.org/2150333002 .
2016-07-18 10:42:23 +02:00
Stephen Adams 1eee3c7dc7 dart2js js_runtime: faster code for floor() & ceil()
Within the [-2^31, 2^31) range it is faster to truncate and correct at boundaries than call Math.ceil/Math.floor.

Each call to toInt() has been specialized to the calling operator (ceil, floor, ~/ etc).

This makes the conversion faster (values are already integral) and lets us put the name of the operation and original operands in conversion errors, e.g

(a / b).floor();  // b == 0
Unsupported operation: Infinity
-->
Unsupported operation: Infinity.floor()

a ~/ b;   // b == 0
Unsupported operation: Infinity
-->
Unsupported operation: Result of truncating division is Infinity: 132 ~/ 0

R=sigmund@google.com

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

Downside: an extra 400 bytes
2016-07-15 12:27:59 -07:00
Johnni Winther 5c5a46a6e1 Serialize data for LibraryElement.getImportsFor
R=het@google.com

Review URL: https://codereview.chromium.org/2150533002 .
2016-07-15 10:16:51 +02:00
Johnni Winther f2e435ba88 Serialize prefix members.
R=het@google.com

Review URL: https://codereview.chromium.org/2150493002 .
2016-07-15 09:55:34 +02:00
Johnni Winther 9214293d29 Test ImportElement and fix PrefixElementZ.isTopLevel
BUG=
R=het@google.com

Review URL: https://codereview.chromium.org/2150473002 .
2016-07-15 09:47:29 +02:00
Johnni Winther 38dd1553e8 Support checked mode
Checked mode checks are now always stored in the WorldImpact meaning that
data doesn't have to be serialized with checked mode enabled.

R=het@google.com

Review URL: https://codereview.chromium.org/2129183002 .
2016-07-12 10:10:12 +02:00
Harry Terkelsen 10691da9f8 dart2js: allow trailing commas in parameter and argument lists
Fixes https://github.com/dart-lang/sdk/issues/26646

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

Review URL: https://codereview.chromium.org/2068003002 .
2016-07-08 10:03:51 -07:00
Johnni Winther a805066b34 Update test and status file for jsinterop test.
Test update to avoid analyzer warnings and unittest marked as slow

Review URL: https://codereview.chromium.org/2130333002 .
2016-07-08 13:55:41 +02:00
Johnni Winther f2d1dba0db Add type test for jsinterop types.
BUG=
R=jacobr@google.com

Review URL: https://codereview.chromium.org/2124443002 .
2016-07-08 11:57:12 +02:00
Johnni Winther ddf8a9ddd2 Serialize WarnOnUseElement
R=het@google.com

Review URL: https://codereview.chromium.org/2125793003 .
2016-07-08 11:22:07 +02:00
Johnni Winther 1f1e00f012 Handle redirects to unresolved redirects
The solves the handling of redirecting factories that redirects to other
redirecting factories whos immediate redirection target is unresolved.

For instance

  class C {
    factory C.a() = C.b;
    factory C.b() = Unresolved;
  }

The implementation normalizes the properties 'immediateRedirectionTarget',
'redirectionDeferredPrefix', 'effectiveTarget', 'effectiveTargetType', and
'isEffectiveTargetMalformed' by always storing the information on the
implementation element.

R=het@google.com

Review URL: https://codereview.chromium.org/2125823002 .
2016-07-08 11:14:20 +02:00
Johnni Winther 41535b3b5b Serialize parameter nodes for local functions.
R=het@google.com

Review URL: https://codereview.chromium.org/2125643002 .
2016-07-08 10:57:10 +02:00
Johnni Winther 4a7b1bb57e Support enclosingClass on deserialized local elements
R=het@google.com

Review URL: https://codereview.chromium.org/2124773002 .
2016-07-08 10:47:33 +02:00
Johnni Winther 185d4d5900 Fix serialization of IndexSetIfNullStructure.
R=het@google.com

Review URL: https://codereview.chromium.org/2103833002 .
2016-07-08 10:21:11 +02:00
Johnni Winther 3fcadea405 Compute correct names for closures in operator methods.
Operators were not correctly recognized because of the use of identical
instead of == and thus closures contained untransformed operators in
their names.

R=het@google.com

Review URL: https://codereview.chromium.org/2119193002 .
2016-07-08 10:10:31 +02:00
Johnni Winther d650d0059b Support serialization of generic methods.
BUG=
R=het@google.com

Review URL: https://codereview.chromium.org/2121743002 .
2016-07-08 10:03:02 +02:00
Johnni Winther 04d28ffecb Correct evaluation of interpolated null
R=het@google.com

Review URL: https://codereview.chromium.org/2118203002 .
2016-07-08 09:50:50 +02:00
Johnni Winther daed6fa215 Fix evaluation of constant map with duplicate keys.
BUG=
R=het@google.com

Review URL: https://codereview.chromium.org/2120943002 .
2016-07-08 09:38:37 +02:00
Johnni Winther c719383d0a Serialize async marker on getters.
BUG=
R=het@google.com

Review URL: https://codereview.chromium.org/2120923002 .
2016-07-08 09:31:14 +02:00
Florian Loitsch 31857ab56c Mark mirror_printer_test as slow.
Review URL: https://codereview.chromium.org/2126643002 .
2016-07-05 18:31:10 +02:00
Johnni Winther 3f62feab2d Rename library name in test.
Review URL: https://codereview.chromium.org/2126573002 .
2016-07-05 15:26:31 +02:00
Johnni Winther 1d1a918540 Move long-running test to its own test-file.
Review URL: https://codereview.chromium.org/2121193002 .
2016-07-05 14:53:31 +02:00
Johnni Winther a8114631c7 Use unordered map hash on ConstructedConstantValue.
R=het@google.com

Review URL: https://codereview.chromium.org/2112893002 .
2016-07-01 12:46:08 +02:00
Johnni Winther ceb053a257 Handle fields with initializers in constant constructors.
This also normalizes CompileTimeConstantEvaluator to always create an ErroneousConstantExpression for constants with compile time errors.

R=het@google.com

Committed: 95e6dde715

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

Reverted: fa8f7d20f3
2016-07-01 12:36:55 +02:00
Johnni Winther fa8f7d20f3 Revert "Handle fields with initializers in constant constructors."
This reverts commit 95e6dde715.

BUG=

Review URL: https://codereview.chromium.org/2118763002 .
2016-07-01 11:25:50 +02:00
Johnni Winther 5e3419a8e2 Handle constant ?? expressions in constructors.
R=het@google.com

Review URL: https://codereview.chromium.org/2116483002 .
2016-07-01 11:03:15 +02:00
Johnni Winther f00a439f7c Handle invalid deferred prefix declarations.
R=het@google.com

Review URL: https://codereview.chromium.org/2116473002 .
2016-07-01 10:53:42 +02:00
Johnni Winther ee29d16836 Support serialization of loadLibrary
Adds support for serialization of the 'loadLibrary' getter implicitly
defined on deferred prefixes.

R=het@google.com

Review URL: https://codereview.chromium.org/2110323003 .
2016-07-01 10:48:08 +02:00
Johnni Winther bbd2d67481 Fix and tests command line options
Initial test of regression on the --resolve-only vs --resolution-inputs options.

R=het@google.com

Review URL: https://codereview.chromium.org/2104233003 .
2016-07-01 10:33:30 +02:00
Johnni Winther 2f1cc9e958 Handle forwarding constructors
Handle serialization of forwarding constructors that are defined by
forwarding constructors:

  class A {}
  class B {}
  class C {}
  class D = A with B, C;

The default constructor of D is a forwarding constructor defined by the
default constructor of its super type A+B, which itself is a forwarding
constructor. Thus, the defining constructor might itself be synthesized
and therefore serialized indirectly.

R=het@google.com

Review URL: https://codereview.chromium.org/2105183003 .
2016-07-01 10:28:50 +02:00
Johnni Winther 95e6dde715 Handle fields with initializers in constant constructors.
This also normalizes CompileTimeConstantEvaluator to always create an ErroneousConstantExpression for constants with compile time errors.

R=het@google.com

Review URL: https://codereview.chromium.org/2104843002 .
2016-07-01 10:22:10 +02:00
Lasse R.H. Nielsen 323ca7e410 Add fast-mode Uri class.
Optimize parser and make it recognize a class of URIs that don't need extra
handling: no escapes, no funny characters, already (nearly or completely)
normalized.
Have a class specifically for those URIs which retains the original
input string without having allocate any further strings.

R=floitsch@google.com

Committed: 00090a0c72

Review URL: https://codereview.chromium.org/2086613003 .
2016-06-30 13:25:36 +02:00
Lasse R.H. Nielsen 00090a0c72 Add fast-mode Uri class.
Optimize parser and make it recognize a class of URIs that don't need extra
handling: no escapes, no funny characters, already (nearly or completely)
normalized.
Have a class specifically for those URIs which retains the original
input string without having allocate any further strings.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2086613003.
2016-06-30 12:20:15 +02:00
William Hesse f36b49f8f3 Update status for failing and flaky tests.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org/2109593003 .
2016-06-29 22:42:51 +02:00
Erik Ernst 442fc53b3c Implementation of modified scoping for initializing formals.
In order to make an implementation of initializing formal access in
`dart2js` available as specified in issue #26655 now, this CL changes
the scope management such that initializing formals are not in scope in
the constructor body, only in the initializer list.

This is done by introducing a new notion of scopes implemented
by `ExtensionScope`: Such a scope will extend an existing
`NestedScope` rather than adding a new nested scope to it.

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/2059883002 .
2016-06-29 11:42:03 +02:00
Johnni Winther 0cf82efd76 Handle double literals in constant constructors.
R=het@google.com

Review URL: https://codereview.chromium.org/2102553002 .
2016-06-28 09:47:16 +02:00
Johnni Winther f010d5e01c Fix evaluation of !=
ConstantExpression.evaluate now computes != as the negation of the result of ==

R=het@google.com

Review URL: https://codereview.chromium.org/2094273002 .
2016-06-28 09:41:49 +02:00
Johnni Winther 717333c801 Handle rti for closures.
Use ResolvedAst to retrieve ClosureClassMap data for runtime type information.

R=het@google.com

Review URL: https://codereview.chromium.org/2100813002 .
2016-06-28 09:36:27 +02:00
Johnni Winther 9445281b0c Split long-running serialization tests to avoid timeouts
Review URL: https://codereview.chromium.org/2096423002 .
2016-06-27 15:29:03 +02:00
Johnni Winther 1bafa91055 Support malformed types
Adds a simple serialization of malformed types.

R=het@google.com

Review URL: https://codereview.chromium.org/2099703002 .
2016-06-27 10:10:21 +02:00
Johnni Winther 74775a65b2 Skip unresolved functions in NoSuchMethodRegistry
Deserialized function do not have a [ResolvedAst] if they are not live.

The first stop towards the best solution is to skip unresolved (not live)
method, next step is to avoid registration of these methods in the
first place.

R=het@google.com

Review URL: https://codereview.chromium.org/2092913004 .
2016-06-27 09:50:40 +02:00
Johnni Winther 4ce5c75b08 Update semantic_visitor_send_data to reflect the current state.
BUG=
R=ahe@google.com

Review URL: https://codereview.chromium.org/2095883002 .
2016-06-24 11:21:35 +02:00