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); |