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

Unified Diff: src/heap.h

Issue 11404: Add experimental support for external two-byte symbols.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 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
« no previous file with comments | « src/api.cc ('k') | src/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.h
===================================================================
--- src/heap.h (revision 766)
+++ src/heap.h (working copy)
@@ -356,10 +356,18 @@
// Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
// failed.
// Please note this function does not perform a garbage collection.
- static Object* AllocateSymbol(unibrow::CharacterStream* buffer,
- int chars,
- uint32_t length_field);
+ static inline Object* AllocateSymbol(Vector<const char> str,
+ int chars,
+ uint32_t length_field);
+ static Object* AllocateInternalSymbol(unibrow::CharacterStream* buffer,
+ int chars,
+ uint32_t length_field);
+
+ static Object* AllocateExternalSymbol(Vector<const char> str,
+ int chars);
+
+
// Allocates and partially initializes a String. There are two String
// encodings: ASCII and two byte. These functions allocate a string of the
// given length and set its map and length fields. The characters of the
@@ -527,6 +535,8 @@
ExternalAsciiString::Resource* resource);
static Object* AllocateExternalStringFromTwoByte(
ExternalTwoByteString::Resource* resource);
+ static Object* AllocateExternalSymbolFromTwoByte(
+ ExternalTwoByteString::Resource* resource);
// Allocates an uninitialized object. The memory is non-executable if the
// hardware and OS allow.
@@ -595,6 +605,10 @@
global_gc_epilogue_callback_ = callback;
}
+ static void SetExternalSymbolCallback(ExternalSymbolCallback callback) {
+ global_external_symbol_callback_ = callback;
+ }
+
// Heap roots
#define ROOT_ACCESSOR(type, name) static type* name() { return name##_; }
ROOT_LIST(ROOT_ACCESSOR)
@@ -854,6 +868,9 @@
static GCCallback global_gc_prologue_callback_;
static GCCallback global_gc_epilogue_callback_;
+ // Callback function used for allocating external symbols.
+ static ExternalSymbolCallback global_external_symbol_callback_;
+
// Checks whether a global GC is necessary
static GarbageCollector SelectGarbageCollector(AllocationSpace space);
« no previous file with comments | « src/api.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698