Commit Graph

1132 Commits

Author SHA1 Message Date
turnidge@google.com 0ddd4c04e9 Dart_PropagateError, take 2.
This change hopefully takes care of the non-mac build issues.  The
checked mode failures are fixed in a separate cl.
Review URL: https://chromiumcodereview.appspot.com//9316071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3863 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-02 19:05:06 +00:00
turnidge@google.com ae88492093 Revert Dart_PropagateError until I can track down the problems in
checked mode tests.

Sorry for the hubbub.
Review URL: https://chromiumcodereview.appspot.com//9314053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3823 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 23:39:28 +00:00
asiva@google.com f4a89b3260 Fix for issue 1456 - register libraries read from a partial snapshot
Review URL: https://chromiumcodereview.appspot.com//9314048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3822 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 23:18:14 +00:00
turnidge@google.com 4a3d434dee Remove some unused variables to fix the linux build.
Review URL: https://chromiumcodereview.appspot.com//9310039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3817 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 22:40:13 +00:00
turnidge@google.com 9da62c5fea Add Dart_PropagateError.
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
2012-02-01 22:34:16 +00:00
ajohnsen@google.com 143de9eb80 Use ByteArray's native for Socket and File.
Review URL: https://chromiumcodereview.appspot.com//9235067

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3812 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 21:48:27 +00:00
turnidge@google.com 1f5364cd3b Add support for native ports in the vm.
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
2012-02-01 18:53:40 +00:00
cshapiro@google.com 569ef3c044 Add ByteArray interface and provide internal and external implementations.
The new ByteArray interface supersedes the ByteBuffer type which allowed
only external data storage.  This type has been removed and replaced by
the more flexible ByteArray with a default implementation that stores its
elements on the managed heap.

