Allow for the library tag handler to be setup for the isolate, instead of
while loading a script. This ensures that we can use #import on the boot strap libraries like builtin, uri etc.
This change results in a dart API change and corresponding modifications are
necessary in dartium and App Engine.
Review URL: https://chromiumcodereview.appspot.com//10302020
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7506 260f80e4-7a28-3924-810f-c04153c831b5
Dart strings with embedded '\0' characters cannot be faithfully
represented as a C string.
This change adds Dart_StringToBytes to the Dart API. This function
converts a Dart string to array of UTF-8 code units and returns a
length. Builtin::PrintString now calls Dart_StringToBytes instead of
Dart_StringToCString and, for I/O, fwrite is called instead of fprintf
with the string format specifier.
BUG=1098
Review URL: https://chromiumcodereview.appspot.com//10306002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7260 260f80e4-7a28-3924-810f-c04153c831b5
Prologue weak persistent handles are similar to weak persistent
handles but exhibit different behavior during garbage collections that
invoke the prologue and epilogue callbacks. While weak persistent
handles always weakly reference their referents, prologue weak
persistent handles weakly reference their referents only during a
garbage collection occurs that invokes the prologue and epilogue
callbacks. During all other garbage collections, prologue weak
persistent handles strongly reference their referents.
Review URL: https://chromiumcodereview.appspot.com//9655011
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5445 260f80e4-7a28-3924-810f-c04153c831b5
Weak reference sets are similar to "populations" or "weak pairs".
Like these structures, objects in a key set preserve members of an
associated value set. Unlike these structures, a weak reference set
is not a general associative container. Weak reference sets exist
for the duration of a garbage collection.
Weak reference sets are proceesed iteratively allowing values of one
weak reference to be keys of a other weak reference sets. The garbage
collector will process weak reference sets iteratively, revisiting all
unmarked weak reference sets if any one weak reference set is marked.
This process repeates until a fixed-point is reached.
Review URL: https://chromiumcodereview.appspot.com//9531001
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4917 260f80e4-7a28-3924-810f-c04153c831b5
This change adds peer and callback arguments to the external byte array
constructor and moves the peer, callback, and data storage into a VM
peer object. At construction time, a weak persistent handle and VM
callback is associated with the VM peer. The VM callback will delete
the VM peer and invokes the user callback to reclaim the user peer.
This change also activates the callback support for the various classes of
external strings.
Review URL: https://chromiumcodereview.appspot.com//9368049
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4164 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
Boolean
Smi
Double
String
Array
The encoding uses the upper bits of the Dart_CObject type field for "marking" already written objects with their object id for generating backward references. After serialization these mark are removed.
Added the API Dart_PostCMessage for encoding and posting a Dart_CMessage structure.
Removed the API Dart_PostIntArray and used Dart_PostCMessage instead.
R=asive@google.com,turnidge@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//9104041
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3947 260f80e4-7a28-3924-810f-c04153c831b5
The C message reader can now read lists created like this:
new List()
new List<int>()
new List<String>()
new List<double>()
new List<bool>()
The backward references are now resolved and already allocated
Dart_CObject objects are reused when there is a backward reference.
The reuse of the Dart_CObject objects poses the issue of which objects
where allocated with the supplied allocator and which where not.
Currently this will work best with a zone allocator. This will be added
to the tests in a subsequent change.
R=asiva@google.com, turnidge@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//9303031
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3831 260f80e4-7a28-3924-810f-c04153c831b5
This function can be used in native functions to properly pass all
errors up the stack.
Set the long jump base in the Compiler instead of outside of the
compiler. A bunch of errors that used to be propagated through the
sticky_error are now propagated through return values. This includes
all of the DartEntry and DartLibraryCall functions.
In particular, we no longer use the long jump to cross dart frames.
Instead errors are propagated across dart frames using the same
mechanism that we use for unhandled exceptions. I've added assertions
to make sure that we only use the long jump when it is "safe".
Review URL: https://chromiumcodereview.appspot.com//9169102
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3815 260f80e4-7a28-3924-810f-c04153c831b5
Dart_NewNativePort creates a port associated with a C handler
function. When messages come in on this port, they are forwarded to
the C function for processing.
To support this, refactored PortMap so that it operates on a new
MessageHandler type instead of directly on Isolates.
For now, native ports have a dedicated single thread. Eventually we
will back native ports (and possibly Isolates as well) by a shared
thread pool.
Review URL: https://chromiumcodereview.appspot.com//9169063
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3804 260f80e4-7a28-3924-810f-c04153c831b5
(1)
No longer give embedders direct access to inter-isolate messages.
Instead, keep these messages in an internal queue and rely on the
embedder only to provide notifications. This simplifies the api in
numerous ways:
- post message callback drops parameters and becomes message notify callback.
- close port callback goes away
- Dart_Message type goes away
- Dart_HandleMessage gets a simpler signature
Updated the custom_isolate_test to show what use of the new apis looks like.
(2)
Begin to add support for out-of-band (OOB) messages. These messages
supercede regular messages in the queue. We will attempt to deliver
these messages even while code is running, by using the isolate
interrupt mechanism. These messages are not user-visible. They will
be used by the runtime internally to implement things like reflection.
Renamed PortMessage to Message.
Refactored message sending apis in PortMap and Isolate.
Modified MessageQueue to be aware of multiple priorities.
Modify Dart_HandleMessage to process multiple OOB messages
Review URL: https://chromiumcodereview.appspot.com//9182001
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3562 260f80e4-7a28-3924-810f-c04153c831b5
after an isolate is created and initialized.
Added an option --use_script_snapshot which creates a snapshot of the specified script in an isolate, shuts that down and restarts on a new isolate and loads the script from the snapshot buffer and executes it.
Review URL: http://codereview.chromium.org//8970004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2609 260f80e4-7a28-3924-810f-c04153c831b5
implemented by extending the existing support for stack overflow
checking in the vm. When an interrupt is scheduled for an isolate, we
overwrite the isolate's stack limit with a value guaranteed to cause a
stack overflow.
We support multiple kinds of interrupts, encoded in the low bits of
the stack limit.
Add Dart_InterruptIsolate and Dart_InterruptIsolateCallback to the
dart embedding api to allow the embedder to request and handle
interrupts.
Add EXPECT_SUBSTRING(needle, haystack) testing macro.
Review URL: http://codereview.chromium.org//8851008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2529 260f80e4-7a28-3924-810f-c04153c831b5
- Introduce 3 kinds of snapshots (full, application script and messages)
- Added a dart API function to be used for generating an application snapshot
and for loading the script from an application snapshot.
Next step is to introduce special handling in the WriteTo and ReadFrom
snapshot functions for 'kind == Snapshot::kScript'
Review URL: http://codereview.chromium.org//8772061
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2105 260f80e4-7a28-3924-810f-c04153c831b5