Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: vm/object.h

Issue 11360114: - Add functionality to morph a string into an external string (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: vm/object.h
===================================================================
--- vm/object.h (revision 14589)
+++ vm/object.h (working copy)
@@ -300,6 +300,9 @@
static void InitFromSnapshot(Isolate* isolate);
static void InitOnce();
static void RegisterSingletonClassNames();
+ static void MakeUnusedSpaceTraversable(const Object& obj,
+ intptr_t original_size,
+ intptr_t used_size);
static intptr_t InstanceSize() {
return RoundedAllocationSize(sizeof(RawObject));
@@ -3726,6 +3729,17 @@
void ToUTF8(uint8_t* utf8_array, intptr_t array_len) const;
+ // Copies the string characters into the provided external array
+ // and morphs the string object into an external string object.
+ // The remaining unused part of the original string object is marked as
+ // an Array object or a regular Object so that it can be traversed during
+ // garbage collection.
+ RawString* MakeExternal(void* array,
+ intptr_t length,
+ void* peer,
+ Dart_PeerFinalizer cback) const;
+
+
// Creates a new String object from a C string that is assumed to contain
// UTF-8 encoded characters and '\0' is considered a termination character.
static RawString* New(const char* cstr, Heap::Space space = Heap::kNew);
@@ -4271,6 +4285,7 @@
HEAP_OBJECT_IMPLEMENTATION(Array, Instance);
friend class Class;
+ friend class String;
};

Powered by Google App Engine
This is Rietveld 408576698