Commit Graph

1034 Commits

Author SHA1 Message Date
Johnni Winther 29cdb17f39 Refactor visitSendSet for super compounds and assignment.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1274073003.
2015-08-06 14:38:05 +02:00
Ryan Macnak b6c979f20b Hoist InstanceMirror.delegate to ObjectMirror.
BUG=http://dartbug.com/14827
R=gbracha@google.com

Review URL: https://codereview.chromium.org//1273983002 .
2015-08-05 17:09:59 -07:00
Florian Loitsch 6377f18587 dart2js: use correct Compiler class.
Review URL: https://codereview.chromium.org//1272613003 .
2015-08-05 14:24:36 +02:00
Florian Loitsch 49daca25d0 dart2js: Set the name to null for parameter stubs of static functions.
R=sigmund@google.com

Review URL: https://codereview.chromium.org//1252543002 .
2015-08-05 13:48:52 +02:00
Florian Loitsch 7e9fcbf5d6 dart2js: Add a header to the output of the startup emitter.
R=sigmund@google.com

Review URL: https://codereview.chromium.org//1271953003 .
2015-08-05 13:47:39 +02:00
Florian Loitsch 3cbedb02e4 dart2js: Add --fast-startup flag.
R=sigmund@google.com

Review URL: https://codereview.chromium.org//1273503002 .
2015-08-05 13:06:29 +02:00
Florian Loitsch c33930b5d9 dart2js: Fix lazy statics in the startup-emitter.
R=sigmund@google.com

Review URL: https://codereview.chromium.org//1264283003 .
2015-08-04 14:21:16 +02:00
Florian Loitsch 47c5878757 dart2js: fix a few TODOs in the startup emitter.
R=sigmund@google.com

Review URL: https://codereview.chromium.org//1264303002 .
2015-08-04 14:17:15 +02:00
Florian Loitsch e9b91c7c92 Default values for static functions are now inside closures. (in the startup emitter).
Since static closures are const values, they can reference each other in the default values:

foo([x = bar]) => null;
bar([x = foo]) => null;

Therefore, we must not reference the default values during tear-off installation (as was the case until now).

The corresponding test has been uploaded in https://chromiumcodereview.appspot.com/1255083008/

R=sigmund@google.com

Review URL: https://codereview.chromium.org//1266903004 .
2015-08-04 13:56:28 +02:00
Florian Loitsch 98edcfaee5 dart2js: support checked setters in startup-emitter.
R=sigmund@google.com

Review URL: https://codereview.chromium.org//1249833005 .
2015-08-03 18:07:10 +02:00
Florian Loitsch 0231f6ba39 dart2js: fix named arguments with Function.apply in the startup emitter.
This includes a full rewrite of the Function.apply in the runtime.

R=sigmund@google.com

Review URL: https://codereview.chromium.org//1252533003 .
2015-08-03 18:06:31 +02:00
Florian Loitsch f6b142c5f4 dart2js: Support const symbols in the startup emitter.
R=sigmund@google.com

Review URL: https://codereview.chromium.org//1253443003 .
2015-08-03 17:56:34 +02:00
Florian Loitsch 8d6063d806 dart2js: support isolates in the startup-emitter.
R=sigmund@google.com

Review URL: https://codereview.chromium.org//1249023002 .
2015-08-03 17:48:43 +02:00
Florian Loitsch 3880150e3a dart2js: Add an empty "MANGLED_NAMES" embedded global to the startup-emitter.
There will be another update on this embedded global. In fact it is needed for const symbols.

For simplicity I would prefer committing this CL first (to avoid too much merging/rebasing).

R=sigmund@google.com

Review URL: https://codereview.chromium.org//1250023002 .
2015-08-03 17:47:45 +02:00
Florian Loitsch 5d30039ccc dart2js: Use the correct hashes for deferred code in the startup-emitter.
Also support source-maps.

R=sigmund@google.com

Review URL: https://codereview.chromium.org//1235973004 .
2015-08-03 17:46:39 +02:00
Florian Loitsch 9a633402a7 dart2js: Support natives in the startup emitter.
R=sigmund@google.com

Review URL: https://codereview.chromium.org//1234623002 .
2015-08-03 17:45:23 +02:00
Florian Loitsch fd6e27c11d dart2js: Add embedded globals to startup emitter.
R=sigmund@google.com

Review URL: https://codereview.chromium.org//1233693002 .
2015-08-03 17:42:08 +02:00
Florian Loitsch 62b49eadc6 dart2js: support tear-offs in the startup emitter.
R=sigmund@google.com