Review URL: https://chromiumcodereview.appspot.com//9195031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3613 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-26 02:42:08 +00:00
turnidge@google.com 8920623dc5 OOB messages and general message refactor.
(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
2012-01-24 19:31:01 +00:00
turnidge@google.com e62f34ce77 Give isolates names to be used during debugging.
Implement --trace_isolates.

-------------

Sample output of --trace_isolates for the CrossIsolateMessageTest:

[+] Starting isolate:
    isolate:    CrossIsolateMessageTest.dart/main-7112
[+] Starting isolate:
    isolate:    CrossIsolateMessageTest.dart/CrossIsolate1.main-7114
[+] Starting isolate:
    isolate:    CrossIsolateMessageTest.dart/CrossIsolate2.main-7115
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/main-7112
    reply_port: 7117
    dest:       CrossIsolateMessageTest.dart/CrossIsolate2.main-7115
    dest_port:  7115
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/CrossIsolate2.main-7115
    reply_port: 7118
    dest:       CrossIsolateMessageTest.dart/main-7112
    dest_port:  7117
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/main-7112
    reply_port: 7119
    dest:       CrossIsolateMessageTest.dart/CrossIsolate1.main-7114
    dest_port:  7114
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/CrossIsolate1.main-7114
    reply_port: 7120
    dest:       CrossIsolateMessageTest.dart/main-7112
    dest_port:  7119
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/main-7112
    reply_port: 0
    dest:       CrossIsolateMessageTest.dart/CrossIsolate1.main-7114
    dest_port:  7120
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/CrossIsolate1.main-7114
    reply_port: 0
    dest:       CrossIsolateMessageTest.dart/CrossIsolate2.main-7115
    dest_port:  7118
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/CrossIsolate2.main-7115
    reply_port: 0
    dest:       CrossIsolateMessageTest.dart/main-7112
    dest_port:  7116
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/main-7112
    reply_port: 0
    dest:       CrossIsolateMessageTest.dart/main-7112
    dest_port:  7113
[-] Stopping isolate:
    isolate:    CrossIsolateMessageTest.dart/CrossIsolate2.main-7115
[-] Stopping isolate:
    isolate:    CrossIsolateMessageTest.dart/CrossIsolate1.main-7114
[-] Stopping isolate:
    isolate:    CrossIsolateMessageTest.dart/main-7112
Review URL: https://chromiumcodereview.appspot.com//9242035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3416 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-18 21:46:27 +00:00
turnidge@google.com 53ba5c402e Make the "sticky error" an Error instead of a String.
I do this in preparation for using the sticky error to implement
isolate unwinding.
Review URL: https://chromiumcodereview.appspot.com//9186058

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3367 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-17 19:54:02 +00:00
asiva@google.com 8eb4b8cdf8 - Account for the possibility of timer objects being nested.
- Time library and source loading
Review URL: https://chromiumcodereview.appspot.com//9228007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3365 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-17 18:29:54 +00:00
cshapiro@google.com b652a312c1 Rename the VM internal class ByteArray to ByteVector.
Review URL: http://codereview.chromium.org//9139080

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3274 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-13 01:39:23 +00:00
cshapiro@google.com 917bbbfc39 Provide API support for weak handles and post-mortem finalization.
In addition, this change separates the storage of weak persistent
handles from ordinary persistent handles.  An ordinary persistent
handle now stores no other data than the raw pointer value.

Review URL: http://codereview.chromium.org//9148051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3273 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-13 01:23:42 +00:00
turnidge@google.com 5807b0add0 Standardize error printing a bit by moving it to the Error object and
descendants.
Review URL: http://codereview.chromium.org//9148048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3219 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-12 01:01:46 +00:00
turnidge@google.com 55e33151db Introduce the Error object class in the vm. It represents all of the
things that may go wrong while invoking the dart api.

Here are the four types of error:

- ApiError = the user misused one of the dart apis
- LanguageError = a language-level problem, e.g. compiler error
- UnhandledException = an uncaught exception made its way to the embedder
- UnwindError = a forced isolate interrupt

This cl is the first of a series. I plan to move the point of
creation for LanguageErrors into the Parser, etc. I also plan to move
the longjmp's out of dart_api_impl.cc. I also also plan to implement
UnwindErrors later.

(Copied from Issue 9085031 due to subversion problems)
Review URL: http://codereview.chromium.org//9166016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3168 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-10 21:42:21 +00:00
asiva@google.com 34a115ad57 - Pass in the isolate parameter when creating handles.
- Store the current isolate pointer in the snapshot reader object and use it instead of calling Isolate::Current() during the deserializing process.
Review URL: http://codereview.chromium.org//9124012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3160 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-10 18:47:38 +00:00
hausner@google.com 4ee7c947aa Getting value of local variables on stack trace
Introduce concept of scope in local variable info, according
to mirror proposal.
Review URL: http://codereview.chromium.org//8983034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3017 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-05 22:33:37 +00:00
asiva@google.com 59858f6e58 In CheckIsolate process only if we have any unfinalized classes.
Review URL: http://codereview.chromium.org//9027025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2798 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-23 00:46:00 +00:00
asiva@google.com 4d22fcc329 Refactor some of the snapshot writer classes to eliminate code duplication.
Review URL: http://codereview.chromium.org//9018002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2718 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-21 19:37:37 +00:00
cshapiro@google.com 9108ddb9a2 Do not use C++ const references in the C interface.
Review URL: http://codereview.chromium.org//9017018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2711 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-21 17:50:38 +00:00
asiva@google.com bde808f44b Changes to create an application snapshot which can be layered on top
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
2011-12-20 02:04:24 +00:00
cshapiro@google.com 32f55ce37b Implement weak persistent handles in the Dart API.
Review URL: http://codereview.chromium.org//8984006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2607 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-20 01:44:53 +00:00
turnidge@google.com 0b833d4977 Add support for interrupting an isolate in the vm. Interrupts are
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
2011-12-16 18:41:20 +00:00
turnidge@google.com 3b9026f21d If an unhandled exception occurs in Dart_RunLoop, pass it out to the caller.
Review URL: http://codereview.chromium.org//8918028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2438 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-14 18:27:58 +00:00
cshapiro@google.com aae8784962 Add an interface for retrieving the value of unsigned 64-bit integers.
With this change, IntegerValue is renamed to IntegerToInt64 for symmetry
with the new IntegerToUint64 interface.  Also uses of UInt64 have been
replaced with Uint64 for naming consistency.

Review URL: http://codereview.chromium.org//8585049

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2317 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-09 17:25:44 +00:00
cshapiro@google.com 59541fef4c Use specialized unwrapping methods for reading Double and Bool values.
Review URL: http://codereview.chromium.org//8888031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2292 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-08 23:50:40 +00:00
hausner@google.com 9159389495 First bits of external debugger API
The debugger API is in a separate set of files. Embedders do not have
to include the debug api if they don't need to.
Review URL: http://codereview.chromium.org//8826007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2198 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-07 22:13:49 +00:00
turnidge@google.com 36a830115b Use a preallocated StackOverflowException rather than allocating one
while our stack is hurting.  This allows us to get rid of the stack
tweaking which we do in this case.
Review URL: http://codereview.chromium.org//8823001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2149 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-06 23:01:46 +00:00
asiva@google.com 7ddd0f0b89 First step towards generation of application script snapshots
- 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
2011-12-06 00:34:49 +00:00
turnidge@google.com 1abf65b434 Add Dart_IsExternalString and Dart_ExternalStringGetPeer to the dart
embedding api.
Review URL: http://codereview.chromium.org//8775039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2080 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-05 17:55:01 +00:00
turnidge@google.com 5bae9d4020 Add some checking macros:
CHECK_ISOLATE -- make sure that there is a current isolate.
CHECK_NO_ISOLATE -- the opposite.
CHECK_ISOLATE_SCOPE -- make sure that there is a current isolate and it has an API scope.

DARTSCOPE changes to call CHECK_ISOLATE_SCOPE.  If you don't want
that, use DARTSCOPE_NOCHECKS.

Went through all of the DART_EXPORT function and made sure they all
had the appropriate checking.

Rewrite DARTSCOPE a bit to avoid evaluating the macro param multiple
times.
Review URL: http://codereview.chromium.org//8733011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1990 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 19:17:10 +00:00
turnidge@google.com bf548c4cca Add some ::'s to disambiguate calls for the win32 build.
Review URL: http://codereview.chromium.org//8773015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1989 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 18:59:23 +00:00
turnidge@google.com 7c2a96158e Stop using void* types in the dart embedding api.
Review URL: http://codereview.chromium.org//8761007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1988 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 18:18:06 +00:00
podivilov@google.com c692646f07 Introduce Dart_SetVMFlags API function.
It should be possible to set command line arguments without providing isolate init callback.

Review URL: http://codereview.chromium.org//8713012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1972 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 11:59:35 +00:00
asiva@google.com b53c955b37 - Refactor the isolate callback mechanism to also include creation of the
isolate, this enables creation of isolates using a snapshot
- remove source buffers of corelib, coreimpl-lib and builtin-lib from the binary
Review URL: http://codereview.chromium.org//8673002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1958 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 00:30:25 +00:00
hausner@google.com b7cf1328a1 Very first steps for a debugger
- Introduce Debugger class.
- Each isolate has a debugger object.
- Introduce stubs that can be put in place of static or dynamic
  Dart function calls.
- Very rudimentary command line option to place a breakpoint
  at the beginning of a function.
Review URL: http://codereview.chromium.org//8687037

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1928 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-30 17:04:45 +00:00
turnidge@google.com cf23dbad75 Add a mid-sized integration test for the Dart Embedding Api which
demonstrates how to create a custom isolate abstraction.  In this
test, we use an event queue to share a single thread among our custom
isolates.

Add a callback which allows embedders to see when a port is created.
Not sure if I should keep this or not.

New apis:
  Dart_CreatePort() -- allocates a port id and adds a port->isolate mapping.
  Dart_IsolateHasActivePorts() -- does the current isolate have open ports?
  (this name a bit awkward...)

Bail out of PortMap::ClosePorts() early if there are no open ports.
This suppresses calls to the close_port_callback when there are no
open ports.

Use DART_CHECK_VALID to provide better error output when the test lib
has errors.

-------------------------
Sample output of the test:

-- (isolate=0x815600) Constructing isolate
-- Enter: CustomIsolateImpl_start --
-- Adding port (7111) -> isolate (0x830800) --
-- Adding StartEvent to queue --
-- Exit: CustomIsolateImpl_start --
-- Adding port (7112) -> isolate (0x815600) --
-- Posting message dest(7111) reply(0) --
-- Adding MessageEvent to queue --
-- Starting event loop --
>> StartEvent with isolate(0x830800)--
-- (isolate=0x830800) Running isolateMain
$$ MessageEvent with dest port 7111--
-- (isolate=0x830800) Received: 42
-- Posting message dest(7112) reply(0) --
-- Adding MessageEvent to queue --
$$ MessageEvent with dest port 7112--
-- Closing port (7112) --
-- Adding ShutdownEvent to queue --
-- (isolate=0x815600) Received: 43
<< ShutdownEvent with isolate(0x815600)--
-- Finished event loop --
Review URL: http://codereview.chromium.org//8588040

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1906 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-29 21:55:13 +00:00
regis@google.com 5382e56f05 Optimize type checks of list and map literals.
Introduce an ast node for explicit 'assignable to' type checks.
Remove Instance::Is() helper.
Review URL: http://codereview.chromium.org//8678031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1827 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-24 00:26:18 +00:00
turnidge@google.com beebe26bf8 Reorder the functions in dart_api_impl.cc to match dart_api.h.
Review URL: http://codereview.chromium.org//8636021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1759 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-22 19:42:38 +00:00
asiva@google.com 245a288c29 Check for presence of native resolver in library for classes which have native fields only in regular run mode not while generating snapshots.
While generating snapshots the native resolver is not set and would trigger this error.
Review URL: http://codereview.chromium.org//8618011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1728 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-22 01:22:07 +00:00
asiva@google.com 777bbbf277 Fix signature for external string API methods.
Review URL: http://codereview.chromium.org//8527027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1716 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-21 19:47:32 +00:00
turnidge@google.com a31b5a59f7 Start using UNWRAP_NONNULL to check inputs to dart api functions.
Improve a few error messages.

Lots of testing.
Review URL: http://codereview.chromium.org//8528018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1712 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-21 19:09:51 +00:00
cshapiro@google.com 1cff31c3d0 Implement external strings.
External strings refer to character data in memory located outside of
the managed heap.  This memory is considered to be owned by the
embedding application.  To help with the management of external
memory, the virtual machine allows the embedding application to
register for a "death notice" when an external string object is
garbage collected.  A death notice takes the form of a callback
invoked by the garbage collector with the address of the external
memory.  Death notices will be implemented in the garbage collector by
future commit.

Review URL: http://codereview.chromium.org//8383029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1679 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-19 00:33:23 +00:00
asiva@google.com 5e6441a5cd Change loaded_ flag in RawLibrary to load_state_ in order to register different
states of the load process.
This state can then be used to ensure we report errors on duplicate loads.
Review URL: http://codereview.chromium.org//8520030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1643 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-18 00:09:13 +00:00
ager@google.com 7124c5046b Test for immutable Lists in ListSet API methods.
Using the file and socket API it was possible to modify immutable
arrays.

R=sgjesse@google.com,turnidge@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8575004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1604 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-17 06:57:39 +00:00
asiva@google.com ac82be41eb Report an error when Dart_ListGetAsBytes does not get an integer list.
Review URL: http://codereview.chromium.org//8523036

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1585 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-16 21:12:38 +00:00
asiva@google.com aaffbd2561 Support command line parameters to specify a url to file name mapping. This is used during snapshot generation so that a URL is mapped to a physical file name.
Review URL: http://codereview.chromium.org//8439061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1550 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-15 21:19:27 +00:00
asiva@google.com 5cf3ad018a Changes to pass the current isolate to all runtime and native calls.
Review URL: http://codereview.chromium.org//8528010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1499 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-12 05:55:22 +00:00
turnidge@google.com 8c64adf13e Deal with unhandled exceptions the same way in all Dart api functions.
--

Terminology change: invalid handles are now called error handles.

Unhandled exceptions used to be a kind of valid handle.  Now they are
a kind of error handle.

For the Dart_Invoke* functions, this means that the standard
error-checking blob drops from two tests to one test and is
harder to mess up.

Many other Dart api functions (Dart_ToString, for example) previously
dealt with unhandled exceptions by turning them into terse error
messages.  Now these functions preserve information about the
exceptions and generate better error messages.

Changed Dart_HandleMessage to return success/failure.  It seemed to fit.

--

Details:

Dart_IsValid becomes Dart_IsError (negated sense).

Dart_GetError now knows how to print a stack trace semi-nicely.

Dart_ExceptionOccurred -> Dart_IsUnhandledException.

Renamed ApiFailure class to ApiError to fit better.

ApiError now has a "data" pointer that points to either an error
message string or to an unhandled exception object.

Documentation changes aplenty.
Review URL: http://codereview.chromium.org//8501034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1470 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 19:31:04 +00:00