Commit Graph

74 Commits

Author SHA1 Message Date
Srdjan Mitrovic 465cf10a7c Remove some Isolate::current_zone() calls, as it gets the zone from mutator thread not the current thread
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/1414493003 .
2015-10-19 10:27:36 -07:00
Lasse R.H. Nielsen d755dd65b9 Update range errors to agree on the numbers.
Also ensure that typed-data errors are consistent with other lists.

Fixes issue #24295
BUG= http://dartbug.com/24295
R=floitsch@google.com, iposva@google.com, sra@google.com

Review URL: https://codereview.chromium.org//1318943005 .
2015-09-11 13:05:36 +02: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 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
lrn@google.com ab2d914ae3 Avoid extra duplication of substrings during string.replaceAll.
R=asiva@google.com, zerny@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43059 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-22 08:27:42 +00:00
lrn@google.com 8bba32d131 Make String.fromCharCodes take start/end.
This avoids having to make a sublist of a list of character codes before passing it to String.fromCharCodes.

    new String.fromCharCodes(codes.sublist(start, end))

becomes just

    new String.fromCharCodes(codes, start, end)

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40672 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-25 10:45:24 +00:00
koda@google.com 667454a233 Support old-space allocation in generated code (bump block only for now).
First steps towards general pretenuring support.
* Generalize Heap::Top/EndAddress.
* Add testing flag to exercise new code paths.
* Also update the slow-case runtime calls, to ensure a fresh block will be allocated in old.

Next steps are general invalidation of the generated code and adding a policy that doesn't blow up the store buffers), and freelist allocation.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40530 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 23:46:22 +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
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
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
ajohnsen@google.com 38bfed114d Fix memory-issue String::fromCharCodes, where a GC could invalidate an address.
The constructions is now reordered, so the address is not extracted
until after allocation of the new string.

BUG=https://code.google.com/p/dart/issues/detail?id=17602
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34320 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-24 18:56:36 +00:00
ajohnsen@google.com b26561d41d Fix last commit.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33364 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-06 09:24:54 +00:00
ajohnsen@google.com c3dfdbe772 Fix fromEnvironment when called from isolates.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33363 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-06 09:16:41 +00:00
ajohnsen@google.com 1ce402ec78 Revert "Re-apply 'Fix fromEnvironment when called from isolates.'"
This reverts commit 1f2ddd083424a93dc0822c2ae86be971d5a97e21.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33278 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 16:05:21 +00:00
ajohnsen@google.com fb97ee0fe1 Re-apply 'Fix fromEnvironment when called from isolates.'
Old Review URL: https://codereview.chromium.org//186393004

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33274 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 14:22:54 +00:00
ajohnsen@google.com e8ad108bec Revert "Fix fromEnvironment when called from isolates."
This reverts commit f5886c3a1fe96580c13d83d6422a6bb6931ae95a.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33266 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 11:06:39 +00:00
ajohnsen@google.com 7e55a59ce4 Fix fromEnvironment when called from isolates.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33264 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 10:26:17 +00:00
fschneider@google.com 16857e0b13 Revert r32930 (Add more timing information in the VM to track time...)
It caused severe performance regressions that should be addressed.

TBR=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32959 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-24 12:15:55 +00:00
asiva@google.com 6d313d3797 Add more timing information in the VM to track time spent is dart code Vs native code.
R=johnmccutchan@google.com, turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32930 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-21 21:30:29 +00:00
iposva@google.com f2a6f1b4b6 Another round of cleanups for http://www.dartbug.com/15922
- Address warnings about 64-bit to 32-bit conversions.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32831 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-19 23:35:55 +00:00
ajohnsen@google.com 03c7cf69f3 Add optimized String.fromCharCodes path for Uint8List and Int8List.
BUG=
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30496 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-21 06:12:01 +00:00
lrn@google.com 66959d9dbf Change int.fromEnvironment in VM to use same code as int.parse.
R=fschneider@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29670 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-31 13:45:39 +00:00
sgjesse@google.com 36a67fa046 Implement fromEnvironment on bool, int and String
This implements const constructor fromEnvironment on bool, int and
String.

The VM have the added -Dname=value option to define the value for the
properties. All values are provided by using the -D - nothing is read
from the environment.

If the resulting value is null or - in the case of int.fromEnvironment
- not a number an ArgumentError is thrown.

This CL does not have any implementation for dart2js.

This is a continuation of the change
https://chromiumcodereview.appspot.com/24975002 by iposva@
BUG=
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29642 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-31 05:46:57 +00:00
srdjan@google.com cacd63cf7b Improve indexOf for one byte string receiver to work with other string classes.
Optimize access to core class’s class-ids.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29610 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 23:51:42 +00:00
srdjan@google.com a81288c8ca Improve string library performance. String concat and indexOf.
Rename String concatAll to concatRange. Optimize concatRange for OneByteStrings (avoids natives), optimize indexOf for one character onByteStrings.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29472 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-29 18:18:40 +00:00
srdjan@google.com b6b3e1f400 Factor out throwing of argument error.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28109 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 18:48:37 +00:00
srdjan@google.com 30197aab9d Improve performance of string buffer by modifying concatAll native to allow growable array and an interval. Eliminate unnecessary check for String elements in release mode.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28102 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 16:48:12 +00:00
srdjan@google.com 37e66b3350 Treat final variables initialized with a literal as constants. Also sneak in a small cleanup.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27973 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-26 21:06:56 +00:00
srdjan@google.com ab188d327c Improve performance of String.fromCharCodes by implementing it in Dart. Add tow internal natives to Dart in order to be able to allocate and fill a String. Next step is to implement String.concatAll in Dart as well and to inline String._setAt operation (currently intrinsified).
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22399 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-03 23:48:10 +00:00
srdjan@google.com 596f203f2a Do not copy immutable arrays in String.createFromCharCodes. Tighten the types a little in string_patch.dart.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22338 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-02 20:45:06 +00:00
fschneider@google.com 86da5111ad Replace scalarlist optimizations and split external array loads into two IL instructions.
This CL removes optimized access for scalarlist, and only the new TypedData classes
are optimized. I changed the runtime libraries core and math to use typedData
instead of scalarlist (Uint16List is used in StringBuffer, Uint32List by Math.random).

