zra@google.com
2ab7fa6c72
Omits size bits when writing RawObject tags to a snapshot.
...
Makes snapshot ~30KB smaller.
R=asiva@google.com
Review URL: https://codereview.chromium.org//349293002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37626 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-23 22:18:04 +00:00
zra@google.com
1dc0e2331b
Removes open arrays (e.g. data[0]) from raw objects.
...
Replaces them with data() methods as in RawArray.
R=asiva@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//333773006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37450 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-18 15:58:16 +00:00
zra@google.com
86ca6ef5a6
Adds an assertion to limit snapshot intptr_t size.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//323163002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37196 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-10 20:15:49 +00:00
iposva@google.com
fd8565b071
- Add a minimal implementation of Capability.
...
- Make RawReceivePort and SendPort VM internal objects.
- Rationalize the creation of ports and their handling within the VM.
R=asiva@google.com
Review URL: https://codereview.chromium.org//243973002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35325 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-23 19:44:03 +00:00
iposva@google.com
dd7d6dd375
- Handle doubles transferred in message snapshots specially.
...
- Do not encode doubles using integer compression.
R=asiva@google.com
Review URL: https://codereview.chromium.org//221973004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34681 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-03 00:58:14 +00:00
ajohnsen@google.com
a3e5a06a90
Speed up snapshots of *int8lists, by using memmove.
...
BUG=https://code.google.com/p/dart/issues/detail?id=17951
R=asiva@google.com , sgjesse@google.com
Review URL: https://codereview.chromium.org//221943002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34649 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-02 15:53:23 +00:00
regis@google.com
6650adae3b
Write the type arguments instantiations field to full snapshots only.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//151773006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32524 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-10 23:37:06 +00:00
regis@google.com
61ba258618
Fix snapshotting of TypeArguments.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//132623007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32457 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 23:02:54 +00:00
iposva@google.com
781f737c6a
First round of http://dartbug.com/15922 :
...
- Address warnings about 64-bit to 32-bit conversions.
- Remove heap profiler.
R=asiva@google.com
Review URL: https://codereview.chromium.org//139043003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31867 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-16 05:05:35 +00:00
asiva@google.com
48e5bebfe3
Compute next field offset correctly.
...
R=iposva@google.com
Review URL: https://codereview.chromium.org//56033002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29818 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-04 16:51:48 +00:00
sgjesse@google.com
2f27215203
Remove the reply port form the native isolate handler
...
The handler function for a native isolate no longer gets an explicit
reply port. Instead the reply port must be sent as part of the message
if required.
The Dart_CObject structure now exposes the send ports in a message to
a native isolate.
R=asiva@google.com , floitsch@google.com , whesse@google.com
BUG=
Review URL: https://codereview.chromium.org//43483004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29418 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-29 08:45:32 +00:00
mlippautz@google.com
94502c10ea
Checks CObject lengths in native API.
...
Also converts the API to use intptr_t instead of a mixture of int64_t and int. Internally all variable length objects have lengths and maximum values represented as intptr_t (actually Smi ranges). In order to check for these maximum lengths we need to have a common type for 32 and 64 bit platforms.
Helping constructs like IOBuffer can still use 64bit lengths, but have to check that there values are actually in the domain of intptr_t as soon as internal objects are created.
Addresses issue 4314.
BUG=
R=asiva@google.com , sgjesse@google.com
Review URL: https://codereview.chromium.org//23532048
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27395 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-11 16:56:12 +00:00
mlippautz@google.com
6b175bbada
"Reverting 27298"
...
BUG=
Review URL: https://codereview.chromium.org//23816010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27302 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-09 17:26:07 +00:00
mlippautz@google.com
dc9fca00eb
Add length checks to ApiMessageWriter.
...
Addresses issue 4314.
BUG=
R=asiva@google.com
Review URL: https://codereview.chromium.org//23479010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27298 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-09 16:50:41 +00:00
asiva@google.com
703bad2d2a
Revert change 23636 as it is causing issues on dartium. Will resubmit after investigating the dartium failure.
...
Review URL: https://codereview.chromium.org//16378004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23641 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-05 17:28:01 +00:00
asiva@google.com
bd14296eb7
Fix for issue 1755.
...
Use 'new' in all the snapshot reallocation functions instead of realloc.
This would result in program termination when allocation fails and will
ensure that a NULL will not be returned.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//16271010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23636 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-05 16:21:04 +00:00
iposva@google.com
1836035266
- Modify dart_api.h to be a proper C API.
...
- Verify that dart_api.h can be used from C
by changing the test_extension to be a pure C file.
R=asiva@google.com
Review URL: https://codereview.chromium.org//15689013
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23476 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 16:36:27 +00:00
ager@google.com
431954b584
Rename dart:typeddata to dart:typed_data.
...
R=asiva@google.com , floitsch@google.com , srdjan@google.com
BUG=
Review URL: https://codereview.chromium.org//14426006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21871 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-23 11:54:54 +00:00
ajohnsen@google.com
3bc864da88
Fix incremental allocation of forward_list_ in dart_api_message.
...
BUG=
Review URL: https://codereview.chromium.org//14031006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21667 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-18 08:13:49 +00:00
sgjesse@google.com
83bd0f1aa9
Add support for even more typed data on native ports
...
The only types missing now are: Float32x4, Float32x4List and
Uint32x4 (currently no Uint32x4List).
R=ager@google.com
BUG=
Review URL: https://codereview.chromium.org//13998008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21455 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 14:19:46 +00:00
sgjesse@google.com
7ddac4a7be
Fix GCC compiler warning
...
TBR=ager@google.com
BUG=
Review URL: https://codereview.chromium.org//14046010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21425 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 09:12:49 +00:00
sgjesse@google.com
6507357ca0
Add support for more typed data types on native ports
...
Renamed the kUint8Array type for a Dart_CObject structure to
kByteArray to support all typed data types. The specific type is
stored in a separate type field. No matter what the specific type is,
the length of the byte array is always in bytes.
R=ager@google.com
BUG=
Review URL: https://codereview.chromium.org//14142008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21423 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 09:01:56 +00:00
sgjesse@google.com
52f54a2edd
Add support for typed data views on native threads
...
The deserializer running outside the VM can now decode typed data
views. As the typed data views are implemented as normal Dart
instances and not a internal VM object the deserializer have been
expanded to process serialized objects of the type used to create
these views. The typed data object that the view is based on will
always be serialized as part of the message.
Currently only vews created with constructor Uint8List.view on top of
an Uint8List are supported.
R=ager@google.com
BUG=https://code.google.com/p/dart/issues/detail?id=9484
Review URL: https://codereview.chromium.org//14065006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21252 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-11 07:15:08 +00:00
whesse@google.com
e1c70ce932
dart:io | Fix error in deserializing of native port messages.
...
BUG=dartbug.com/9369
Review URL: https://codereview.chromium.org//12893013
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20380 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-22 14:53:25 +00:00
asiva@google.com
69d0484d2a
- Use dart:typedata types in the Dart API calls.
...
- Change the dart/io code to not use dart:scalarlist
Review URL: https://codereview.chromium.org//12730013
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19848 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-12 10:57:48 +00:00
asiva@google.com
c2cafbbe33
- Change the layout of external typed array objects to avoid the extra indirection when accessing elements in the array.
...
- Change the Dart API which create these external arrays to account for this change
Review URL: https://codereview.chromium.org//12093071
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17937 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-31 18:53:21 +00:00
asiva@google.com
4c069867e4
- Make Boolean 'true' and 'false' singleton VM isolate objects.
...
- Change all uses of it
Review URL: https://codereview.chromium.org//11745022
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16623 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-04 01:52:05 +00:00
asiva@google.com
7022b39e35
Convert all symbol accessors to return read only handles so that it is not necessary to create a new handle in the code that uses it.
...
Added a few more strings to the symbols list.
Review URL: https://codereview.chromium.org//11667012
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16584 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-02 19:31:59 +00:00
asiva@google.com
76def187f8
Fix bug in Utf8::CodePointCount which was causing some strings with latin1
...
characters to be stored as TwoByteStrings.
Review URL: https://codereview.chromium.org//11419259
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15604 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-30 21:53:58 +00:00
sgjesse@google.com
7fc2230b02
Add support for surrogates when serializing and deserializing for native ports
...
As Dart allows creating string with UTF-16 surrogate code units which
are not always in lead/trail pairs, we need to support this in the
communication with native ports.
This change allows surrogate code units in messages to/from native
ports and supports them in the UTF-8 encoding used on the Dart_CObject
structure string representation.
R=ager@google.com , erikcorry@google.com , asiva@google.com
BUG=
Review URL: https://codereview.chromium.org//11280150
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15585 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-30 13:06:44 +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
sgjesse@google.com
2411e399ad
Always zero-initialize array used for mapping VM symbols to Dart_CObject
...
NULL pointer checks are used to check for valid entries.
TBR=ager@google.com
BUG=
Review URL: https://codereview.chromium.org//11280059
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15086 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 14:58:26 +00:00
sgjesse@google.com
d1076bd12b
Deserialize same symbol as same Dart_CObject
...
When symbols are deserialized as part of a Dart_CObject the same
symbols are now turned into the same Dart_CObject objects.
R=ager@google.com
BUG=
Review URL: https://codereview.chromium.org//11415048
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15082 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 14:02:25 +00:00
asiva@google.com
e1adedb421
Revert OneByteString back to ISO Latin-1 instead of ASCII
...
as webkit supports ISO Latin-1 and UTF-16 encodings for strings.
Review URL: https://codereview.chromium.org//11365243
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14989 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-16 00:13:18 +00:00
sgjesse@google.com
cde0bb06dd
Add support for non ASCII strings when communicating with native ports
...
The string representation in a Dart_CObject strructure is now
UTF8. All strings read are now converted to UTF8 from either ASCII or
UTF16 serialization. All strings posted should be valid UTF8 and are
serialized as either ASCII or UTF16 depending on the content.
Proper andling of surrogate pairs is missing, but will be added when
https://codereview.chromium.org/11368138/ lands.
R=ager@google.com , erikcorry@google.com , asiva@google.com
BUG=
Review URL: https://codereview.chromium.org//11410032
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14887 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-14 13:01:57 +00:00
lrn@google.com
1555c1db26
Convert String to a class.
...
Remove the StringImplementation class.
Review URL: https://codereview.chromium.org//11085003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14779 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-12 08:16:59 +00:00
asiva@google.com
ebbb7c4134
- Represent strings internally in UTF-16 format, this makes it
...
compatible with webkit and will allow for easy externalization of
strings. One byte strings are retained for pure ASCII strings.
(The language specification was changed recently to reflect this as
follows "A string is a sequence of UTF-16 code units").
- Remove four byte string class and all references to it.
- Rename some of the string functions in Dart API to make them
consistent and better describe the underlying functionality
Dart_NewString => Dart_NewStringFromCString
Dart_NewString8 => Dart_NewStringFromUTF8
Dart_NewString16 => Dart_NewStringFromUTF16
Dart_NewString32 => Dart_NewStringFromUTF32
Dart_NewExternalString8 => Dart_NewExternalUTF8String
Dart_NewExternalString16 => Dart_NewExternalUTF16String
Dart_NewExternalString32 => Dart_NewExternalUTF32String
Dart_StringGet8 => Dart_StringToUTF8
Dart_StringGet16 => Dart_StringToUTF16
Dart_StringToCString => Dart_StringToCString
Dart_IsString8 => Removed
Dart_IsString16 -> Removed
Dart_StringToBytes -> Removed
Dart_StringGet32 -> Removed
Review URL: https://codereview.chromium.org//11318018
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14357 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 17:56:46 +00:00
sgjesse@google.com
cff26ea449
Handle receiving GrowableObjectArrays correctly on native ports
...
The deserialization when receiving GrowableObjectArrays through native
ports was not correct. A GrowableObjectArrays is now handled as an
internal VM object and is now handled on all code paths.
Added a more comprehensiive test using array literals which are
represented as GrowableObjectArrays.
R=ager@google.com
BUG=dart:5474
Review URL: https://codereview.chromium.org//10989074
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12992 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-28 07:55:00 +00:00
lrn@google.com
292da5cc48
Make int an abstract class.
...
This looks deceptively simple (the only real change is in init, which
just copies the code for double, and the rest are just renaming for
consistency). It seems to work.
Review URL: https://chromiumcodereview.appspot.com//10933039
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12304 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 07:17:27 +00:00
sgjesse@google.com
b84841874d
Support receiving GrowableObjectArray on native ports
...
Array literals are created as GrowableObjectArrays internally.
A GrowableObjectArray holds a length and a backing store. The backing
store is an array. When receiving a GrowableObjectArray an object is
created for holding the GrowableObjectArray. The the backing store has
been read the object holding the GrowableObjectArray is transformed
into an array with its content from the backing store.
R=asiva@google.com , ager@google.com
BUG=dart:4993
TEST=runtime/vm/snapshot_test.cc/DartGeneratedArrayLiteralMessagesWithBackref,
runtime/vm/snapshot_test.cc/DartGeneratedArrayLiteralMessages
Review URL: https://chromiumcodereview.appspot.com//10916207
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12197 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-11 14:37:07 +00:00
hausner@google.com
5692051e4e
Convert double interface into abstract class
...
In a future change, we can implement double in the core
library, eliminating class Double (using the patch class
feature).
Review URL: https://chromiumcodereview.appspot.com//10876100
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11631 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 17:29:49 +00:00
hausner@google.com
c7f5bcd0ca
Eliminate interface bool
...
Replace with concrete class bool instead, and getting rid of class Bool in core_impl library.
Review URL: https://chromiumcodereview.appspot.com//10874071
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11418 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 21:09:23 +00:00
turnidge@google.com
bd995a345e
Avoid trusting the length encoded in the Snapshot if there is an
...
external length available. We now pass a length with all messages in
the vm and verify that there is no mismatch with the length from the
Snapshot.
Fixed a bug in the use of ApiMessageReader. We were always manually
adding Snapshot::kHeaderSize to the data, but neglecting to subtract
kHeaderSize from the message length.
Added FullSnapshotWriter and MessageWriter classes.
Review URL: https://chromiumcodereview.appspot.com//10829444
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11413 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 20:25:44 +00:00
asiva@google.com
5928516358
Address review comments from previous CL.
...
Review URL: https://chromiumcodereview.appspot.com//10807078
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10608 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 21:57:34 +00:00
asiva@google.com
d4d781d636
- Unify class ids and snapshot object ids list so that we don't have disparate
...
and sometimes confusing values.
- Remove instance_kind_ field from RawClass.
- Rename all class id names to have a Cid suffix.
- Remove code from object.h and object_store.h which dealt with object ids
of predefined classes for snapshots.
Review URL: https://chromiumcodereview.appspot.com//10827209
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10418 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 19:46:23 +00:00
asiva@google.com
05f310b207
Do not try to serialize VM objects, these are read only canonical objects and should be referred to using ids.
...
Turn VM symbols back on.
Review URL: https://chromiumcodereview.appspot.com//10834069
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10310 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 21:56:39 +00:00
ager@google.com
52230ca22b
Support posting of external data into dart as external uint8 arrays through the Dart API.
...
The native ports use the snapshot reader to create the dart objects. Added support for reading external arrays from snapshots but no support for writing them. The only way an external array is written to a snapshot is through the api message writer.
This allows dart:io to avoid one copy of data read from files and sockets. This change only contains one use of the new API.
R=asiva@google.com ,iposva@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//10698011
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9281 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-02 07:22:32 +00:00
iposva@google.com
5a05319599
- Avoid doubling 0 when trying to determine a new size for the
...
ApiMessageWriter forwarding list.
- Use matching allocation calls in ApiMessageWriter.
- Sort list of source files.
Review URL: https://chromiumcodereview.appspot.com//10557043
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8817 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-18 20:01:28 +00:00
asiva@google.com
c078663643
1. Remove recursion during snapshot writing and reading
...
2. set thread stack size to 128k
3. Fix the native message handler to ensure that it works with the new model of not recursively inlining objects.
Review URL: https://chromiumcodereview.appspot.com//10535066
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8517 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-11 21:39:05 +00:00