Commit graph

8 commits

Author SHA1 Message Date
turnidge@google.com 0e98d4ae64 Allow embedders to provide custom message delivery for an isolate.
==============

Added Dart_SetPostMessageCallback and Dart_SetClosePortCallback.
These allow the embedder to provide custom message/port behavior
for their application. The vm provides standard implementations
that work with the standard run loop.

Added Dart_HandleMessage, which processes one message on the
current isolate. Embedders can use this to write their own
message processing loops. Rewrote code to use this internally.

Added Isolate::StandardRunLoop() to share code between
Dart_RunLoop and lib/isolate.cc

Changed the interface to PortMap::PostMessage. PostMessage is
now agnostic to message delivery mechanism. Note that PortMap is
now out of the "ReceiveMessage" business entirely. Moved
MessageQueue and friends out to message_queue.cc/h.

Moved the monitor from the Isolate into the MessageQueue. No
need for outsiders to mess. Added MessageQueue::Wait. Moved
monitor locking from PortMap into MessageQueue itself, which was
easier for me to reason about. Wrote some tests.

Removed PortMessage::Handle. The code turned into Dart_HandleMessage.

Regularized the nomenclature around ports. Type is now always
Dart_Port instead of intptr_t. Variables end in _port instead of
_id. Use the term "dest" instead of "target" or "send".

Added a family of new tests to port_test.

Added EXPECT_NE to the test framework.
Review URL: http://codereview.chromium.org//8297004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@516 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-18 17:54:07 +00:00
asiva@google.com fdb5d9a607 Fix compilation warnings/errors seen with newer versions of gcc compiler.
Review URL: http://codereview.chromium.org//8222017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@321 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-11 00:37:11 +00:00
cshapiro@google.com 9aca46d2a7 Implement support for reading and writing UTF-8 encoded strings.
In the past, characters in C strings were assumed to encode themselves
and when converting Dart strings to C strings characters were narrowed
to 8-bit values.

With this change, C strings are assumed to be UTF-8 encoded.
Converting a C string to a Dart string applies UTF-8 decoding and
converting a Dart string to a C string applies UTF-8 encoding.

Also part of this change are new methods to construct uninitialized
string objects and to copy string data.

BUG=5343358

Review URL: https://chromereviews.googleplex.com/3557012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@169 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-06 22:42:24 +00:00
regis@google.com db3a736c33 Support optional named arguments at the dart_entry level in the VM.
Fix bug 5422033: Const expressions don't work with named arguments.
Review URL: https://chromereviews.googleplex.com/3552015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@168 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-06 22:40:45 +00:00
asiva@google.com 0b30a49971 5419598: Add a setjmp around the isolate spawning code so that parse errors
are caught and reported as errors.
5417103: Add a setjmp around Dart_Run_Loop so that parse errors
are caught and reported as errors.
Review URL: https://chromereviews.googleplex.com/3553012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@140 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-06 18:33:36 +00:00
srdjan@google.com b0af113468 Address Siva's suggestion.
Review URL: https://chromereviews.googleplex.com/3546013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@97 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-06 07:46:45 +00:00
srdjan@google.com 665b268641 Fix Dart_InvokeDynamic api to handle the null receiver properly: call Object's methods (e.g., "toString", "noSuchMethod").
Review URL: https://chromereviews.googleplex.com/3525014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@48 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 16:27:07 +00:00
dgrove@google.com 4c0f559d23 Initial checkin.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00