Commit Graph

2395 Commits

Author SHA1 Message Date
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
rmacnak@google.com f346a00c0f Revert r37059 and dependent r37589. This effectively reduced the size of the getter and setter caches, exposing http://dartbug.com/18284 in a C1 application.
Revert "Implement an LRU cache in dart:_internal and use it for the getter/setter caches in the VM's mirrors."
Revert "Use mirror-free LRU test for dart2js"

BUG=http://dartbug.com/19909
BUG=http://dartbug.com/18284
BUG=http://dartbug.com/18445
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38076 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-09 00:18:15 +00:00
iposva@google.com 5686b6a793 - Implement Isolate.pause and Isolate.resume.
- Implement a minimum Capability functionality.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37982 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-03 12:56:02 +00:00
lrn@google.com 085d99b079 Add typed data view creation functions on ByteBuffer.
This provides a better model and better separation for typed data.

Currently the only thing you can do with a ByteBuffer is pass
it as argument to a typed data .view factory method, which then
uses internal-only functionality to create the view.

With this change, the functionality of creating the view,
and understanding the internals of the ByteBuffer, is put on the
ByteBuffer class itself.

The view constructors on the typed data classes are retained, but
they just forward to the buffer's method. This provides backwards
compatibility and familiarity.

This change allows mocking the ByteData object. There is no hidden
connection between the constructor and the buffer that other objects
can't implement.

The change is non-breaking - it only adds methods to ByteBuffer, and
there have been absolutely no reason to extend ByteBuffer until now,
because it won't work anyway.

R=asiva@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37974 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-03 07:48:57 +00:00
rmacnak@google.com 14fcffb2b6 Hide synthetic metadata field exposed in r35926.
Also remove Object::CreateInternalMetaData.

BUG=http://dartbug.com/19731
R=iposva@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37900 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-01 20:09:09 +00:00
lrn@google.com 7a32a75dcc Avoid unnecessary copying when parsing doubles.
R=sgjesse@google.com, vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37863 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-01 11:59:31 +00:00
kasperl@google.com 7087c8a7b6 Make the JSON decoder (parser) create Dart maps lazily when no reviver is provided (common case).
R=floitsch@google.com, lrn@google.com
BUG=http://dartbug.com/19649

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37858 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-01 09:53:18 +00:00
zra@google.com 9e6655f810 Fixes Android build by using C++ math header instead of C one.
This change also requires prefacing the math calls with
std::, i.e. isinf -> std::isinf.

R=asiva@google.com, koda@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37839 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-30 22:15:26 +00:00
lrn@google.com f9b8b18ab8 Rewrite Zone implementation to avoid recursively looking up stuff in the parent chain.
Reuses as much as possible of the parent zone's implementation representation.

Increases performance of primitive tests of only async operations by ~10% (but with a lot of variability and a spurious regression).

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37807 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-30 07:26:01 +00:00
fschneider@google.com bd110db87a Use range information for optimizing integer boxing and fix bug in range analysis.
1. When the input to a BoxInteger operation is in smi-range, we can eliminate
the range check and just perform a smi-tag operation on the input.

2. There was a bug in checking for smi-overflow for range boundaries: Calling Smi::IsValid
with a int64_t argument resulted in silent truncation of the input and therefore a wrong result.

Compiling with -Wconversion would have caught this, but currently we cannot compile with this flag
because of too many broken places.

Instead, I removed Smi::IsValid64 and created one variant Smi::IsValid that is specialized for the
input type with a template parameter. This way calling Smi::IsValid is always safe and will never
 result in silent alteration of the input argument.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37657 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-24 13:41:48 +00:00
srdjan@google.com 97021b5861 Add class id constants fields to dart:_internal class 'ClassID'. Use the fields in the library (more uses to come).
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37628 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-23 22:41:59 +00:00
floitsch@google.com 7a20438bb8 Update timer and adjust frequency.
BUG= http://dartbug.com/19435
BUG= http://dartbug.com/19082
R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37586 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-23 09:33:59 +00:00
srdjan@google.com d44423b766 Add VM internal Dart class 'ClassID' used to manage class-ids of known classes. Next CL: add constant fields corresponding to each class id (smiCid, oneByteStringCid, etc).
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37567 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-20 20:56:55 +00:00
regis@google.com 32f3e11d99 Cleanup of error and warning reporting.
R=hausner@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37468 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-18 22:30:34 +00:00
srdjan@google.com ee210974f6 Reduce default capacity of growable list from 4 to 2 elements. Improves performance.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37421 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-17 20:49:47 +00:00