| Index: src/heap.h
|
| ===================================================================
|
| --- src/heap.h (revision 5365)
|
| +++ src/heap.h (working copy)
|
| @@ -31,6 +31,7 @@
|
| #include <math.h>
|
|
|
| #include "splay-tree-inl.h"
|
| +#include "utils.h"
|
| #include "v8-counters.h"
|
|
|
| namespace v8 {
|
| @@ -313,61 +314,62 @@
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateJSObject(JSFunction* constructor,
|
| - PretenureFlag pretenure = NOT_TENURED);
|
| + NOIGNORE static Object* AllocateJSObject(
|
| + JSFunction* constructor, PretenureFlag pretenure = NOT_TENURED);
|
|
|
| // Allocates and initializes a new global object based on a constructor.
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateGlobalObject(JSFunction* constructor);
|
| + NOIGNORE static Object* AllocateGlobalObject(JSFunction* constructor);
|
|
|
| // Returns a deep copy of the JavaScript object.
|
| // Properties and elements are copied too.
|
| // Returns failure if allocation failed.
|
| - static Object* CopyJSObject(JSObject* source);
|
| + NOIGNORE static Object* CopyJSObject(JSObject* source);
|
|
|
| // Allocates the function prototype.
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateFunctionPrototype(JSFunction* function);
|
| + NOIGNORE static Object* AllocateFunctionPrototype(JSFunction* function);
|
|
|
| // Reinitialize an JSGlobalProxy based on a constructor. The object
|
| // must have the same size as objects allocated using the
|
| // constructor. The object is reinitialized and behaves as an
|
| // object that has been freshly allocated using the constructor.
|
| - static Object* ReinitializeJSGlobalProxy(JSFunction* constructor,
|
| - JSGlobalProxy* global);
|
| + NOIGNORE static Object* ReinitializeJSGlobalProxy(JSFunction* constructor,
|
| + JSGlobalProxy* global);
|
|
|
| // Allocates and initializes a new JavaScript object based on a map.
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateJSObjectFromMap(Map* map,
|
| - PretenureFlag pretenure = NOT_TENURED);
|
| + NOIGNORE static Object* AllocateJSObjectFromMap(
|
| + Map* map, PretenureFlag pretenure = NOT_TENURED);
|
|
|
| // Allocates a heap object based on the map.
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this function does not perform a garbage collection.
|
| - static Object* Allocate(Map* map, AllocationSpace space);
|
| + NOIGNORE static Object* Allocate(Map* map, AllocationSpace space);
|
|
|
| // Allocates a JS Map in the heap.
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this function does not perform a garbage collection.
|
| - static Object* AllocateMap(InstanceType instance_type, int instance_size);
|
| + NOIGNORE static Object* AllocateMap(InstanceType instance_type,
|
| + int instance_size);
|
|
|
| // Allocates a partial map for bootstrapping.
|
| - static Object* AllocatePartialMap(InstanceType instance_type,
|
| - int instance_size);
|
| + NOIGNORE static Object* AllocatePartialMap(InstanceType instance_type,
|
| + int instance_size);
|
|
|
| // Allocate a map for the specified function
|
| - static Object* AllocateInitialMap(JSFunction* fun);
|
| + NOIGNORE static Object* AllocateInitialMap(JSFunction* fun);
|
|
|
| // Allocates an empty code cache.
|
| - static Object* AllocateCodeCache();
|
| + NOIGNORE static Object* AllocateCodeCache();
|
|
|
| // Clear the Instanceof cache (used when a prototype changes).
|
| static void ClearInstanceofCache() {
|
| @@ -392,13 +394,13 @@
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateStringFromAscii(
|
| + NOIGNORE static Object* AllocateStringFromAscii(
|
| Vector<const char> str,
|
| PretenureFlag pretenure = NOT_TENURED);
|
| - static Object* AllocateStringFromUtf8(
|
| + NOIGNORE static Object* AllocateStringFromUtf8(
|
| Vector<const char> str,
|
| PretenureFlag pretenure = NOT_TENURED);
|
| - static Object* AllocateStringFromTwoByte(
|
| + NOIGNORE static Object* AllocateStringFromTwoByte(
|
| Vector<const uc16> str,
|
| PretenureFlag pretenure = NOT_TENURED);
|
|
|
| @@ -406,16 +408,15 @@
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this function does not perform a garbage collection.
|
| - static inline Object* AllocateSymbol(Vector<const char> str,
|
| - int chars,
|
| - uint32_t hash_field);
|
| + NOIGNORE static inline Object* AllocateSymbol(Vector<const char> str,
|
| + int chars,
|
| + uint32_t hash_field);
|
|
|
| - static Object* AllocateInternalSymbol(unibrow::CharacterStream* buffer,
|
| - int chars,
|
| - uint32_t hash_field);
|
| + NOIGNORE static Object* AllocateInternalSymbol(
|
| + unibrow::CharacterStream* buffer, int chars, uint32_t hash_field);
|
|
|
| - static Object* AllocateExternalSymbol(Vector<const char> str,
|
| - int chars);
|
| + NOIGNORE static Object* AllocateExternalSymbol(Vector<const char> str,
|
| + int chars);
|
|
|
|
|
| // Allocates and partially initializes a String. There are two String
|
| @@ -425,10 +426,10 @@
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateRawAsciiString(
|
| + NOIGNORE static Object* AllocateRawAsciiString(
|
| int length,
|
| PretenureFlag pretenure = NOT_TENURED);
|
| - static Object* AllocateRawTwoByteString(
|
| + NOIGNORE static Object* AllocateRawTwoByteString(
|
| int length,
|
| PretenureFlag pretenure = NOT_TENURED);
|
|
|
| @@ -436,97 +437,100 @@
|
| // A cache is used for ascii codes.
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed. Please note this does not perform a garbage collection.
|
| - static Object* LookupSingleCharacterStringFromCode(uint16_t code);
|
| + NOIGNORE static Object* LookupSingleCharacterStringFromCode(uint16_t code);
|
|
|
| // Allocate a byte array of the specified length
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateByteArray(int length, PretenureFlag pretenure);
|
| + NOIGNORE static Object* AllocateByteArray(int length,
|
| + PretenureFlag pretenure);
|
|
|
| // Allocate a non-tenured byte array of the specified length
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateByteArray(int length);
|
| + NOIGNORE static Object* AllocateByteArray(int length);
|
|
|
| // Allocate a pixel array of the specified length
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocatePixelArray(int length,
|
| - uint8_t* external_pointer,
|
| - PretenureFlag pretenure);
|
| + NOIGNORE static Object* AllocatePixelArray(int length,
|
| + uint8_t* external_pointer,
|
| + PretenureFlag pretenure);
|
|
|
| // Allocates an external array of the specified length and type.
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateExternalArray(int length,
|
| - ExternalArrayType array_type,
|
| - void* external_pointer,
|
| - PretenureFlag pretenure);
|
| + NOIGNORE static Object* AllocateExternalArray(int length,
|
| + ExternalArrayType array_type,
|
| + void* external_pointer,
|
| + PretenureFlag pretenure);
|
|
|
| // Allocate a tenured JS global property cell.
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateJSGlobalPropertyCell(Object* value);
|
| + NOIGNORE static Object* AllocateJSGlobalPropertyCell(Object* value);
|
|
|
| // Allocates a fixed array initialized with undefined values
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateFixedArray(int length, PretenureFlag pretenure);
|
| + NOIGNORE static Object* AllocateFixedArray(int length,
|
| + PretenureFlag pretenure);
|
| // Allocates a fixed array initialized with undefined values
|
| - static Object* AllocateFixedArray(int length);
|
| + NOIGNORE static Object* AllocateFixedArray(int length);
|
|
|
| // Allocates an uninitialized fixed array. It must be filled by the caller.
|
| //
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateUninitializedFixedArray(int length);
|
| + NOIGNORE static Object* AllocateUninitializedFixedArray(int length);
|
|
|
| // Make a copy of src and return it. Returns
|
| // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed.
|
| - static Object* CopyFixedArray(FixedArray* src);
|
| + NOIGNORE static Object* CopyFixedArray(FixedArray* src);
|
|
|
| // Allocates a fixed array initialized with the hole values.
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateFixedArrayWithHoles(
|
| + NOIGNORE static Object* AllocateFixedArrayWithHoles(
|
| int length,
|
| PretenureFlag pretenure = NOT_TENURED);
|
|
|
| // AllocateHashTable is identical to AllocateFixedArray except
|
| // that the resulting object has hash_table_map as map.
|
| - static Object* AllocateHashTable(int length,
|
| - PretenureFlag pretenure = NOT_TENURED);
|
| + NOIGNORE static Object* AllocateHashTable(
|
| + int length, PretenureFlag pretenure = NOT_TENURED);
|
|
|
| // Allocate a global (but otherwise uninitialized) context.
|
| - static Object* AllocateGlobalContext();
|
| + NOIGNORE static Object* AllocateGlobalContext();
|
|
|
| // Allocate a function context.
|
| - static Object* AllocateFunctionContext(int length, JSFunction* closure);
|
| + NOIGNORE static Object* AllocateFunctionContext(int length,
|
| + JSFunction* closure);
|
|
|
| // Allocate a 'with' context.
|
| - static Object* AllocateWithContext(Context* previous,
|
| - JSObject* extension,
|
| - bool is_catch_context);
|
| + NOIGNORE static Object* AllocateWithContext(Context* previous,
|
| + JSObject* extension,
|
| + bool is_catch_context);
|
|
|
| // Allocates a new utility object in the old generation.
|
| - static Object* AllocateStruct(InstanceType type);
|
| + NOIGNORE static Object* AllocateStruct(InstanceType type);
|
|
|
| // Allocates a function initialized with a shared part.
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateFunction(Map* function_map,
|
| - SharedFunctionInfo* shared,
|
| - Object* prototype,
|
| - PretenureFlag pretenure = TENURED);
|
| + NOIGNORE static Object* AllocateFunction(Map* function_map,
|
| + SharedFunctionInfo* shared,
|
| + Object* prototype,
|
| + PretenureFlag pretenure = TENURED);
|
|
|
| // Indicies for direct access into argument objects.
|
| static const int kArgumentsObjectSize =
|
| @@ -538,47 +542,49 @@
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateArgumentsObject(Object* callee, int length);
|
| + NOIGNORE static Object* AllocateArgumentsObject(Object* callee, int length);
|
|
|
| // Same as NewNumberFromDouble, but may return a preallocated/immutable
|
| // number object (e.g., minus_zero_value_, nan_value_)
|
| - static Object* NumberFromDouble(double value,
|
| - PretenureFlag pretenure = NOT_TENURED);
|
| + NOIGNORE static Object* NumberFromDouble(
|
| + double value, PretenureFlag pretenure = NOT_TENURED);
|
|
|
| // Allocated a HeapNumber from value.
|
| - static Object* AllocateHeapNumber(double value, PretenureFlag pretenure);
|
| - static Object* AllocateHeapNumber(double value); // pretenure = NOT_TENURED
|
| + NOIGNORE static Object* AllocateHeapNumber(double value,
|
| + PretenureFlag pretenure);
|
| + // pretenure = NOT_TENURED.
|
| + NOIGNORE static Object* AllocateHeapNumber(double value);
|
|
|
| // Converts an int into either a Smi or a HeapNumber object.
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static inline Object* NumberFromInt32(int32_t value);
|
| + NOIGNORE static inline Object* NumberFromInt32(int32_t value);
|
|
|
| // Converts an int into either a Smi or a HeapNumber object.
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static inline Object* NumberFromUint32(uint32_t value);
|
| + NOIGNORE static inline Object* NumberFromUint32(uint32_t value);
|
|
|
| // Allocates a new proxy object.
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateProxy(Address proxy,
|
| - PretenureFlag pretenure = NOT_TENURED);
|
| + NOIGNORE static Object* AllocateProxy(Address proxy,
|
| + PretenureFlag pretenure = NOT_TENURED);
|
|
|
| // Allocates a new SharedFunctionInfo object.
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateSharedFunctionInfo(Object* name);
|
| + NOIGNORE static Object* AllocateSharedFunctionInfo(Object* name);
|
|
|
| // Allocates a new cons string object.
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateConsString(String* first, String* second);
|
| + NOIGNORE static Object* AllocateConsString(String* first, String* second);
|
|
|
| // Allocates a new sub string object which is a substring of an underlying
|
| // string buffer stretching from the index start (inclusive) to the index
|
| @@ -586,19 +592,20 @@
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateSubString(String* buffer,
|
| - int start,
|
| - int end,
|
| - PretenureFlag pretenure = NOT_TENURED);
|
| + NOIGNORE static Object* AllocateSubString(
|
| + String* buffer,
|
| + int start,
|
| + int end,
|
| + PretenureFlag pretenure = NOT_TENURED);
|
|
|
| // Allocate a new external string object, which is backed by a string
|
| // resource that resides outside the V8 heap.
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this does not perform a garbage collection.
|
| - static Object* AllocateExternalStringFromAscii(
|
| + NOIGNORE static Object* AllocateExternalStringFromAscii(
|
| ExternalAsciiString::Resource* resource);
|
| - static Object* AllocateExternalStringFromTwoByte(
|
| + NOIGNORE static Object* AllocateExternalStringFromTwoByte(
|
| ExternalTwoByteString::Resource* resource);
|
|
|
| // Finalizes an external string by deleting the associated external
|
| @@ -610,9 +617,9 @@
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this function does not perform a garbage collection.
|
| - static inline Object* AllocateRaw(int size_in_bytes,
|
| - AllocationSpace space,
|
| - AllocationSpace retry_space);
|
| + NOIGNORE static inline Object* AllocateRaw(int size_in_bytes,
|
| + AllocationSpace space,
|
| + AllocationSpace retry_space);
|
|
|
| // Initialize a filler object to keep the ability to iterate over the heap
|
| // when shortening objects.
|
| @@ -624,26 +631,26 @@
|
| // self_reference. This allows generated code to reference its own Code
|
| // object by containing this pointer.
|
| // Please note this function does not perform a garbage collection.
|
| - static Object* CreateCode(const CodeDesc& desc,
|
| - Code::Flags flags,
|
| - Handle<Object> self_reference);
|
| + NOIGNORE static Object* CreateCode(const CodeDesc& desc,
|
| + Code::Flags flags,
|
| + Handle<Object> self_reference);
|
|
|
| - static Object* CopyCode(Code* code);
|
| + NOIGNORE static Object* CopyCode(Code* code);
|
|
|
| // Copy the code and scope info part of the code object, but insert
|
| // the provided data as the relocation information.
|
| - static Object* CopyCode(Code* code, Vector<byte> reloc_info);
|
| + NOIGNORE static Object* CopyCode(Code* code, Vector<byte> reloc_info);
|
|
|
| // Finds the symbol for string in the symbol table.
|
| // If not found, a new symbol is added to the table and returned.
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if allocation
|
| // failed.
|
| // Please note this function does not perform a garbage collection.
|
| - static Object* LookupSymbol(Vector<const char> str);
|
| - static Object* LookupAsciiSymbol(const char* str) {
|
| + NOIGNORE static Object* LookupSymbol(Vector<const char> str);
|
| + NOIGNORE static Object* LookupAsciiSymbol(const char* str) {
|
| return LookupSymbol(CStrVector(str));
|
| }
|
| - static Object* LookupSymbol(String* str);
|
| + NOIGNORE static Object* LookupSymbol(String* str);
|
| static bool LookupSymbolIfExists(String* str, String** symbol);
|
| static bool LookupTwoCharsSymbolIfExists(String* str, String** symbol);
|
|
|
| @@ -658,7 +665,7 @@
|
| // string might stay non-flat even when not a failure is returned.
|
| //
|
| // Please note this function does not perform a garbage collection.
|
| - static inline Object* PrepareForCompare(String* str);
|
| + NOIGNORE static inline Object* PrepareForCompare(String* str);
|
|
|
| // Converts the given boolean condition to JavaScript boolean value.
|
| static Object* ToBoolean(bool condition) {
|
| @@ -857,8 +864,8 @@
|
| // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
|
| // failed.
|
| // Please note this function does not perform a garbage collection.
|
| - static Object* CreateSymbol(const char* str, int length, int hash);
|
| - static Object* CreateSymbol(String* str);
|
| + NOIGNORE static Object* CreateSymbol(const char* str, int length, int hash);
|
| + NOIGNORE static Object* CreateSymbol(String* str);
|
|
|
| // Write barrier support for address[offset] = o.
|
| static inline void RecordWrite(Address address, int offset);
|
| @@ -930,9 +937,9 @@
|
| static inline int AdjustAmountOfExternalAllocatedMemory(int change_in_bytes);
|
|
|
| // Allocate uninitialized fixed array.
|
| - static Object* AllocateRawFixedArray(int length);
|
| - static Object* AllocateRawFixedArray(int length,
|
| - PretenureFlag pretenure);
|
| + NOIGNORE static Object* AllocateRawFixedArray(int length);
|
| + NOIGNORE static Object* AllocateRawFixedArray(int length,
|
| + PretenureFlag pretenure);
|
|
|
| // True if we have reached the allocation limit in the old generation that
|
| // should force the next GC (caused normally) to be a full one.
|
| @@ -975,8 +982,8 @@
|
| kRootListLength
|
| };
|
|
|
| - static Object* NumberToString(Object* number,
|
| - bool check_number_string_cache = true);
|
| + NOIGNORE static Object* NumberToString(Object* number,
|
| + bool check_number_string_cache = true);
|
|
|
| static Map* MapForExternalArrayType(ExternalArrayType array_type);
|
| static RootListIndex RootIndexForExternalArrayType(
|
| @@ -1183,10 +1190,10 @@
|
| // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't
|
| // have to test the allocation space argument and (b) can reduce code size
|
| // (since both AllocateRaw and AllocateRawMap are inlined).
|
| - static inline Object* AllocateRawMap();
|
| + NOIGNORE static inline Object* AllocateRawMap();
|
|
|
| // Allocate an uninitialized object in the global property cell space.
|
| - static inline Object* AllocateRawCell();
|
| + NOIGNORE static inline Object* AllocateRawCell();
|
|
|
| // Initializes a JSObject based on its map.
|
| static void InitializeJSObjectFromMap(JSObject* obj,
|
| @@ -1248,9 +1255,9 @@
|
| // other parts of the VM could use it. Specifically, a function that creates
|
| // instances of type JS_FUNCTION_TYPE benefit from the use of this function.
|
| // Please note this does not perform a garbage collection.
|
| - static inline Object* InitializeFunction(JSFunction* function,
|
| - SharedFunctionInfo* shared,
|
| - Object* prototype);
|
| + NOIGNORE static inline Object* InitializeFunction(JSFunction* function,
|
| + SharedFunctionInfo* shared,
|
| + Object* prototype);
|
|
|
| static GCTracer* tracer_;
|
|
|
| @@ -1863,7 +1870,7 @@
|
|
|
| // Returns a heap number with f(input), where f is a math function specified
|
| // by the 'type' argument.
|
| - static inline Object* Get(Type type, double input) {
|
| + NOIGNORE static inline Object* Get(Type type, double input) {
|
| TranscendentalCache* cache = caches_[type];
|
| if (cache == NULL) {
|
| caches_[type] = cache = new TranscendentalCache(type);
|
| @@ -1876,7 +1883,7 @@
|
| static void Clear();
|
|
|
| private:
|
| - inline Object* Get(double input) {
|
| + NOIGNORE inline Object* Get(double input) {
|
| Converter c;
|
| c.dbl = input;
|
| int hash = Hash(c);
|
|
|