Commit graph

11742 commits

Author SHA1 Message Date
Sigmund Cherem 3ad612cdb2 Mark a couple co19 tests as passing now (didn't notice these on the initial CL
that made stacktraces identical)

TBR=sigurdm@google.com

Review URL: https://codereview.chromium.org//1168163002
2015-06-08 13:11:57 -07:00
Sigmund Cherem 1763aa3467 dart2js: reuse stack trace on rethrow
BUG= dartbug.com/15171
R=sigurdm@google.com

Review URL: https://codereview.chromium.org//1152023004
2015-06-08 12:27:49 -07:00
Asger Feldthaus d01d394af7 dart2js cps: Type casts and related changes to type propagation.
We now optimize type casts that always fail or always pass.
Type propagation has been refactored a bit to make this work.

A new IR node Unreachable has been added. This is an node that is known
to be unreachable and is ultimately compiled to an empty statement.

BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1153603006
2015-06-08 17:02:47 +02:00
Johnni Winther 6fc3592842 Refactoring resolution of local access and unqualified access of statics
BUG=
R=karlklose@google.com

Committed: 58896b74ce

Reverted: 1807369aa1

Review URL: https://codereview.chromium.org//1149403009
2015-06-08 14:51:52 +02:00
Johnni Winther 4db19f3451 Begin to compute constant expressions in resolution.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1170673002
2015-06-08 14:42:35 +02:00
Johnni Winther 1807369aa1 Revert "Refactoring resolution of local access and unqualified access of statics"
This reverts commit 58896b74ce.

BUG=

Review URL: https://codereview.chromium.org//1160313006
2015-06-08 12:55:24 +02:00
Sigurd 28be4b3243 Revert "Reenable async-tests on macos chrome - they are not failing anymore."
This reverts commit 3d5f2b45bf.

Seems my script checked for the wrong thing.

BUG=

Review URL: https://codereview.chromium.org//1158853005
2015-06-08 12:52:59 +02:00
Johnni Winther 58896b74ce Refactoring resolution of local access and unqualified access of statics
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1149403009
2015-06-08 11:53:59 +02:00
Sigurd 3d5f2b45bf Reenable async-tests on macos chrome - they are not failing anymore.
It seems that the new chrome does not trigger the bug.

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

Review URL: https://codereview.chromium.org//1149633010
2015-06-08 11:04:42 +02:00
Ivan Posva f5e3f94019 Fix http://dartbug.com/23578:
- Complete revamp of isolate-specific flags.
- Associate flags with the isolate on creation.
- Dart_CreateIsolate and associate callback do take an
  extra flags argument.
- Make sure to clear IC data array when clearing code.

BUG=23578

Review URL: https://codereview.chromium.org//1162033005
2015-06-07 17:57:34 +02:00
Johnni Winther deb1697fa9 Test all methods in semantic_visitor_test.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1152013006
2015-06-07 10:30:55 +02:00
Paul Berry e8fe98ecb6 Update status file to work around bug #23595
BUG=dartbug.com/23595
TBR=pquitslund@google.com

Review URL: https://codereview.chromium.org//1170593003
2015-06-05 09:33:14 -07:00
Harry Terkelsen fcd407b0cf Revert "Support Package Resolution Configuration files."
This reverts commit 36c29d05bc.

BUG=

Review URL: https://codereview.chromium.org//1165943005
2015-06-04 15:55:13 -07:00
Harry Terkelsen 36c29d05bc Support Package Resolution Configuration files.
BUG=http://dartbug.com/23371
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org//1162363004
2015-06-04 15:15:09 -07:00
Ryan Macnak 6545e8539e Fix isAssignableTo in VM mirrors to use subtype (<:) rather than moreSpecificThan (<<).
BUG=http://dartbug.com/22852
R=gbracha@google.com

Review URL: https://codereview.chromium.org//1156583005
2015-06-04 12:25:59 -07:00
Karl Klose 0e1673ead0 cps_ir: Clean up BuilderTask.
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1149423009
2015-06-04 09:07:03 +02:00
Karl Klose 22976789b5 Mark new test as failing on dart2js-cps_ir.
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1163943006
2015-06-04 09:06:05 +02:00
Srdjan Mitrovic 5649434e4f Disable a test
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1160063004
2015-06-03 16:31:08 -07:00
Srdjan Mitrovic c0824e7725 Fix 23563: double unary- operator unstable for NANs
BUG=
R=koda@google.com

Review URL: https://codereview.chromium.org//1160453003
2015-06-03 11:00:28 -07:00
Regis Crelier 4bf6db0c25 Adjust context level when required before executing inlined finally clauses.
Add regression test.

BUG=23537
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1154823003
2015-06-03 10:31:48 -07:00
Lasse R.H. Nielsen 5a843ebbf3 Add "checked" parameter to Isolate.spawnUri.
R=iposva@google.com

