Commit Graph

2159 Commits

Author SHA1 Message Date
regis@google.com d3420517e2 Remove unnecessary check in bigint division.
Review URL: https://codereview.chromium.org//576253002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40385 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-17 18:37:39 +00:00
lrn@google.com 104119e15d Add argument error for int.parse(null).
Slightly tweak _tryParseSmi to generate slightly less code.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40373 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-17 12:51:20 +00:00
regis@google.com 4f77a36faa Estimate quotient digit in Bigint division using an integer division instead of
a floating point division.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40365 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-17 01:44:34 +00:00
regis@google.com 21369fc864 Temporarily add a public modPow method to int interface.
Make Bigint modPow support non-bigint arguments.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40335 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-16 18:19:12 +00:00
regis@google.com 055fd61999 Temporarily add a public modPow method to _Bigint class.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40271 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 19:29:15 +00:00
lrn@google.com 54ffc4f000 Call special VM interpolate for single element interpolation.
Fixed at the intermediate language level.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40232 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 07:19:23 +00:00
rmacnak@google.com cefb21b6a3 Narrow String::CharAt from int32_t to uint16_t.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40178 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 20:55:36 +00:00
regis@google.com 9ff3cd3342 Fix wrong conversion from double to bigint in overriden operators of new bigint.
Fix ambiguous call to pow on Windows.
Fix big_integer_vm_test to use numbers large enough to actually be bigint.
Re-enable dart2js tests.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40122 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-10 22:26:59 +00:00
regis@google.com 0220e41d72 New bigint implementation in the vm.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40061 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 21:47:44 +00:00
iposva@google.com 92f2698abe - Refactor the way X.fromEnvironment is implemented.
- Predefine 'dart.isVM' to be 'true'.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39986 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-08 18:23:05 +00:00
mlippautz@google.com 800508d980 Bubble up exceptions throw async/await.
This CL addresses bubbling up exceptions through async and await. It adds another parameter to the continuation that can be used to rethrow an error.

BUG=
R=hausner@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39926 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-05 19:50:34 +00:00
vegorov@google.com c431dbcb3f Cleanup throwing of the RangeError in the runtime to remove duplicated code.
Improve List._copyFromObjectArray native performance for large arrays by using PassiveObject instead of Object.

R=iposva@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39911 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-05 13:15:56 +00:00
lrn@google.com 0acdec95ff Specify packageRoot parameter to Isolate.spawnUri.
R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39903 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-05 09:11:54 +00:00
vegorov@google.com a1e2035eda Improve List.sublist and List.toList for large lists.
- Merge array allocation and List._copyFromObjectArray to provide memmove fast path;

- In optimizer given v2 = CreateArray(v0, v1) fold v2.length load to v1;

BUG=
R=iposva@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39831 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 20:36:01 +00:00
lrn@google.com 6484ca2694 Don't always call _copyFromObjectArray.
The call is a runtime call, not internalized as I expected.
Only use it for large array slices.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39803 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 12:39:31 +00:00
ajohnsen@google.com f75e71d95c Remove unused string interpolations.
BUG=
R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39802 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 12:35:50 +00:00
koda@google.com a4f45a89a0 Optimize number-to-string conversions.
Add lookup table for ints in [-99, 99] and a cache for doubles.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39710 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-29 21:13:33 +00:00
koda@google.com 0844cbcfbe Proof-of-concept pretenuring of some strings:
- Add bump-pointer allocated block in page space.
- Pretenure num.toString whenever >98% of strings are being promoted.
- Fix deadlock in freelist printing.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39688 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-29 03:54:12 +00:00
ajohnsen@google.com 07714fb40f Manually inline fixed-size list's forEach, to make it possible for the VM to optimize.
BUG=https://code.google.com/p/dart/issues/detail?id=20715
R=iposva@google.com, lrn@google.com, vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39657 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-28 15:10:18 +00:00
ricow@google.com 69bed3d030 Revert revision 39617 "Create isolates in a separate thread."
This is breaking dartium with:
BrowserOutput.stderr:
  ../../dart/runtime/vm/dart_api_impl.cc:1614: error: Dart_EnterScope expects there to be a current isolate. Did you forget to call Dart_CreateIsolate or Dart_EnterIsolate?

R=vsm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39638 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-28 09:52:59 +00:00
turnidge@google.com 3cd24f8ebf Create isolates in a separate thread.
Previously the parent isolate waited for the child isolate to fully
load, which was not ideal.  This change fixes that.

If you run on mac, you may need to raise your open file limit to make mandel_isolate_test pass:

ulimit -n 1024

Default open file limit on the mac is low.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39617 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 19:47:06 +00:00
lrn@google.com 109c16e204 Add import of dart:typed_data in dart:convert.
Was previously handled by patch file for VM, and was now missing
for dart2js.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39585 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 08:53:50 +00:00
lrn@google.com 32011bb93e Use Uint8List for byte lists in dart:convert.
BUG= http://dartbug.com/11971
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39580 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 08:24:49 +00:00
lrn@google.com 7947f84054 Optimize List.toList/.sublist and List.from on lists.
R=fschneider@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39579 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 08:00:48 +00:00
turnidge@google.com 2d4250d852 Defer execution of the main isolate's entry point until the message loop.
This allows us to know more accurately the stack limit while running main.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39558 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-26 17:21:20 +00:00
fschneider@google.com 97dc2bd55a Implement native _List. constructor in the flow-graph builder.
Replace assembly intrinsic and the C++ native function with a CreateArray
instruction.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39554 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-26 13:57:15 +00:00
lrn@google.com 29ad62131d Add optional startIndex to String.replaceFirst
BUG= https://code.google.com/p/dart/issues/detail?id=3194
R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39490 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-22 11:27:32 +00:00
turnidge@google.com c48496b873 Refactor isolate startup code in preparation for making isolate spawning more truly non-blocking.
Instead of passing a startup message to the new isolate, pass all
necessary information in to _startIsolate directly.  The new isolate
sends its control port and capabilities back to the parent.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39423 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-20 19:57:09 +00:00
iposva@google.com 4835041da9 - Account for number of pending tasks in old-space collections.
- Protect access to the free lists.
- MutexLocker/MonitorLocker do not need to be StackResources.

