Alexander Markov
c3b5939965
[vm] Remove --limit-ints-to-64-bits option and old _Bigint class
...
Closes https://github.com/dart-lang/sdk/issues/33306
Change-Id: I7088d8b7143edbe24f5cefe4be037ad2006e0625
Reviewed-on: https://dart-review.googlesource.com/58101
Commit-Queue: Alexander Markov <alexmarkov@google.com >
Reviewed-by: Régis Crelier <regis@google.com >
Reviewed-by: Ryan Macnak <rmacnak@google.com >
2018-06-04 20:10:40 +00:00
Ryan Macnak
afdbce7b13
[vm, isolate] Send large TypedData as ExternalTypedData in isolate messages.
...
Be careful to free external data when reading or writing a message is interrupted, or releasing messaging without reading on shutdown.
Bug: https://github.com/dart-lang/sdk/issues/31959
Change-Id: Ia39acb9ca0e27cf9e8b83961741e5949b5930266
Reviewed-on: https://dart-review.googlesource.com/41561
Commit-Queue: Ryan Macnak <rmacnak@google.com >
Reviewed-by: Zach Anderson <zra@google.com >
Reviewed-by: Siva Annamalai <asiva@google.com >
2018-02-21 18:57:14 +00:00
Ryan Macnak
3f40488ec4
[vm, isolate] Refactor isolate message snapshotting to centralize construction of the Message.
...
Remove unused special case in ApiMessageWriter for lists of int.
This is in preparation for ensuring we always free any external data that ends up in an isolate message.
Bug: https://github.com/dart-lang/sdk/issues/31959
Change-Id: I999656fc11d2aee9aebe70852be5bb075f234b4d
Reviewed-on: https://dart-review.googlesource.com/41020
Reviewed-by: Zach Anderson <zra@google.com >
Commit-Queue: Ryan Macnak <rmacnak@google.com >
2018-02-14 00:28:01 +00:00
Johnni Winther
5b626c2a40
Revert "[vm, isolate] Send large TypedData as ExternalTypedData in isolate messages."
...
This reverts commit ddafb88794 .
Change-Id: I5bf56c82e4f6ad43ab9460220bc17476596a0530
Reviewed-on: https://dart-review.googlesource.com/37760
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2018-01-31 10:22:35 +00:00
Ryan Macnak
ddafb88794
[vm, isolate] Send large TypedData as ExternalTypedData in isolate messages.
...
Bug: https://github.com/dart-lang/sdk/issues/31959
Change-Id: I7235d24e29b72bc9849d726b63f0d4c38633e803
Reviewed-on: https://dart-review.googlesource.com/37423
Reviewed-by: Siva Annamalai <asiva@google.com >
Commit-Queue: Ryan Macnak <rmacnak@google.com >
2018-01-30 23:48:01 +00:00
Vyacheslav Egorov
08d2841def
[VM] Fix deserialization of arrays with type arguments in ApiMessageReader.
...
A placeholder object must be created and registered via AddBackRef(...) *before*
any inner objects are deserialized otherwise NextAvailableObjectId() might
reuse current object id for an inner object with omitted object id leading
to inconsistent back references state.
Also handle kObjectType in ReadIndexedObject allowing it to deserialize things
like <Object>[...].
This bug was revealed by trying out to run VMService isolate in Kernel mode
with strong mode enabled leading to arrays that had no type arguments have
(inferred) type arguments.
R=kustermann@google.com
BUG=
Review-Url: https://codereview.chromium.org/3003333002 .
2017-08-25 11:51:23 +02:00
Zachary Anderson
6cd8a79078
VM: Re-format to use at most one newline between functions
...
R=asiva@google.com
Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Todd Turnidge
bbc2ac93a3
Start adding vm/cc tests for rewind functionality.
...
These will make it easier to debug rewind on simdbc64.
BUG=
R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2662333002 .
2017-01-31 12:02:26 -08:00
Vyacheslav Egorov
43a0500e37
VM: [Kernel] Fix bootstraping when Kernel isolate is used.
...
We must bootstrap from Kernel instead of Source when running with --dfe
BUG=
R=asiva@google.com , kustermann@google.com
Review-Url: https://codereview.chromium.org/2651633002 .
2017-01-30 20:52:59 +01:00
Zachary Anderson
a1bcf051d8
clang-format runtime/vm
...
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
Zachary Anderson
89e81a4620
Handle empty string messages in Dart_PostCObject
...
R=asiva@google.com
Review URL: https://codereview.chromium.org/2278763002 .
2016-08-25 12:39:35 -07:00
Ryan Macnak
4b369f6a0c
Remove dead full snapshot support from the recursive descent serializer.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org/2161853002 .
2016-07-19 17:50:49 -07:00
Ryan Macnak
1e8fdaee68
Support for taking full snapshots from 'dart', not just 'dart_bootstrap'.
...
- Don't create rival copies of the predefined symbols in isolates in dart_bootstrap.
- Don't do work to save these rival copies during symbol table compaction.
- Create unified symbol table just before writing the vm isolate.
- Create unified list of scripts to include in the vm isolate.
- Ignore object ids of the old vm isolate when writing a new one.
- Ensure token stream private keys are hashed.
- Use the type of isolate we are writing instead of an object's current isolate to decide if vm isolate objects are written symbolically.
BUG=
R=asiva@google.com
Review URL: https://codereview.chromium.org/1944213002 .
2016-05-10 10:13:33 -07:00
Florian Schneider
fbdce6a59e
VM: Const-correctness fixes.
...
Three types of fixes:
1. Remove redundant const_cast
2. Remove const_cast by adding const when appropiate.
3. Remove const_cast by removing const (e.g. places where we call free with it)
For now I only fixed places where the fix is local enough - i.e. does not require
changed a large amount of code.
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1526123002 .
2015-12-15 19:24:40 +01:00
Zachary Anderson
fa8a0613a3
Fold ApiObjectConverter use into ApiMessageReader
...
TODO from change on Friday.
R=turnidge@google.com
Review URL: https://codereview.chromium.org/1523013002 .
2015-12-14 11:12:25 -08:00
Siva Annamalai
f92f63baa5
1. Do not mark an object by storing the object id used during serialization in the object header.
...
2. Removed all the GC task locking code which was needed to ensure that a garbage collection was not in progress when writing a message as the message writer was manipulating the object header
3. Use the rawobject => object_id hash map to store and retrieve the object id for an object.
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1399663002 .
2015-10-13 15:26:04 -07:00
Siva Annamalai
02c702bf92
1. Write the backing data array of a GrowableObjectArray as a reference
...
2. Cleanup and refactor WriteObjectRef and WriteObjectInlined and pass as_reference as a parameter to the WriteTo function to allow respective types to deal with it.
3. Added a as_reference parameter to the ReadFrom functions (currently the parameter is not used but the next round of changes will cleanup ReadObjectRef and ReadObjectInlined similarly).
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1388543008 .
2015-10-12 12:45:59 -07:00
Siva Annamalai
810823f8d5
Use the zone in ApiNativeScope for allocating objects in the ApiMessageReader instead of passing in an allocator.
...
BUG=
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//1319583003 .
2015-08-25 14:48:41 -07:00
Siva Annamalai
e61f1dc8ce
1. Reclaim the CreatedFromSnapshot bit and use the bit to indicate VM heap object.
...
2. Cleanup calls to set_tags when reading objects from a snapshot.
3. Fixes issue 21816
R=regis@google.com
Review URL: https://codereview.chromium.org//1221503004 .
2015-08-10 11:02:31 -07:00
Siva Annamalai
521dee763c
1. Fix the type arguments recursion problem that gets introduced when canonicalization of type arguments is deferred while reading a script snapshot. This problem was shows up as random stack overflow crashes when running pub
...
2. Patching of the type arguments field in a GrowableObjectArray was missed
BUG=23930
R=regis@google.com , rmacnak@google.com
Review URL: https://codereview.chromium.org//1276753002 .
2015-08-06 10:55:48 -07:00
Todd Turnidge
53dbc3764d
Support sending and receiving Capability objects from C code.
...
BUG=
R=asiva@google.com
Review URL: https://codereview.chromium.org//1267603003 .
2015-07-30 14:07:36 -07:00
Siva Annamalai
b0c9f2ef9b
Fix for issue 23244
...
Refactoring of WriteObjectImpl and ReadObjectImpl to enable inlining of canonical objects in the snapshot stream.
BUG=23244
R=rmacnak@google.com
Review URL: https://codereview.chromium.org//1260033004 .
2015-07-28 10:52:05 -07:00
Siva Annamalai
969005dfe6
Fix for issue 23834 ( https://github.com/dart-lang/sdk/issues/23834 )
...
Script snapshots do not use VM isolate object indexes and hence we should not be accounting for max_vm_isolate_object_id.
This is related to the fix done in https://github.com/dart-lang/sdk/issues/23647
BUG=23834
R=rmacnak@google.com
Review URL: https://codereview.chromium.org//1234803008 .
2015-07-15 16:56:13 -07:00
Siva Annamalai
b810ff86f9
Fix build bot error.
...
BUG=
Review URL: https://codereview.chromium.org//1153853002
2015-05-22 12:59:46 -07:00
Siva Annamalai
5e0a3d66e5
Move bootstrap scripts and token streams to the VM isolate so that they become read only objects. This reduces the per isolate heap size as follows:
...
Before the change:
Size of isolate snapshot = 780799
New space (0k of 1024k) Old space (758k of 1024k)
After the change:
Size of isolate snapshot = 279696
New space (0k of 1024k) Old space (602k of 1024k)
BUG=
R=hausner@google.com
Review URL: https://codereview.chromium.org//1151113002
2015-05-22 12:48:11 -07:00
asiva@google.com
05d7eb5dfa
Move symbol table from per isolate snapshot to vm isolate snapshot, this reduces the per isolate initial heap size
...
from New space (0k of 1024k) Old space (1274k of 1536k)
to New space (0k of 1024k) Old space (756k of 1280k)
R=hausner@google.com
Review URL: https://codereview.chromium.org//1123813002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45795 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-14 20:14:37 +00:00
asiva@google.com
ca1c3241c4
Fix for issue 21398.
...
Accept only 'literal-like' objects when sending messages to isolates
spawned using spawnURI. Allow all objects for isolates spawned using
spawnFunction.
R=iposva@google.com
Review URL: https://codereview.chromium.org//834233003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42793 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-12 23:14:30 +00:00
srdjan@google.com
5ef243e688
Make sure Bigint._digits is always a Uint32List and bever null. Adapt type information for get:_digits.
...
R=regis@google.com
Review URL: https://codereview.chromium.org//580903004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40463 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-18 21:18:25 +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
zra@google.com
c686b2c624
Finishes removing intptr_t from raw object fields.
...
Also removes {Read,Write}IntptrValue from the snapshot reader and writer.
R=asiva@google.com
Review URL: https://codereview.chromium.org//343803002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40048 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 19:51:22 +00:00
koda@google.com
c645b0ab71
Object ids in snapshots are assigned sequentially, and can in many cases be omitted by the writer and inferred by the reader. The exceptions are the classes that are serialized in two steps (arrays and user-level Dart instances), where the second step must include the id.
...
For standalone, makes full snapshot 5% smaller, and startup ~1.5% faster when measured on a Nexus 10.
R=zra@google.com
Review URL: https://codereview.chromium.org//387993007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38261 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-15 21:47:00 +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
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