need for an 'extern "C"' declaration in raw_object.h, which broke
the Windows builds. Instead, a peer() method is added to the
RawExternalString*Object classes, and RawObject::ToAddr() is used
to fetch the address of these raw instances. This avoids the need
for Dart_ExternalStringGetPeer needing friend access to those classes.
Review URL: https://chromiumcodereview.appspot.com//10891036
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11540 260f80e4-7a28-3924-810f-c04153c831b5
Dart_ExternalStringGetPeer. This change is basically an unrolling
of the templates that previously defined the method, to reduce
the number of handles allocated.
This change is supported by the DartStringAccess VM benchmark, which
showed a ~20x improvement from the above change. Currently this
benchmark focuses on Dart_ExternalStringGetPeer, rather than String
performance in general.
Please review this carefully. Commented-out is a "NoGCScope no_gc_scope;"
line, which when enabled asserts that GC doesn't happen when this function
is called. However, one of the tests fails this check, though when I
set a breakpoint in gdb before the NoGCScope item is allocated, it's not
hit before the assertion fails. I commented out that line, in the hope
that more senior reviewers suggest improvements.
Review URL: https://chromiumcodereview.appspot.com//10897014
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11534 260f80e4-7a28-3924-810f-c04153c831b5
This is a request for comments. Do we want to expose library
prefixes like this? Is there a way to import with a prefix already
and lookup members?
The reason why I would like to do this is so that I can import the
user-supplied builtins library under a prefix. This will be a useful
first step to move the print function to corelib while preserving
the ability to patch in a print implementation via the builtins
library.
R=iposva@google.com,turnidge@google.com
BUG=
Review URL: https://chromiumcodereview.appspot.com//10867032
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11494 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
Remove all optimized code whenever we load scripts/libraries/snapshots. Currently this occurs only when no Dart frame is live on stack. Future change (deoptimization) will allow dynamic class loading in presence of live Dart frames.
The cost of removing all optimized code is supposed to be low. If that assumptions turns out to be false I can add more elaborate tracking of optimized functions.
Review URL: https://chromiumcodereview.appspot.com//10825483
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11106 260f80e4-7a28-3924-810f-c04153c831b5
Instead of passing a size in bytes to the allocation function, we now
have a templatized Alloc function:
zone->Alloc<Type>(len)
This is better for security, as we can check for integer overflow in
the size computation before performing the allocation. Before, we
often failed to check this.
Review URL: https://chromiumcodereview.appspot.com//10836061
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10254 260f80e4-7a28-3924-810f-c04153c831b5
avoid overflow.
For each variable size heap object, compute the maximum number of
elements and use that in the ::New functions to avoid overflow. If a
bad length/size reaches a ::New function, that is a FATAL error -- the
problem should have been caught earlier by the dart api or by the
library code.
Add "border guards" in the dart api and in library calls which cause
new variable size heap objects to be allocated. We check for invalid
length/size and throw explanatory error messages.
Review URL: https://chromiumcodereview.appspot.com//10782016
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10130 260f80e4-7a28-3924-810f-c04153c831b5
This profiler will write binary HPROF data to a user provided stream that
can later be viewed by tools such as the Eclipse Memory Analyzer.
While all user defined types are accurately described in the profile data,
internal types that are not self-describing appear as empty objects. This
will be addressed by a future change.
Review URL: https://chromiumcodereview.appspot.com//10452006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8636 260f80e4-7a28-3924-810f-c04153c831b5
Implement a few chunks of new mirror functionality. Many changes, notably:
- Added currentIsolateMirror() to provide non-async access to the
local isolate mirror.
- Added mirrorOf(o) to provide access to local instance mirrors.
- Fleshed out InstanceMirror, InterfaceMirror, and LibraryMirror to
various degrees.
- Added the MirroredError hierarchy, which lets the user handle Dart
errors of various sorts from invocation, etc.
- Introduce lazy resolvers for interface mirrors and library mirrors.
These allow us to build the self-referential library/interface
hierarchy without going mad.
- Added better toStrings all around.
- Extended the isolate_mirror_local_test to cover new functionality.
Other changes that were required or seemed prudent:
- Exposed the error hierarchy to the embedder. They need to be able
to distinguish different error types in some situations. Improved
the documetation around error handles and error propagation.
- Added new functions to the dart embedding api as required. Added
tests for all new dart api functions.
Review URL: https://chromiumcodereview.appspot.com//10538043
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8575 260f80e4-7a28-3924-810f-c04153c831b5
- Single step now steps to a safe point on the next line.
- Step into no longer steps into library code.
- Each library has a flag that specifies whether one
can step into its code.
Later I will add an API to set the per-library flag. Currently
it's set to true for the top-level library and to false for
all other libraries.
Review URL: https://chromiumcodereview.appspot.com//10442088
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8173 260f80e4-7a28-3924-810f-c04153c831b5
replace it with the beginnings of a local (same isolate) IsolateMirror
implementation.
Removed old mirror tests and added two new mirror tests.
Even though mirrors.cc is part of the vm, I chose to implement most of
it using the dart embedding interface instead of our internal
interfaces because the embedding interface was more convenient.
mirrors.cc is basically all new in this CL -- don't pay any attention
to diffs for that file.
Added dart embedding functions required for the functionality in this
CL: Dart_DebugName, Dart_GetNativeInstanceFieldCount,
Dart_RootLibrary, Dart_RegisteredLibraryUrls, and Dart_LibraryName.
Extended or modified some existing dart api functions, primarily to
make them propagate error handles properly.
Added tests for new dart embedding api functionality.
Added the ability to determine if a port is local to the current isolate.
Extended NotImplementedException to accept an optional string
argument. I wanted to give more descriptive error messages.
Review URL: https://chromiumcodereview.appspot.com//10416050
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8117 260f80e4-7a28-3924-810f-c04153c831b5
Specifically, when some interface "I" declares a default class "C",
that class "C" may either implement or not implement "I". It turns
out that the name lookup is supposed to be different in these two
cases. Before I only handled one of these cases correctly.
Also, it turns out I was passing bogus parameters to factory constructors.
I was supposed to pass type arguments, but instead I was passing the
wrong thing. Fixed this.
This should fix issue 2971.
Review URL: https://chromiumcodereview.appspot.com//10441034
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8072 260f80e4-7a28-3924-810f-c04153c831b5