Review URL: https://codereview.chromium.org//1154673004
2015-06-03 12:32:52 +02:00
Srdjan Mitrovic defec9c960 --check_function_fingerprints is available only in dart_no_snapshot, i.e., it was not tested. Make it default true, catch failure at build time then
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1166813002
2015-06-02 16:36:54 -07:00
Daniel Andersson 6090af8f0b Serialize maps without hashes.
Re-generate the indices after deserialization.

This is a more compact representation, and also fixes the issue with identity hash codes not being portable between isolates.

BUG=21675
R=asiva@google.com

Review URL: https://codereview.chromium.org//1151013005
2015-06-02 09:04:37 -07:00
Johnni Winther 4f969bbc3b Remove ConstantExpression.value
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1148343004
2015-06-02 15:23:16 +02:00
Asger Feldthaus c442bf5697 dart2js cps: Do not propagate impure expressions across null receiver.
If the receiver is null, the arguments are not evaluated.

Example:

Dart:
    var x = null;
    var y = bar();
    x.foo(y);

JS before:
    null.foo$1(bar());

JS after:
    var y = bar();
    null.foo$1(y);

If the receiver is known not be null, we still propagate into the
arguments, and "pure" expressions can always propagate even if the
receiver might be null.

InvokeMethod now has a field isReceiverNotNull, which carries a bit of
static type information. Another field like this is InvokeStatic.isPure.

I intentionally chose to pass along the *least* amount of information
that is sufficient for what we need in the tree optimizations.

That CPS type propagation was not very good at proving when things are
not null, so a couple of things missing from it have been filled in.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1159643005
2015-06-02 15:06:29 +02:00
Karl Klose add53e33e7 Optimize identical based on types.
R=asgerf@google.com

Review URL: https://codereview.chromium.org//1080003004
2015-06-02 13:01:42 +02:00
Karl Klose 95a46fb177 Adjust cps_ir test expectations.
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org//1167673009
2015-06-02 11:26:26 +02:00
Johnni Winther 3250c8fd91 Add StringLengthConstantExpression
... and make .fromEnvironment name a ConstantExpression.

BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1166723002
2015-06-02 10:52:50 +02:00
Johnni Winther 411246ccc7 Handle .fromEnvironment and incompatible constructor invocations
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1161823004
2015-06-02 10:44:19 +02:00
Paul Berry 62f7ac8c5d Fix handling of nested typedefs (for real this time).
This is a re-fix of dartbug.com/21912, which I previously fixed
incorrectly.  Previously, our approach to avoiding infinite loops when
comparing types was to maintain a set of typedefs being expanded on
the stack, and prune the comparison whenever an attempt was made to
expand a typedef that was already being expanded.  However, this was
too strict, since there are legal (non-circular) types which invole
expanding a given typedef in reentrant fashion; we can't prune these
types without producing incorrect semantics.  An example (from the bug
report) is the type of f in the code below:

    typedef T Function2<S, T>(S z);
    Function2<Function2<A, B>, Function2<B, A>> f;

The solution is to maintain the list of typedefs being expanded inside
each FunctionTypeImpl object (and InterfaceTypeImpl object) rather
than on the stack during the comparison; this allows us to distinguish
the situations where we need to prune (those having to do exclusively
with expansion of a typedef) from the situations where we shouldn't
prune (those having to do with substitution of a type parameter).

A beneficial side effect of this change is that code that interacts
with types no longer needs to worry about typedef circularities, since
the circularities will automatically be pruned while exploring the
type definitions.  This simplifies the implementation of
isAssignableTo, isSubtypeOf, operator==, and hashCode.  (Note,
however, that code still needs to cope with circularities in the
inheritance hierarchy).

BUG=dartbug.com/21912
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1143003007
2015-06-01 12:45:27 -07:00
Johnni Winther 96efb7bde8 Introduce WorldImpact
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1146813009
2015-06-01 14:43:30 +02:00
Johnni Winther d46101e3bb Split semantic_visitor_test.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1160273002
2015-06-01 13:44:17 +02:00
Johnni Winther a40267cb91 Copy for splitting semantic_visitor_test.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1158803005
2015-06-01 13:38:19 +02:00
Asger Feldthaus bd4e1d726f dart2js cps: Track underlying value of interceptors in type propagation.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1154173002
2015-06-01 11:19:36 +02:00
Karl Klose b1c1c34029 Update dart2js-cps_ir test expectations.
TBR=johnniwinther@google.com

Review URL: https://codereview.chromium.org//1165703002
2015-06-01 11:00:02 +02:00
Regis Crelier 601da25b92 Fix issue 23500
BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1146993003
2015-05-29 13:31:16 -07:00
Sigmund Cherem 013897fe29 Add support for null-aware operators to the CPS-IR.
R=johnniwinther@google.com, kmillikin@google.com

