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
lrn@google.com
92c526b2a2
Make EfficientLength public, as EfficientLengthIterable.
...
R=iposva@google.com , sgjesse@google.com
Review URL: https://codereview.chromium.org//1104063002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45556 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-06 09:00:45 +00:00
lrn@google.com
7fe3363524
Fix SplayTreeMap.from ignoring the compare and isValidKey arguments.
...
BUG= http://dartbug.com/23387
R=wibling@google.com
Review URL: https://codereview.chromium.org//1127043002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45550 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-06 08:18:56 +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
lrn@google.com
f139d0e93b
Add List.unmodifiable constructor.
...
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//1056353004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45334 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 10:48:22 +00:00
lrn@google.com
b4d052c5da
Fix bug in DateTime.parse.
...
Used unescaepd "." to match "." in RegExp.
BUG= http://dartbug.com/22468
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//1091553005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45274 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-20 10:27:24 +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
lrn@google.com
a412878666
Fix typo in test, add check of error thrown.
...
R=karlklose@google.com
Review URL: https://codereview.chromium.org//1063603004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45233 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 10:55:30 +00:00
lrn@google.com
d8dbb4a60f
Add Uri.directory constructor.
...
Make Directory.uri getter use the new constructor.
This also fixes that the uri getter doesn't work correctly on Windows.
Add uri getter on file system entity.
BUG= http://dartbug.com/17065
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//1089183004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45227 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 08:56:03 +00:00
sra@google.com
39dfecbfb5
Revert "Change ListIterator to only check for concurrent modification at each iteration"
...
Revert "Fix ListIterator.iterator function hash for VM."
This is not as easy to optimize for dart2js as initially thought.
Revert this change while we discuss.
R=floitsch@google.com
Review URL: https://codereview.chromium.org//1064053007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45216 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 18:53:39 +00:00
lrn@google.com
5a79c03e09
Change ListIterator to only check for concurrent modification at each iteration
...
in checked mode.
It also checks at the end in all cases.
Iteration only goes from 0 to the original length of the list.
This ensures that iterating a list while adding to it (like by x.addAll(x))
is caught instead of growing until out-of-memory.
For well-behaved programs this makes no difference since length and original
length stay the same.
Also, it means that calling moveNext again later, after increasing the length,
will not make iteration continue. After returning false, iteration is always
done.
However, it means that reducing the length causes an out-of-range read before
reaching the end, and before a concurrent modification error can happen.
R=sra@google.com
Review URL: https://codereview.chromium.org//1024843002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45198 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 09:07:58 +00:00
sra@google.com
6467b4302d
dart2js implementation of StringBuffer.writeAll that optimizes better.
...
Sometimes we can avoid the StringBuffer object:
t1 = new P.StringBuffer(leftDelimiter);
t1.writeAll$2(parts, ", ");
t1 = t1._contents += rightDelimiter;
return t1.charCodeAt(0) == 0 ? t1 : t1;
-->
t1 = P.StringBuffer__writeAll(leftDelimiter, parts, ", ") + rightDelimiter;
return t1.charCodeAt(0) == 0 ? t1 : t1;
Also updated tests with missing cases.
R=lrn@google.com
Committed: https://code.google.com/p/dart/source/detail?r=45184
Reverted: https://code.google.com/p/dart/source/detail?r=45186
Review URL: https://codereview.chromium.org//1086043002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45188 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-15 23:13:29 +00:00
sra@google.com
18dd1aa826
Revert "dart2js implementation of StringBuffer.writeAll that optimizes better."
...
StringBuffer.writeAll is expected by pub tests to not be patched or inlined. I'll fix that and redo.
TBR=lrn@google.com
Review URL: https://codereview.chromium.org//1085423003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45186 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-15 22:55:05 +00:00
sra@google.com
54718dc6e2
dart2js implementation of StringBuffer.writeAll that optimizes better.
...
Sometimes we can avoid the StringBuffer object:
t1 = new P.StringBuffer(leftDelimiter);
t1.writeAll$2(parts, ", ");
t1 = t1._contents += rightDelimiter;
return t1.charCodeAt(0) == 0 ? t1 : t1;
-->
t1 = P.StringBuffer__writeAll(leftDelimiter, parts, ", ") + rightDelimiter;
return t1.charCodeAt(0) == 0 ? t1 : t1;
Also updated tests with missing cases.
R=lrn@google.com
Review URL: https://codereview.chromium.org//1086043002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45184 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-15 22:02:05 +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
lrn@google.com
5cbb84dfa2
Add normalizePath to Uri class.
...
The algorithm for removing '.' and '..' from a path is only available through the [resolve] method.
This change makes it available directly as a function on a Uri, returning a new Uri if necessary.
The current workaround is to do:
var normalizedUri = new Uri().resolveUri(originalUri);
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//1083253002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45163 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-15 11:56:35 +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
lrn@google.com
68dd6f6338
Add StackTrace.fromString constructor.
...
Remove _RemoteStackTrace from dart:isolate and use the new version instead.
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//1088433004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45088 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-13 09:17:13 +00:00
lrn@google.com
83376079f6
Add start/end to Uri.parse, allowing you to parse a substring without creating a new String object.
...
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//1071573002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44993 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-09 08:01:15 +00:00
lrn@google.com
2da1a00f3d
Clean up apply2-test.
...
It was quite unreadable.
Review URL: https://codereview.chromium.org//1024563003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44679 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-25 07:01:46 +00:00
herhut@google.com
0ad152ebac
Fix implementation of Function.apply with optional positional arguments.
...
BUG=
R=karlklose@google.com
Review URL: https://codereview.chromium.org//1029853002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44666 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-24 14:17:10 +00:00
lrn@google.com
f80cfe1401
Fix DoubleLinkedQueue so that appending to entries also update the queue length.
...
The extra non-queue features of this class are probably unnecessary, and are not proper naming (some functions should be getters).
Keeping unchanged for backwards compatibility, but it should probably either be removed or be suitably updated for 2.0.
BUG= http://dartbug.com/22802
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//1001863002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44451 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-13 09:40:57 +00:00
sra@google.com
31993af4bf
There was a weird dead expression that should have been used but was not, letting all upper case letters be 'accepted' for any radix over 10. The result was NaN values flowing into the program.
...
R=lrn@google.com
Review URL: https://codereview.chromium.org//988523002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44304 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-06 21:34:02 +00:00
koda@google.com
784c1e4f88
Replace Linked{Identity,Custom}Hash{Map,Set} with compact implementation; remove old code and flag.
...
R=iposva@google.com
Review URL: https://codereview.chromium.org//983703003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44294 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-06 15:13:01 +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
koda@google.com
6add62d1b0
Correct typing of LinkedHashSet.add. Add unit test.
...
BUG=dart:22605
R=skybrian@google.com
Review URL: https://codereview.chromium.org//971833002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44155 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-03 00:44:31 +00:00
lrn@google.com
20653fc1fb
Add String.replaceRange and use it in replaceFirst{,Mapped}.
...
R=floitsch@google.com
Review URL: https://codereview.chromium.org//949753005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44022 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-25 12:17:27 +00:00
lrn@google.com
385d753c7a
Fix bug in RangeError.value. Add tests.
...
BUG= http://dartbug.com/22505
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//953743005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43990 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-24 14:16:54 +00:00
koda@google.com
ec00a4ace6
Make test compatible with dart2js integer semantics.
...
R=vegorov@google.com
Review URL: https://codereview.chromium.org//946203002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43941 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-22 05:57:35 +00:00
koda@google.com
574028165f
Ensure hash pattern is non-zero. Re-enable compact hash map/set.
...
BUG=dart:22520
TBR=vegorov@google.com
Review URL: https://codereview.chromium.org//946893002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43940 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-22 03:04:35 +00:00
koda@google.com
c6e3dd73c2
Default to compact Map/Set implementation.
...
Also adjust unit tests accoringly to maintain coverage, and remove some redundant ones.
R=iposva@google.com
Review URL: https://codereview.chromium.org//936613007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43894 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-19 21:28:56 +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
koda@google.com
1d7ca12fdc
Compact LinkedHashMap/Set implementation.
...
Add GC-friendly replacement for default Map/Set:
* open-addressing hash table, avoiding the overhead of chained entries
* index separate from the keys/values, allowing more of it to fit in the cache
* new keys are always appended, to allow insertion-order iteration
* spare bits in index entries are used to store hashes
* index is typed data, so can be ignored by GC
Enable it with --use_compact_hash (disabled by default).
Reduces Dart2JS compilation time for huge codebase (N=200) by ~30%, due to reduced time in GC. Slightly slower for small maps and maps with deletions: json benchmarks regress by ~5%.
R=vegorov@google.com
Review URL: https://codereview.chromium.org//915323002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43840 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-18 13:58:32 +00:00
regis@google.com
6a7be914e3
Add modPow tests.
...
Fix selection of modular reduction algorithm for modPow.
Remove bad assert and fix digits array length in classic modular reduction.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//918403002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43817 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-17 19:32:32 +00:00
herhut@google.com
4e3b966bbd
Support positional optional parameters even if stubs are missing.
...
BUG=
R=floitsch@google.com
Review URL: https://codereview.chromium.org//930093002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43805 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-17 09:39:19 +00:00
lrn@google.com
688d50f1c9
Add String.replaceFirstMapped.
...
Also refactory VM implementation of checking if a string is one-byte,
and adds dart2js implementation of replaceFirst for non-string/regexp pattern.
BUG= http://dartbug.com/2979
R=floitsch@google.com , iposva@google.com
Committed: https://code.google.com/p/dart/source/detail?r=43716
Review URL: https://codereview.chromium.org//920453002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43718 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 09:16:57 +00:00
lrn@google.com
7c9248c642
Revert "Add String.replaceFirstMapped."
...
Changes to interpolation should be separate CL.
Review URL: https://codereview.chromium.org//917663004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43717 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 09:12:06 +00:00
lrn@google.com
6b9ff4c4d4
Add String.replaceFirstMapped.
...
Also refactory VM implementation of checking if a string is one-byte,
and adds dart2js implementation of replaceFirst for non-string/regexp pattern.
BUG= http://dartbug.com/2979
R=floitsch@google.com , iposva@google.com
Review URL: https://codereview.chromium.org//920453002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43716 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 09:04:09 +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
floitsch@google.com
b5d8e838dc
All nsm error in duration test.
...
Review URL: https://codereview.chromium.org//911913002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43659 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 17:35:36 +00:00
floitsch@google.com
c7d0c7ffed
corelib: Don't blow up in memory if a duration receives a string as argument.
...
BUG= http://dartbug.com/22309
R=lrn@google.com
Review URL: https://codereview.chromium.org//913503003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43658 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 16:39:33 +00:00
zerny@google.com
52cf25b213
Regression test for issue 19193.
...
Issue resolved by r42312.
R=lrn@google.com
BUG=http://dartbug.com/19193
Review URL: https://codereview.chromium.org//890533002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43276 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 12:14:08 +00:00
lrn@google.com
ab51ccc9f0
Create string efficiently from Uint16List/View.
...
R=asiva@google.com , fschneider@google.com
Review URL: https://codereview.chromium.org//864463002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43235 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 12:44:44 +00:00