Commit Graph

113 Commits

Author SHA1 Message Date
Ryan Macnak b1c09ecd8f [vm] Make naming more consistent when converting between handles, tagged and untagged pointers.
Currently we have things called XPtr which are not what you get from ptr().

Old world:
handle->raw() returns RawObject* (tagged)
raw_obj->ptr() returns RawObject* (untagged)

After 6fe15f6df9:
handle->raw() returns ObjectPtr
obj_ptr->ptr() returns ObjectLayout*

New world:
handle->ptr() returns ObjectPtr
obj_ptr->untag() returns UntaggedObject*

TEST=ci
Change-Id: I6c7f34014cf20737607caaf84979838300d12df2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149367
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-15 23:32:02 +00:00
Ryan Macnak ca5853779b [vm, gc] Route most heap reads through LoadPointer.
Provides a good point to apply a read barrier, pointer decompression, or TSAN annotations.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/44091
Change-Id: I4e6930264f8ef8399e261fd24fcab78731d6e29c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174484
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-12-02 21:08:58 +00:00
Ryan Macnak b9c86f07dc [vm] Produce clearer error messages for malloc/realloc failures.
TEST=bots
Bug: https://github.com/dart-lang/sdk/issues/43642
Change-Id: I7bc2b3b5231413967f9b1f608c957326ff6c6aaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171680
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-11-13 22:10:54 +00:00
Daco Harkes 5278383736 [vm] Native API: Make Dart_NewWeakPersistentHandle not auto delete
Changes Dart_NewWeakPersistentHandle to no longer auto delete the
weak persistent handle.

Changes the signatures of WeakPersistentHandleFinalizers to no longer
have access to the handle.

Flutter PR: https://github.com/flutter/engine/pull/19843
g3 presubmit: cl/318028238

Issue: https://github.com/dart-lang/sdk/issues/42312

TEST=runtime/vm/dart_api_impl_test.cc

Change-Id: I3f77db9954d9486759f903b78c03a494f73c68ba
Cq-Include-Trybots:dart/try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-nnbd-linux-debug-x64-try,analyzer-nnbd-linux-release-try,front-end-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151525
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-11-03 10:27:44 +00:00
Tess Strickland a4a714ebf9 [vm] Consolidate the *WriteStream hierarchy.
All *WriteStream classes are now part of the same hierarchy:

class BaseWriteStream : ValueObject;

  Base class for all *WriteStreams. Provides all the methods from
  the old WriteStream except for buffer() and SetPosition()
  (relegated to NonStreamingWriteStreams). Has one pure virtual
  method Realloc that must be overridden by concrete subclasses.

class NonStreamingWriteStream : BaseWriteStream;

  Base class for all *WriteStreams where the entire stream is available
  at all times (i.e., no flushing to an external sink). Extends the
  public BaseWriteStream API with buffer() (for accessing the stream
  contents) and SetPosition() (for changing the current stream pointer
  to the given absolute position in the stream).

class MallocWriteStream : NonStreamingWriteStream;

  Uses realloc to reallocate the internal buffer.  Almost the same as
  the old WriteStream, except that it only takes an initial size.  Adds
  one public method Steal() for taking ownership of the current buffer
  contents (after which the buffer is reset to an empty state). Instead
  of passing a pointer to a buffer, the internal buffer must be accessed
  via either Steal() or buffer(), which allows access to the current
  stream contents without changing ownership or resetting the stream.
  The internal buffer is freed on stream destruction.

class ZoneWriteStream: NonStreamingWriteStream;

  Takes a zone and reallocates the internal buffer in that zone. No
  additional public methods beyond those available from
  NonStreamingWriteStream.

class StreamingWriteStream : BaseWriteStream;

  Uses realloc to reallocate the internal buffer.  Generally same as
  before, where the contents of the stream are periodically flushed
  using Dart_StreamingWriteCallback. Since it extends BaseWriteStream,
  there are now more methods available for writing data to the stream
  than just Print/VPrint/WriteBytes. Since portions of the stream may be
  flushed and thus no longer in the internal buffer, does not provide
  access to the contents of the stream or a way to reposition the
  current stream pointer. Flushes any unflushed data and frees the
  internal buffer on stream destruction.

Also refactor things so that write streams are passed to appropriate
recipients, instead of the recipients taking arguments they only used to
create a WriteStream internally. Thus, recipients now can just specify
the appropriate base class for the public API used:

* BaseWriteStream for just writing to the stream, or
* NonStreamingWriteStream if re-positioning or the stream contents are
  needed.

Change-Id: I419096ecd9331483d168b079fca55b69ef397f15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164080
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-09-23 21:05:59 +00:00
Ryan Macnak 3f01c3e588 [vm] Handle all typed data element types in various C APIs.
Change-Id: Ie27989895c1bb4f6fd609523f9fac0a7d4f437a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155360
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-07-27 22:40:46 +00:00
Ryan Macnak 2707880f1b [vm] Fix various UBSan failures.
Bug: https://github.com/dart-lang/sdk/issues/39427
Change-Id: I74e0eee623d88005fb2893d03e284a87daa09260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146696
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-05-07 19:40:18 +00:00
Ryan Macnak 6fe15f6df9 [vm] Represent tagged pointers as C++ value types instead of C++ pointer types.
This works around bugs in UndefinedBehaviorSanitizer and Clang.

