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>
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>
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>
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER
This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.
R=asiva@google.com, rmacnak@google.com
Review URL: https://codereview.chromium.org/2450713004 .
- 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 .
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
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
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
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
The native port callback is now passed the message as a decodes
Dart_CMessage structure. The Dart_CMessage structure is allocated
in a zone and the callback receiving it should expect the
lifetime to be controlled by the caller.
Added support for zones which do not require a current
isolate. Changed the GrowableArray to support allocating in
aprovided zone instead of the zone for the current isolate.
R=turnidge@google.com, asiva@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//9325022
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4068 260f80e4-7a28-3924-810f-c04153c831b5