Review URL: https://codereview.chromium.org//1160833003
2015-05-29 12:01:42 -07:00
Asger Feldthaus ac4ab2b5b7 dart2js cps: Remove dart2dart from cps pipeline and clean up.
Removing dart2dart stuff is the most radical change, but there's also
a bunch of general clean up, some of it somewhat unrelated, but long
overdue.

I've focused on making the IR easier to read end-to-end.

For instance, I've stripped out a complicated assertion on InvokeMethod,
because it is distracting and hasn't paid off. AFAIK it never caught a
single bug, but a few times it has spuriously failed and needed
patching.

Some notable changes in the IR:
- Removed FieldDefinition, ConstructorDefinition, Initializers.
- Removed RootNode. There was only one subclass left.
- Removed Body. Has been inlined into FunctionDefinition.
- MutableVariable can no longer be a function parameter.
- Removed default parameter values and local constants from the IR.

I decided to keep nested functions for the time being because there is
a slight chance they might come in handy for async/await.
I'm not sure yet. We can strip them out later if they are not needed.

I've also left the subclassing JsIrBuilder <: IrBuilder for now,
even though the classes could be merged. Same with the visitor.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1155463005
2015-05-29 17:39:00 +02:00
Johnni Winther 76728304e9 Compute more SendStructures on ResolverVisitor.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1157333003
2015-05-29 15:26:28 +02:00
Johnni Winther a6bbcc3c87 Support implicit super constructor invocation in SemanticDeclarationVisitor.
BUG=
R=ajohnsen@google.com, karlklose@google.com

Review URL: https://codereview.chromium.org//1160153002
2015-05-29 14:49:59 +02:00
Lasse R.H. Nielsen babcd4e9c0 Revert "Make EfficientLength public, as EfficientLengthIterable."
It's still not a good solution for detecting an Iterable with an efficient
length. It's not inherited by, e.g., a DelegatingIterable wrapper or similar
generic Iterable transformers.

Keep this as an internal optimization for quickly detecting the most common
efficient-length Iterable classes (List, Set, Queue, Map.keys/values), but
don't make it public.

A *real* solution would be adding a hasEfficientLength getter to Iterable, or
adding an efficientLength getter that may return null if it's not efficient.
This would something that a wrapper can attach to.

R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1154263003
2015-05-29 12:52:45 +02:00
Karl Klose 993338408e cps_ir: Handle malformed type arguments and type checks.
R=asgerf@google.com

Review URL: https://codereview.chromium.org//1156373008
2015-05-29 09:53:35 +02:00
Asger Feldthaus 5f97e22d80 dart2js cps: Change how type variables are accessed in constructors.
Previously there was a problem with type variables referenced inside
a closure inside a field initializer, like so:

class Foo<T> {
	var field = () => T;
}

The type variable cannot be accessed on 'this' because the closure is
created before 'this'. It also cannot be accessed as a parameter.

It is now properly treated as an unboxed free variable, and at
closure creation the value is taken from the constructor parameter
holding the type variable.

As with everything else during constructor build-up, the type variables
are now held in the IR builder's environment. It has proven to be a
robust way of doing things so far.

This simplifies the IR builder's role in this. The builder will not
detect how a type variable should be accessed (i.e. "if inside
a closure inside a field..."). If the type variable is in the
environment that's the one it will use, otherwise it defaults to
extract it from the receiver object.

Also, the closure conversion phase now detects type variables
mentioned in "on T catch()" clauses.

BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1158693003
2015-05-28 14:46:36 +02:00
Asger Feldthaus c29b7c6461 dart2js cps: 'is'-check directly against type variables.
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1160763002
2015-05-28 12:30:00 +02:00
Karl Klose 6bb3084fd3 Add dart2js-cps_ir test expectation for new test regress_23498_test.
Also sort expectations again and remove some whitespace.

R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1143153012
2015-05-28 10:26:13 +02:00
Regis Crelier 1761a60735 Fix restoring of async try context in catch clause (issue 23498).
Add regression test.

Merge branch 'master' into dart1

Fix issue 23498

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1160663004
2015-05-27 13:58:57 -07:00
Paul Berry 1350b724b1 Fix analyzer status file for bug 23461.
This test previously passed due to a flaw in the test, which was fixed
in a8db3278e2.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//1151113003
2015-05-27 13:20:48 -07:00
Alan Knight ee0a5db6a5 Make sanitizer tests handle IE11, where tagName can't be clobbered
BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org//1148893004
2015-05-27 12:56:09 -07:00
Alan Knight 048079dc20 Narrow suppression of animation tests to MacOS
BUG=
R=whesse@google.com

Review URL: https://codereview.chromium.org//1149923005
2015-05-27 10:35:21 -07:00
William Hesse 49a94a6938 Update status for failing tests on MIPS hardware.
BUG=dartbug.com/23536, dartbug.com/22626
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1153243002
2015-05-27 16:33:57 +02:00