Review URL: https://codereview.chromium.org//1229923005 .
2015-08-03 17:02:31 +02:00
Johnni Winther 0a1b5dfbef Handle super index SendSet operations.
BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1262363003.
2015-07-31 15:42:05 +02:00
Johnni Winther e8a19f42af Refactor resolution index SendSet operations.
BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1258073010.
2015-07-30 13:00:36 +02:00
Florian Loitsch dcb76e65e6 dart2js: fill in the basic functionality of the startup emitter.
R=sigmund@google.com

Review URL: https://codereview.chromium.org//1234493003 .
2015-07-29 19:17:32 +02:00
Johnni Winther 31a62b5505 Add AccessSemantics.INVALID for invalid expressions.
BUG=
R=herhut@google.com

Review URL: https://codereview.chromium.org//1261623002.
2015-07-29 10:26:40 +02:00
Anders Johnsen 98772b9726 Expose getter and setter invocations by name, in dart2js 'World'.
BUG=
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org//1258243002 .
2015-07-28 13:17:46 +02:00
Sigmund Cherem 2cb9fc4343 dart2js: fix typo
TBR= johnniwinther@google.com

Review URL: https://codereview.chromium.org//1260733002 .
2015-07-27 09:25:46 -07:00
Sigmund Cherem e09981a6d0 dart2js: fix crash when annotations have syntax errors (fix #23983)
BUG= https://github.com/dart-lang/sdk/issues/23893
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org//1257513002 .
2015-07-27 09:20:52 -07:00
Johnni Winther 783ed933ff Fix boolean conversion bug in dart2js + update JSRegExp accordingly.
BUG=
R=herhut@google.com

Review URL: https://codereview.chromium.org//1259473005.
2015-07-27 14:19:26 +02:00
Karl Klose 2a137d16db dart2js cps: Fix performance issues in optimization passes.
Type propagation, shrinking reductions, and let sinking each took
more than 2 minutes on a stress test, where now they take a few
seconds.

Huge hash tables (Map/Set) were a big problem, especially when used as
worklists.

Let sinking had an issue with a linear-time search for the enclosing
continuation of an expression. This has been replaced with a visitor
state.

The stress test was:

  tests/co19/src/LibTest/collection/ListBase/ListBase_class_A01_t02

This was only slow because negative constants get translated to
intercepted calls. That itself should be fixed, but the IR should
still be able to handle the stress.

The change in shrinking reductions altered the redex priority from
FIFO to LIFO which has a negative effect on code quality in
unwrapException (in any test case with a try/catch). It seems like
an existing issue that has surfaced.

Since I am going on vacation, I ask that someone would please
commit this on my behalf (assuming things are looking good).
--asgerf

BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1252883003 .
2015-07-27 12:12:06 +02:00
Johnni Winther 3ba94ff882 Temporarily disable source_map_operators_test while fixing underlying error.
BUG=

Review URL: https://codereview.chromium.org//1249253002.
2015-07-23 16:27:37 +02:00
Johnni Winther d7fcc59318 Split MessageKind into a MessageKind key and a MessageTemplate.
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1248483008.
2015-07-23 14:42:34 +02:00
Asger Feldthaus 7d038fbc67 dart2js cps: Avoid deep recursion using trampolines and basic blocks.
The CPS RecursiveVisitor now uses an explicit stack of things to do
on the way out of a term. Every CPS pass has been hacked to fit the
new visitor paradigm.

The tree visitors now iterate over chains of ExpressionStatements.
This seems to do the trick, mostly because direct-style rewriting
significantly reduces the height of the tree.

The IR tracers still use deep recursion, but they are disabled by
default anyway so they are not critical.

BUG=
R=floitsch@google.com, karlklose@google.com

Review URL: https://codereview.chromium.org//1251083002.
2015-07-23 13:52:04 +02:00
Asger Feldthaus 7d8067135c dart2js cps: Support 'on T' clauses without a 'catch'.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1247333003.
2015-07-23 12:39:10 +02:00
Anders Johnsen d15d8988f7 Remove unneded 'async' marker.
BUG=

Review URL: https://codereview.chromium.org//1248593003 .
2015-07-23 09:52:57 +02:00
Anders Johnsen 792b8776d9 Fix previous change.
BUG=

Review URL: https://codereview.chromium.org//1249033002 .
2015-07-22 17:45:17 +02:00
Anders Johnsen 7ed648fb20 Remove (for the time being) async-await from dart2js.
BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1254453002 .
2015-07-22 17:38:39 +02:00
Karl Klose 1b7053bcf6 dart2js cps: Use CPS IR for patched functions and typed data.
R=asgerf@google.com

Review URL: https://codereview.chromium.org//1241303003 .
2015-07-22 13:07:35 +02:00
Johnni Winther 6d38ebd06e Add operators test to source_mapping_test.
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1250633002.
2015-07-22 13:03:30 +02:00
Sigurd 253ffeed4a Deferred loading track type-dependencies for is, as and type-annotations.
BUG=
R=johnniwinther@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org//1245583002 .
2015-07-22 11:05:41 +02:00
Johnni Winther 2526ef6b4b Add SubclassNode to prepare for optimized queries on ClassWorld.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1234053002.
2015-07-21 16:30:02 +02:00
Karl Klose 50bcad9d0b dart2js cps: Cleanup type annotations in type propagation and remove code to handle null continuation on foreign code node.
R=asgerf@google.com

Review URL: https://codereview.chromium.org//1250473004 .
2015-07-21 15:59:49 +02:00
Johnni Winther 4439c480b2 Add access the Message in CompilerDiagnostics.report.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1247773002.
2015-07-21 14:36:46 +02:00
Florian Loitsch 39d3812bc0 dart2js: Support checked setters in the program builder.
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1245833003 .
2015-07-21 14:13:52 +02:00
Asger Feldthaus c9733e22ce dart2js cps: Remove NonTailThrow.
The builder instead creates a LetCont with an unused continuation to
hold the unreachable code following the non-tail throw.

This removes the cleanup pass after building and removes an awkward
CPS node.

BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1243063002.
2015-07-21 11:07:28 +02:00
Asger Feldthaus 6e0a210da0 dart2js cps: Share interceptors by default and propagate to use later.
We now only introduce one getInterceptor call per primitive.

(The main use for GVN seemed to be cleaning up these calls, but we
might as well not introduce them in the first place).

To propagate single-used interceptors to their use, propagation of
constant-like expressions has changed.

There is a new CPS pass, let sinking, which sinks single-used pure
primitives to their use when the use is not inside a loop.

Conversely, the tree IR's assignment propagation has been made less
aggressive to compensate for things now handled by let sinking.

R=floitsch@google.com

Review URL: https://codereview.chromium.org//1238163003.
2015-07-20 16:53:27 +02:00
Asger Feldthaus 4d933a2d0d dart2js cps: Streamline expressions and primitives.
SetStatic, SetField, and SetMutableVariable are now primitives instead
of interior expressions. They are valueless primitives, i.e. they are
bound by LetPrim but their value is never referenced.

This should simplify basic block traversal, since there are now fewer
types of interior expressions.

The four remaining interior expressions are: LetPrim, LetCont,
LetHandler, and LetMutable. Incidentally, these are exactly the four
expressions that can bind definitions.

GetMutableVariable and SetMutableVariable have also been renamed
to GetMutable and SetMutable to be uniform with LetMutable.

BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1240263002.
2015-07-20 15:59:41 +02:00
Florian Loitsch fb4633a1c5 dart2js: Use JS_GET_NAME instead of magic constant for catch-all function.
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1245573002 .
2015-07-20 14:53:59 +02:00
Florian Loitsch 5cf1f59843 Accept 'null' as document.contentScript.
When running as a content script in a Chrome extension `document.contentScript` is set to `null`. We should take that value instead of trying to compute another one based on script tags (the work-around we have for IE). Since content-scripts are not part of the page, it might be that there aren't even any other scripts and the work-around mechanism simply fails (thus not starting the main function).

R=karlklose@google.com

Review URL: https://codereview.chromium.org//1224363004 .
2015-07-20 12:54:02 +02:00
Johnni Winther 6f92dfe8ff Handle deferred access as pre-step in SemanticSendVisitor.
BUG=
R=floitsch@google.com, sigurdm@google.com

Review URL: https://codereview.chromium.org//1238783003.
2015-07-20 11:18:18 +02:00
Florian Loitsch 79645ebd9d dart2js: Add boilerplate strings for the startup-emitter.
R=sigmund@google.com

Review URL: https://codereview.chromium.org//1229913003 .
2015-07-17 20:00:00 +02:00
Florian Loitsch 784e244111 dart2js: add isConstantsHolder to Holder class.
R=sigmund@google.com

Review URL: https://codereview.chromium.org//1233263003 .
2015-07-17 19:27:29 +02:00
Sigmund Cherem 4ad37a6107 dart2js: fix dependency tracking for deferred loading when types are only used
in type arguments by the main fragment. (fix #23853)

R=floitsch@google.com

Review URL: https://codereview.chromium.org//1244513003 .
2015-07-17 08:46:00 -07:00