Commit Graph

2395 Commits

Author SHA1 Message Date
kustermann@google.com 8ce0175e1c Avoid infinite growth of linked hash map implementation
R=iposva@google.com, koda@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44671 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-24 16:32:33 +00:00
koda@google.com e3a345a84b Rename NoGCScope -> NoSafepointScope.
The old name makes less sense in the context of concurrent GC (and multiple threads in general).

Document the intended semantics of this (DEBUG-only) guard scope.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44616 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-20 22:08:25 +00:00
koda@google.com 92a8c39d3c Keep zone cached in SnapshotReader to allow removing ZoneHandle(Isolate*) interface.
Add a StackZone around API snapshot reading call.
Also remove CheckedHandle(Isolate*) interface by migrating its users to Zone*.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44580 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-19 17:42:40 +00:00
koda@google.com 9c181ec6d5 Thread/Isolate refactoring: new(Isolate*) -> new(Zone*)
Refactor all remaning cases where the current zone is used through new(Isolate*) and remove this interface.

Removing this interface is needed to move towards multiple threads per isolate, and also makes the caller more aware of the scope of the zone used, reducing the risk of use-after-free.

Make the current thread and the stack zone created around native/runtime entries directly available in their body, saving an indirection (and optimized away if unused).

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44541 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-17 19:24:26 +00:00
lrn@google.com bddb668174 Add some async/await tests.
R=sgjesse@google.com, sigurdm@google.com

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44395 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-11 10:15:59 +00:00
lrn@google.com c54856f8be Revert "Add some async/await tests."
Some tests are failing on the bots.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44369 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-10 13:41:34 +00:00
lrn@google.com fc0f0c144a Add some async/await tests.
R=sgjesse@google.com, sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44368 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-10 12:56:38 +00:00
iposva@google.com 91e105d8c6 - Implement some more missing pieces of the Isolate API.
Added:
    * addOnExitListener, removeOnExitListener
    * setErrorsFatal
    * addOnErrorListener, removeOnErrorListener

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44307 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-07 01:04:19 +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
koda@google.com d73d6de73d Support enum keys in maps in messages.
Make enum classes implement hashCode, rather than use the identity hash code, so that they can be portably serialized.

BUG=dart:21675
R=asiva@google.com, lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44278 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-06 02:57:34 +00:00
iposva@google.com 4b1ba9eb69 - Make sure we schedule another wakeup when handling a timeout
from the event handler.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44191 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-03 19:14:30 +00:00
hausner@google.com 9a6ed9a718 Implement async* functions in VM
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44185 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-03 17:49:53 +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
iposva@google.com b4088d10c9 Adjust handling of timers:
- Every zero timer is enqueued individually in the event queue
  and handled in sequence with other events.
- Non-zero timers and zero timers expire in order. Therefor a
  due zero timer will also fire all preceding non-zero timers
  to ensure this order.

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44095 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-27 16:45:23 +00:00
rmacnak@google.com 8b6a6a1e4f Add ClassMirror.isEnum.
BUG=http://dartbug.com/21718
R=asiva@google.com, gbracha@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44035 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-26 01:13:50 +00:00
lrn@google.com f0a07f1eb0 Cleanup URI and use String.replaceRange.
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44023 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-25 14:27:10 +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
iposva@google.com ebabd58de8 - Add a _fatal helper function into dart:core, so that we can
abort if we get into an unrecoverable state in the core library.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44010 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-24 23:27:56 +00:00
lrn@google.com 0b1bb96146 Change _interpolateSingle to use the same value in errors as _interpolate.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43942 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-23 08:09:50 +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 018ec1cb83 Temporarily disable compact hash map/set to see whether it fixes Dart2JS flaky faliures.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43921 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-20 17:27:06 +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
iposva@google.com db9faebe98 - Simplify collection of stack traces. If we determine that a stack
trace is needed we collect the full stack trace instead of piecing
  it together as we walk up the stack.

R=rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43863 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-19 02:18:53 +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
rmacnak@google.com 4abf50c04d Add LibraryDependencyMirror.isDeferred.
R=asiva@google.com, gbracha@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43829 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-17 23:49:40 +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
iposva@google.com b31372883b - Use new name for source file.
Review URL: https://codereview.chromium.org//930153002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43804 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-17 00:10:31 +00:00
iposva@google.com 9846e42886 - Leave abstract class StackTrace be an abstract class and
implement its interface from within the VM instead of patching.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43803 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-16 23:49:05 +00:00
iposva@google.com 98e0500c87 - Remove obsolete stack trace functions.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43802 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-16 22:53:19 +00:00
rmacnak@google.com 511c997316 Implement DeclarationMirror.location for all but ParameterMirrors.
- Mark NativeFieldWrapper classes as synthetic.
- Mark ClassID fields as synthetic.

