Commit Graph

645 Commits

Author SHA1 Message Date
Karl Klose 3f46181244 cps-ir: Support foreign code.
R=kmillikin@google.com

Committed: https://github.com/dart-lang/sdk/commit/a120ee7c9071b60edccff066dcdade078f601377

Reverted: https://github.com/dart-lang/sdk/commit/40ed0daaaf71904d2da271e66ba8381ef857116d

Review URL: https://codereview.chromium.org//1185633003.
2015-06-19 13:44:58 +02:00
Karl Klose 40ed0daaaf Revert "cps-ir: Support foreign code."
This reverts commit a120ee7c90.

TBR=kmillikin@google.com

Review URL: https://codereview.chromium.org//1196443002.
2015-06-18 13:37:52 +02:00
Karl Klose a120ee7c90 cps-ir: Support foreign code.
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1185633003.
2015-06-18 13:09:50 +02:00
Asger Feldthaus fb38d61dba dart2js cps: Support function types in 'is' and 'as' operators.
The generated code uses different helpers than the SSA. In SSA, there are calls to buildFunctionType and _isTest. The CPS uses checkSubtypeOfRuntimeType, the "one size fits all" method we also use to test against type variable types.

When the function type has no type variables in it we could hoist the function type into a constant, but the constant system does not support type representation constants at the moment. But it seems like an optimization we may want to add later.

BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1180973003.
2015-06-18 11:30:57 +02:00
Karl Klose a842f6dff2 Update dart2js-cps_ir test expectations.
TBR=johnniwinther@google.com

Review URL: https://codereview.chromium.org//1188183006.
2015-06-17 09:41:50 +02:00
Karl Klose bb45376735 Update dart2js-cps_ir status files.
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1191433002.
2015-06-15 12:50:58 +02:00
Karl Klose 6cffe227fe Update dart2js-cps_ir test expectations after bac7481d3d.
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org//1171773004.
2015-06-09 15:12:18 +02: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 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
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 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 f1bbc3bb2d dart2js cps: 'is' checks on types with type arguments.
R=karlklose@google.com

Committed: https://github.com/dart-lang/sdk/commit/00c33fb1347fc5c44a324f9503c7c57969e88ca3

Reverted: https://github.com/dart-lang/sdk/commit/f0c4e31174996e6259fab283af14c49aa8faf28c

Review URL: https://codereview.chromium.org//1161683002
2015-05-27 14:14:07 +02:00
Asger Feldthaus f0c4e31174 Revert "dart2js cps: 'is' checks on types with type arguments."
This reverts commit 00c33fb134.

TBR=karlklose@google.com

BUG=

Review URL: https://codereview.chromium.org//1161793002
2015-05-27 13:54:07 +02:00
Asger Feldthaus 00c33fb134 dart2js cps: 'is' checks on types with type arguments.
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1161683002
2015-05-27 13:45:39 +02:00
Asger Feldthaus f42a0ef25c dart2js cps: Always use interceptors and type tags for 'is' checks.
"x is Foo" will become getInterceptor(x).$isFoo

Testing against a type with type arguments is still a giveup().

This test always works, but is not very fast. For instance, testing
against an int should be "typeof x === 'number' && Math.floor(x) === x".

Following an offline discussion with Karl, the plan is to rewrite
'is'-checks to more fine-grained tests in a CPS optimization pass,
probably the type propagator.

Concretely, we plan to introduce IR nodes like TypeOfTest, FloorTest,
InstanceofTest, etc, which optimization phases can introduce under the
right circumstances. That way, the code generation phase remains simple.

BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1144163004
2015-05-26 17:50:48 +02:00
Karl Klose bd612bbec3 cps-ir: Add test suppressions for new tests.
TBR=johnniwinther@google.com

Review URL: https://codereview.chromium.org//1156673002
2015-05-22 12:43:19 +02:00
Karl Klose 36d3e0d0e6 Update cps-ir test expectations.
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org//1152133003
2015-05-22 09:58:58 +02:00
Asger Feldthaus ccee558a5b dart2js cps: Access to lazily initialized fields.
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1136843006
2015-05-19 10:05:09 +02:00
karlklose@google.com 9b32c9e673 Implement raw list checks.
R=asgerf@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45762 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-13 11:58:45 +00:00
asgerf@google.com f5f1eb643d dart2js cps: Introduce GetStatic/SetStatic.
The GetStatic is used for reading static fields and tearing off
static methods.