Instead of using LoadIndexed for internal and external arrays,
split external loads into a load of the backing store and a load
of the element.

v3 <- LoadIndexed(v1, index)

becomes

v2 <- LoadUntagged(v1, ExternalTypedData::data_offset)
v3 <- LoadIndexed(v2, index);

For this I introduce two new representations in the IL:

 kUntagged (for values that hold a untagged pointer) and
 
 kNoRepresentation (for instructions accept any input
 representation)

Deoptimization does not need to know about kUntagged
since these values can never occur in the environment.

Also with this change:
* fix COMPILE_ASSERT and use it in one place.
* Cleanup IL printer output of deopt ids.
Review URL: https://codereview.chromium.org//12871010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20198 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 12:06:23 +00:00
lrn@google.com bab488a4fc Allow String.fromCharCodes to work directly on a GrowableObjectArray.
Avoids copying the data from the internal ObjectArray into a new
ObjectArray before creating the string.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20060 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-15 07:22:12 +00:00
lrn@google.com a5a93492d9 Change VM's string-buffer patch to use a Uin16Array as backing buffer.
Review URL: https://codereview.chromium.org//12421002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19679 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-08 10:21:52 +00:00
lrn@google.com 3c0ac360e7 Remove deprecated string features.
Make String.codeUnits return a List.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18960 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 10:48:09 +00:00
asiva@google.com f4fe42c280 Added macros OBJECT_IMPLEMENTATION and FINAL_OBJECT_IMPLEMENTATION
which have different implementations of 'operator=' and 'operator^='.
In the case of FINAL_OBJECT_IMPLEMENTATION we do not do the vtable setting
in these methods (Note the |= operator functionality is now subsumed into
the new implementation of "operator^=")
Review URL: https://codereview.chromium.org//12052033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17491 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-23 20:01:31 +00:00
srdjan@google.com 7159a6f103 Some more ^= to |=
Review URL: https://codereview.chromium.org//12017020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17310 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 20:43:33 +00:00
asiva@google.com 7ea520f10f Create read only handles for empty_array and sentinel objects
(trying out a basic framework and will extend it to others once this
works).
Review URL: https://codereview.chromium.org//11648006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16416 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-21 02:33:05 +00:00
asiva@google.com 8af296c9c8 Cleanup the exceptions create code to use Arrays instead GrowableArrays so
that it is consistent with the DartEntry invoke code that it calls finally.
Review URL: https://codereview.chromium.org//11639007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16295 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-18 23:47:35 +00:00
asiva@google.com 6eec2410ec Restructure Add and SetAt to not create a Handle.
Review URL: https://codereview.chromium.org//11443024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15926 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-10 19:28:14 +00:00
regis@google.com dd6a0ec349 Rename GET_NATIVE_ARGUMENT macro to GET_NON_NULL_NATIVE_ARGUMENT.
Introduce new GET_NATIVE_ARGUMENT macro accepting null.
Add test.
Review URL: https://codereview.chromium.org//11468016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15919 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-10 17:59:40 +00:00
srdjan@google.com e3863daaba Improve C++ code for string splittig (Dromaeo benchmark).
Review URL: https://codereview.chromium.org//11308337

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15710 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-04 21:52:02 +00:00
srdjan@google.com 5f4ad90c85 Added native to split OneByteString with a char code as pattern.
Review URL: https://codereview.chromium.org//11414273

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15615 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-01 00:22:18 +00:00
cshapiro@google.com 39ee2fdfeb Move various top-level Unicode definitions into classes and methods.
Review URL: https://codereview.chromium.org//11414249

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15568 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-30 03:33:37 +00:00
asiva@google.com 9d41d29b1a Fix StringBase_createFromCodePoints to correctly accept Latin-1 characters
as one_byte_string.

Rename Dart_NewExternalUTF8String to Dart_NewExternalLatin1String, this reflects
the functionality correctly.
Review URL: https://codereview.chromium.org//11280241

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15554 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-29 23:43:47 +00:00
srdjan@google.com bf3bac3884 Implement faster splitting with empty string as pattern. Add special native for computing substring of OneByteString (preparation for instrinsic).
Review URL: https://codereview.chromium.org//11416270

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15548 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-29 22:55:09 +00:00
cshapiro@google.com 979571d3ee Use a signed 32-bit integer for representing code points.
Review URL: https://codereview.chromium.org//11419086

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15188 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-21 00:30:27 +00:00
erikcorry@google.com 84da84c22d Revert "Add some support for the code-point code-unit distinction."
This reverts commit r15150

R=karlklose@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15152 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-20 15:23:41 +00:00
erikcorry@google.com 547cbf9da6 Add some support for the code-point code-unit distinction.
Adds String.fromCodeUnits and String.codeUnitAt, and modifies
String.fromCodePoints and String.codePointAt to actually use code points.
Fixes String.charCodes to use code points and adds String.codeUnits.
Reenables some tests, and adds new ones for non-BMP characters.
Fixes issues 6418, 6501 and 1357.

R=floitsch@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15150 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-20 14:51:25 +00:00