R=koda@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39396 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-20 03:54:14 +00:00
koda@google.com c22d3cf74a Avoid UTF-8 decoding in num.toString.
4-7% speedup on SplayHarder.

Introduce _Num class to make Dart and VM hierarchies match and enable sharing code between integers and doubles.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39383 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-19 21:15:39 +00:00
iposva@google.com 14ecdbd66a - Separate the thread implementation used in bin/ and vm/
to allow us to make VM specific changes.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39172 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 23:19:53 +00:00
lrn@google.com 7b516974b2 Add optional start index to Pattern.allMatches.
This is a non-breaking change.
Very few classes implement Pattern, so it's also a mostly non-intrusive change.

If we add startIndex to other methods, like replaceFirstMatch, we can use the extra parameter only for non-zero start indices without breaking existing code.

R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39119 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 07:13:01 +00:00
rmacnak@google.com 3a40319ed2 Remove hard limit from mirrors accessor caches.
Avoids treadmilling the cache when the working set is larger than the cache size, such as the observe loop of a very large Angular app.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39057 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-08 22:20:36 +00:00
lrn@google.com 1ea907017a Special case substring(0, length) to return itself.
R=ajohnsen@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38919 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-06 07:00:59 +00:00
lrn@google.com ca66944f5a Performance tweak on int.parse.
Slower for strings with trailing, but no leading,
whitespace, but significantly faster for strings with no whitespace,
which is presumed to be the most common case.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38848 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-04 07:56:18 +00:00
hausner@google.com 4258c115b4 Handle load errors in deferred code
IO errors on the URL of a deferred library are forwarded to the Future
that handles the deferred load. Syntax errors and finalization errors
are lethal, killing the isolate.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38800 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-31 21:09:33 +00:00
johnmccutchan@google.com 2e59674838 Initial backend for metrics in Observatory.
Two types of metrics:

* Counter - a measured value
* Gauge - A measured value with a min and max

Follow up CLs for the backend:

* Support for internal VM metrics (implemented in C++ but visible over the service).

Follow up CLs for the frontend:

* Query list of metrics
* Get latest value of a metric
* Collect values over time and graph them.

I'd like some feedback on the API and the data reported.

R=koda@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38793 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-31 18:27:38 +00:00
koda@google.com 1cdcb12b4e Add VM class for Map/LinkedHashMap.
Introduces a new internal class for the most common case, the default Map.

Passes all functionality tests.
Slow: Dart side simply calls into runtime for now.
Hidden behind "--use_internal_hash_map".

Add copies of hash map tests to exercise this implementation.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38588 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-25 20:04:11 +00:00
rmacnak@google.com 9c2b650c15 Increase the size of the getter/setter closure caches.
TBR=asiva@google.com
BUG=http://dartbug.com/20196

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38568 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-25 00:55:52 +00:00
lrn@google.com 729de01f79 Make IterableMixinWorkaround using classes return correctly typed Iterables.
BUG= http://dartbug.com/13646
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38372 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-18 08:08:16 +00:00
asiva@google.com a323a9c9db The dart version of typeddata library has changed to be compatible with the dart2js implementation
(typeddata does not implement ByteBuffer anymore).
Added new Dart API functions to account for this change.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38351 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-17 22:08:07 +00:00
lrn@google.com f48e9cb218 Address comments on double-parse implementation from earlier CL.
Comments at https://codereview.chromium.org/368483004/#msg7

R=fschneider@google.com, iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38224 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-15 08:25:12 +00:00
rmacnak@google.com bfd342fd8a Remove MirroredCompilationError from the VM.
Regenerate snapshot test due to removed symbol.

BUG=http://dartbug.com/16562
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38202 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-14 18:00:04 +00:00
lrn@google.com 4feb28b5c2 Fix error message for unexpected characters in JSON.
The current version treats any unexpected character as a number
error.

R=kustermann@google.com

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38185 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-14 11:08:36 +00:00
lrn@google.com d433906b18 Fix error message for unexpected characters in JSON.
The current version treats any unexpected character as a number
error.

R=kustermann@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38184 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-14 10:40:50 +00:00
lrn@google.com d983493c1a Add extra information to FormatException.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38181 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-14 07:47:45 +00:00
rmacnak@google.com 81d0f25293 Reapply "Implement an LRU cache in dart:_internal and use it for the getter/setter caches in the VM's mirrors." Reapply "Use mirror-free LRU test for dart2js"
BUG=http://dartbug.com/18445
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38167 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-11 18:59:06 +00:00
lrn@google.com cf8ac68c0d Make VM JSON parser parse doubles without doing substring.
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38155 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-11 12:14:23 +00:00
rmacnak@google.com 1c069e79bb Don't expose mangling/minification scheme in Symbol.toString.
BUG=http://dartbug.com/9285
R=mlippautz@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38143 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-11 01:30:50 +00:00
regis@google.com f58908bfdd Tweaks for speed in integer arithmetic runtime.
Unrelated:
Removed annoying svn property on utils.cc (indicated by MM):
  svn propdel svn:eol-style runtime/platform/utils.cc

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38090 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-09 17:16:10 +00:00