Invoking a static getter/setter (not from a field) is still an
InvokeStatic, which IMO is the way it should remain.

BUG=
R=karlklose@google.com

Committed: https://code.google.com/p/dart/source/detail?r=45735

Reverted: https://code.google.com/p/dart/source/detail?r=45737

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45738 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 14:19:40 +00:00
asgerf@google.com 961c805398 Revert "dart2js cps: Introduce GetStatic/SetStatic."
This reverts commit 28e4518df87c72cb8e23fe6d73b7750ad0f2183a.

TBR=karlklose@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45737 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 13:53:15 +00:00
asgerf@google.com 2c90643171 dart2js cps: Introduce GetStatic/SetStatic.
The GetStatic is used for reading static fields and tearing off
static methods.

Invoking a static getter/setter (not from a field) is still an
InvokeStatic, which IMO is the way it should remain.

BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45735 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 13:35:49 +00:00
karlklose@google.com a31ba4242c Adjust test expectations for dart2js_cps-ir.
TBR=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45705 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 18:33:14 +00:00
floitsch@google.com f4a1b28077 Move isolate tests to lib/isolate.
Moves most tests that require dart:isolate to the isolate-directory in the tests section.

Also enables the string_from_environment_default_value_test which didn't have "_test" in its name.

R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45701 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 17:59:51 +00:00
karlklose@google.com 0eaa4d4717 cps-ir: Support compilation of methods that use interceptor calling convention.
This is a modified version of sra@'s CL https://codereview.chromium.org/1020243002/ with kmillikin@'s comments addressed.

R=sigurdm@google.com, kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45680 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 12:38:14 +00:00
kmillikin@google.com 6ab3c55366 Fix an assertion failure in dart2js.
In the CPS translation we assert that a mutable variable added to the CPS
term belongs to the function currently being compiled, which is reasonable.
However, in the JS backend this didn't work as written.  The variable
element can report that it belongs to a Dart function, and the function
currently being compiled can be a synthesized .call method of a closure
class representing that Dart function.

The solution presented here is to plumb the mapping from Dart function to
closure class .call methods through to where the mutable variables are
created.  It might be better, but a lot more complicated, to make the
variable elements able to correctly report their owner after closure
conversion.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45636 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-08 08:58:00 +00:00
ricow@google.com e92f697236 Remove dart2dart support from testing scripts and status files
I will leave it to the dart2js people to remove the support from the dart2js tools (there is also a bunch of comments still in code, do a git grep)

R=kustermann@google.com, floitsch@google.com, kmillikin@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45588 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 11:29:55 +00:00
karlklose@google.com e8fa15c30a Update dart2js-cps_ir test expectations.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45371 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-23 08:40:49 +00:00
johnniwinther@google.com 19c838f3eb Fix dart2dart new backend status.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45346 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 13:20:48 +00:00
karlklose@google.com 7dd2608820 Adjust test expectations for dart2js-cps-ir.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45236 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 11:45:51 +00:00
kmillikin@google.com 00e4ba52ea CPS implementation of throw and rethrow.
Throw and rethrow are implemented as CPS expressions in tail position.

The CPS translation assumes that all expressions translate to a primitive
that is the value of the expression, and throw is an expression in Dart.
For simplicity of the translation, a non-tail throw Primitive is sometimes
used as a placeholder during the translation and removed immediately
afterward.

Both throw and rethrow are represented in the Tree IR.  In the Dart backend,
throw translates to throw and rethrow translates to rethrow.  In the JS
backend, throw translates to JS throw of a wrapped value.  Rethrow is not
currently implemented for the JS backend, it bails out of the compiler.

R=asgerf@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45235 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 11:15:45 +00:00
zra@google.com 86bfd7cb30 Adds a simarmv5te build and test target.
Also:
- Removes command line flags to choose simulated arm version.
  I think we should use build targets instead, like in this change,
  to make building and testing more obvious.
- Skips pkg tests on all simulators.

