It is permitted to specify a start index equal to the array length
when the copy length is 0. This runs afoul of an assertion in
ByteAddr that validates 0 <= index < length. Consistent with other
methods to retrieve a raw element address, we now guard this call with
an implicit check for this boundary condition by ensuring length is
greater than zero.
In addition, some simple unit tests for ByteArray::Copy have been added.
BUG=1891
Review URL: https://chromiumcodereview.appspot.com//9560001
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4772 260f80e4-7a28-3924-810f-c04153c831b5
On standalone dartium which has about 50000 tokens in the libraries (core, coreimpl, builtin, io etc.) this reduces the heap size by about 180kb. The size of the standalone snapshot buffer reduces by about 72kb.
Also moved the keyword symbol table to the object store so that it does not have to repopulated on every script compilation. Should benefit regular user script load times.
Review URL: https://chromiumcodereview.appspot.com//9462003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4734 260f80e4-7a28-3924-810f-c04153c831b5
big global change, so let me explain in more detail. This refactoring CL does
the following:
- moves all the dart code for isolates in a common library (lib/isolate)
- changes frog to understand 'dart:isolate' imoprts by loading the code from the
location above.
- changes the vm to undernstand 'dart:isolate' imports by creating a separate
library that is part of the bootstrap. This follows the same code-structure
that Todd suggested in his CL introducing the mirror library
- changes dartc to use the shared isolate library as the source of truth for
type checking. I left around some of the internal js code in dartc so that the
backend continues to work for apps that don't use isolates.
- changes all tests that use isolates to import the library explicitly (this is a large bulk of the files in this CL)
- changes test status for tests we can't fix in this repo (e.g. co19)
- splits the isolate library code to make it possible to preserve some tests
without exposing internal types (e.g. tests about
serialization/deserialization)
- changes the create_sdk script to copy the isolate library to the sdk
- includes the isolate library in dartdoc
I'll wait for at least one lgtm from each area (dartc, vm, frog, sdk)
There is one important pending thing this CL doesn't do:
- update test_runner.dart: This should be updated next time we upload the new
binaries to tool/testing/bin
- dartium specific changes: Vijay, is there anything I need to do for dartium?
Review URL: https://chromiumcodereview.appspot.com//9422019
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4647 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
Adding a new kind of PcDescriptor to mark the location of
function returns in generated code. This will be needed to
put a single-step breakpoint just before the function return.
Also adding a NOP instruction after the ret, so that the
function return code pattern adds up to 5 bytes, which is needed
to patch in a breakpoint call.
Review URL: https://chromiumcodereview.appspot.com//9385022
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4159 260f80e4-7a28-3924-810f-c04153c831b5
rather than an array of String and simplify code accordingly.
Rename the field holding type parameter bounds of a class.
Note: I retract my earlier suggestion to Srdjan to represent interfaces of a
class (as well as its canonical types) as a TypeArguments. This would require
more code to check for an empty array and for growing the array. Besides, these
are really arrays and have nothing to do with type arguments. I removed the
corresponding TODO(srdjan).
Review URL: https://chromiumcodereview.appspot.com//9368032
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4096 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
The purpose of this change is twofold:
1. Source in the bin directory can now use the same assertions as
source in the vm directory. The ASSERT macro used by the code
in runtime/bin was just defined to use assert from the standard
C library.
2. Moving other implementation parts from runtime/vm to
runtime/platform (e.g. classes Monitor and Mutex) for sharing
between runtime/bin and runtime/vm will be easier as these
implementations rely on these assertion macros.
Created two gypi files for the platform directory. One for the
headers and one for the source. The source one is only included
when building the VM library and will be present in libdart.a
when the dart executable is linked.
All the code for asserts is still in the dart namespace.
Also re-arranged the order of includes to be alphabetically in
the files touched.
R=ager@google.com, iposva@google.com
BUG=
TEST=
Review URL: http://codereview.chromium.org//9189003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3335 260f80e4-7a28-3924-810f-c04153c831b5
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