BUG=http://dartbug.com/22378
R=gbracha@google.com, hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43784 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-13 23:32:20 +00:00
lrn@google.com a4dc421974 Fix last-minute-typo.
Review URL: https://codereview.chromium.org//921713002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43721 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 10:37:40 +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
regis@google.com 163f1c2244 Improve _toInt64() and _toUint64() conversions in TypedData.
Add missing conversions of exponent and modulus in Bigint.modPow().
Fix typos in Bigint Classic reduction (modPow tests coming in later cl).
Address a few more TODOs.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43697 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-11 20:57:33 +00:00
rmacnak@google.com 4de5f89b99 Rename IsConstructor to IsGenerativeConstructor.
This matches the terminology in the spec, and it avoids confusion with the function kind kConstructor, which indicates either a generative constructor or a factory constructor.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43673 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-11 00:59:19 +00:00
hausner@google.com 22054b3119 Make yield* throw an error if not yielding an Iterable
Fixes issue 22323

R=gbracha@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43616 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 21:47:12 +00:00
regis@google.com 8e5cd57b7e Add modPow(int exponent, int modulus) method to int abstract class.
Provide a dart2js implementation.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43572 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-06 21:46:32 +00:00
hausner@google.com 2487c76886 Add support for sync* and yield and yield*
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43516 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 18:36:40 +00:00
regis@google.com a5ee233d1b Make Bigint instances immutable by removing all setters.
This required rewriting a large portion of bigint.dart.

R=rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43492 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 23:56:23 +00:00
zra@google.com 1299ad1485 Allows turning on checked mode on a per-isolate basis
using the embedding API.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43481 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 18:32:48 +00:00
zerny@google.com e449cd0329 Propagate the stack trace of the inner-most throw when using async/await.
This patch does not provide a full async stack trace, it only ensures
that the inner-most stack frame will be the point of the initial throw.

BUG=http://dartbug.com/22009
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43463 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 11:54:23 +00:00
fschneider@google.com 25f95654d9 Remove last uses of IterableMixinWorkaround from VM's typed data implementation.
The remaining methods that used it are duplicated. This results
in better (specialized) code for typed data lists because type
feedback does not get mixed. It also avoids the additional
indirection of calling a static method on IterableMixinWorkaround.

BUG=dartbug.com/13647

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43379 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 08:27:36 +00:00
lrn@google.com 62adbb7ab0 Let Uint16List.setRange detect a String.codeUnits object, and copy directly from the string.
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43327 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-30 09:46:04 +00:00
johnmccutchan@google.com 172baa03ff Service isolate rework take 2
Review URL: https://codereview.chromium.org//889443002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43306 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 18:31:27 +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
iposva@google.com ad008bf8ba - Move timer implementation closer to the rest of message handling.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43225 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 00:39:35 +00:00
johnmccutchan@google.com db271b0477 Revert r43217, r43215, r43208, r43207, and r43202.
Reverting because of some isolate spawn issues (on Windows, and pub bots).

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43219 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 22:56:18 +00:00
johnmccutchan@google.com 66aa470fc6 * Create vm-service isolate at Dart_Initialize time.
* Remove Service create callback.
* Simplify creation of service isolate.
* Creation is done on thread pool.
* Use vm-service isolate for loading in standalone embedder.
* Remove import of dart:io from builtin library.

performance changes:

no service isolate:

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:27 | 100% | +12363 | -    0]

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:27 | 100% | +12363 | -    0]

always start service isolate (as a thread pool task):

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:45 | 100% | +12363 | -    0]

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:44 | 100% | +12363 | -    0]

service does I/O (calls to Dart_LoadScript block until service is running):

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:55 | 100% | +12363 | -    0]

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:55 | 100% | +12363 | -    0]

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43202 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 19:45:48 +00:00
srdjan@google.com 0b094880cc Improve performance of addAll for internallt known lists.
Review URL: https://codereview.chromium.org//873863002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43154 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-26 21:50:40 +00:00