R=regis@google.com, ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45181 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-15 20:44:43 +00:00
karlklose@google.com d839c64766 Establish test expectations for dart2js running with the CPS based backend.
R=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45162 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-15 11:44:02 +00:00
herhut@google.com f19447b972 Fix status files after jsshell update.
BUG=
R=floitsch@google.com
TBR=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44289 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-06 13:40:51 +00:00
karlklose@google.com 3b5acff24d Change test to detect checked mode.
R=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44167 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-03 13:25:10 +00:00
karlklose@google.com a3b20b5cbe Mark corelib/hash_set_type_check_test as failing on except the VM.
R=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44165 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-03 12:31:54 +00:00
vegorov@google.com e8b7f9cb06 Don't constant fold operation if result is incompatible with it.
For example we can't replace BinarySmiOp with Mint constant because we might have removed the checks based on the assumption that BinarySmiOp always returns a Smi.

BUG=http://dartbug.com/22480
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43875 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-19 13:48:48 +00:00
koda@google.com 780ab3a2ec Correct status for opt counter threshold failure.
R=whesse@google.com
TBR=whesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43871 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-19 13:20:26 +00:00
koda@google.com d438fcac21 Mark test as failing due to optimizer issue 22480.
There doesn't seem to be any way to specify the optimization-counter-threshold builder, so allow both RuntimeError and Pass for now.

TBR=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43855 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-18 22:50:29 +00:00
paulberry@google.com 181b3b71c3 Work around warning in new duration2_test.
TBR=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43670 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 22:50:31 +00:00
fschneider@google.com 1e7310d48f Improve constant pool implementation in the assembler.
Instead of using RawObject* as keys, use Object*. Using handles eliminates any assumption
about the underlying GC implementation (e.g. requiring that old objects don't move).

Remove special handling of null_object by making HashMap more generic and
allowing the trait to specify the value used to indicate an empty element.

The goal is to use one unified, efficient implementation of the constant
pool on all architectures that require one (x64, arm64, mips).

R=vegorov@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42901 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-15 10:43:36 +00:00
whesse@google.com 5bba992965 Enable co19 dart2js browser tests on content shell (drt).
Update co19 status files for Firefox update to 35, and other flakes.

TBR=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42873 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-14 15:56:28 +00:00
lrn@google.com 8ebe51d63c Update status files after enforcing integer arguments to toRadixString etc, and adding more and harder tests for toRadixString.
Review URL: https://codereview.chromium.org//849573002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42769 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-12 10:48:49 +00:00
lrn@google.com bb4e97f519 Change dart2js int.toRadixString to not return spurious format on IE.
BUG= http://dartbug.com/15316
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42764 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-12 08:59:58 +00:00
zerny@google.com 34a556e5a9 Mark corelib/regexp/pcre_test as slow on debug builds.
TBR=floitsch@google.com,fschneider@google.com
BUG=http://dartbug.com/22008

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42659 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-07 13:24:58 +00:00
whesse@google.com 37028ca998 Mark dart2js http_test as slow in checked mode.
BUG=
R=zerny@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42652 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-07 10:03:55 +00:00
whesse@google.com 5c6b29f057 Update status for slow regexp test on debug MIPS.
BUG=dartbug.com/21995
R=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42595 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-05 14:45:17 +00:00
fschneider@google.com 4fada4c9a8 Revert r42426: Re-enable regexp test.
This test still times out with --optimization-counter-threshold=5

TBR=zerny@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42428 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-17 13:14:28 +00:00
sigurdm@google.com b0e9fbedce Generative constructors in the new dart backend.
With super and field initializers.

Field initializers and the arguments to a super-initializer
are treated as zero-arg nested functions, and if they assign
to a parameter, that parameter is set to be a closure
variable.

Still no 'this' initializer redirections.

initializing formals (such as `C(this.x)` ) are translated
to field initializers. We might want to revisit this choice.

R=asgerf@google.com, kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42427 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-17 10:34:21 +00:00
fschneider@google.com 433f36c06e Re-enable regexp test.
This test was skipped because of too long-running.

It is now finishing faster (2s release-checked, 10s debug mode)

R=zerny@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42426 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-17 10:01:32 +00:00