Bug: b/28638298
Change-Id: I6be595f9664516019d28017d24559583a1ae3a21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144354
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-04-25 05:21:27 +00:00
Ryan Macnak 160046f44c [vm] Move CID predicates out of RawObject.
When using C++ value types to represent tagged pointers, we cannot use forward declarations for tagged pointers. This helps to break include cycles when attempting to keep IsXYZ predicates as tagged pointer member functions.

class_id.h also seems like a more natural place for these predicates, which were written before there was a class_id.h.

Change-Id: I0677560a794ed084d10f844606e202feb0c3820a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144321
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-04-21 20:09:55 +00:00
Liam Appelbe 93c5134a69 [vm] Add nullability variations for snapshot singletons
This fixes snapshot_test.cc in legacy mode.

Bug: https://github.com/dart-lang/sdk/issues/40169
Change-Id: Ibb47634be296b3b9159af9fe0500d64f9d279b60
Fixes: https://github.com/dart-lang/sdk/issues/40169
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133148
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-01-27 18:27:39 +00:00
Ryan Macnak 36985859e4 [vm] Don't copy when reading typed data in messages sent to native ports.
Bug: https://github.com/dart-lang/sdk/issues/37833
Change-Id: Iac906e58320e003365c4c0624b4587579f352db1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114970
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-08-30 17:49:28 +00:00
Matthew Dempsky a53c12d07a [vm] Use std::unique_ptr with Message
Message is a C++ type with a simple ownership model appropriate for
std::unique_ptr. This CL applies the following changes:

1. All uses of "new Message(...)" are replaced with
"Message::New(...)", which is effectively
"std::make_unique<Message>(...)". (The latter was only added in C++14,
but Dart still compiles in C++11 mode.)

2. All owning Message* are replaced with std::unique_ptr<Message>. The
notable exception is MessageQueue, which still uses raw Message*
internally to simplify the linked list handling.

3. All "delete message;" statements are removed.

4. Uses of "NULL" replaced with "nullptr" as necessary.

Change-Id: I05b5804289f2a225bfa05d3c1631129358fed373
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101222
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Matthew Dempsky <mdempsky@google.com>
2019-05-06 21:01:39 +00:00
Ryan Macnak ac4fd50446 [vm, compiler] Check for length overflow when eliminating write barriers for variable-length objects.
Bug: https://github.com/dart-lang/sdk/issues/36778
Change-Id: I03bd00dd5a035309807e16911dcd7602b4de5e44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100900
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-04-30 21:36:07 +00:00
Ryan Macnak 971f4845d7 [build] Remove last platform -> vm and bin -> vm dependencies. Fix some ODR violations.
Change some static_libraries to source_sets to make ODR violations link-time errors.

This is needed to enable (stop suppressing) -fvisibility=hidden in Fuchsia product builds.

Change-Id: I699cec8d4b516beab9cebf9db0a522a7ff99e004
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99822
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-04-22 20:15:43 +00:00
Martin Kustermann d445d29fa3 [VM] Define layout of _*ArrayView/_ByteDataView in C+++
This removes the 3 fields from the classes in Dart and instead describes
the layout in C++ via a RawTypedDataView class (as already do with
normal RawTypedData). The existing "semi" TypedDataView handle class is
changed to be a real handle class.

This decreases performance of some microbenchmarks due to field guards
not being used anymore (before the JIT could add a field guard to view classes
guarding that only normal typed data is used as backing store (and not e.g. external
typed data)

Issue https://github.com/dart-lang/sdk/issues/35154
Issue https://github.com/dart-lang/sdk/issues/31954

Change-Id: I7a0022b843a4c0fa69f53dedcc4c7bd2117cdc37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96806
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-03-15 21:24:15 +00:00
Ryan Macnak 2f25dcda16 [vm] Remove script snapshots.
Change-Id: I5bc692b754c0909de4aa5f05af81b074578b16f4
Reviewed-on: https://dart-review.googlesource.com/76706
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-26 22:49:27 +00:00
Ryan Macnak 5993d0e6a2 [vm] Check for NULL finalizers in Dart_PostCObject.
Bug: https://github.com/dart-lang/sdk/issues/33781
Change-Id: I05e36bc3f285dcc6ccb02bc7a171f6bc687dc3c1
Reviewed-on: https://dart-review.googlesource.com/64464
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-07-11 17:16:34 +00:00
Ryan Macnak 7d7e7c268e [vm] Work around interaction between type and instance canonicalization in isolate messages.
Type canonicalization is deferred between in may involve cycles. Instances are canonicalized eagerly, but their type arguments are not necessarily canonical yet, which can lead to incorrect canonicalization of the instance.

The work around is to include the most popular type arguments in the serializer's set of base objects, bypassing deferred canonicalization. Other type arguments will continue to fail.

Bug: https://github.com/dart-lang/sdk/issues/33430
Change-Id: Ia992b3ebc2974b54acb5c88b3e1d836f6ec1f1b8
Reviewed-on: https://dart-review.googlesource.com/61721
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-06-21 23:45:05 +00:00
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