| Index: src/heap.cc
|
| ===================================================================
|
| --- src/heap.cc (revision 5190)
|
| +++ src/heap.cc (working copy)
|
| @@ -46,12 +46,6 @@
|
| #include "arm/regexp-macro-assembler-arm.h"
|
| #endif
|
|
|
| -// Since we're converting Heap over in stages, this file is in a strange state
|
| -// with regard to static/nonstatic methods. THIS refers to this in a
|
| -// method that will eventually become non-static. HEAP should be used in
|
| -// methods that will remain static.
|
| -#define THIS HEAP
|
| -
|
| namespace v8 {
|
| namespace internal {
|
|
|
| @@ -362,9 +356,9 @@
|
| isolate_->counters()->alive_after_last_gc()->Set(SizeOfObjects());
|
|
|
| isolate_->counters()->symbol_table_capacity()->Set(
|
| - THIS->symbol_table()->Capacity());
|
| + symbol_table()->Capacity());
|
| isolate_->counters()->number_of_symbols()->Set(
|
| - THIS->symbol_table()->NumberOfElements());
|
| + symbol_table()->NumberOfElements());
|
| #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING)
|
| ReportStatisticsAfterGC();
|
| #endif
|
| @@ -755,7 +749,7 @@
|
|
|
| CompletelyClearInstanceofCache();
|
|
|
| - if (is_compacting) THIS->FlushNumberStringCache();
|
| + if (is_compacting) FlushNumberStringCache();
|
| }
|
|
|
|
|
| @@ -1363,7 +1357,7 @@
|
| if (result->IsFailure()) return result;
|
|
|
| // Map::cast cannot be used due to uninitialized map field.
|
| - reinterpret_cast<Map*>(result)->set_map(THIS->raw_unchecked_meta_map());
|
| + reinterpret_cast<Map*>(result)->set_map(raw_unchecked_meta_map());
|
| reinterpret_cast<Map*>(result)->set_instance_type(instance_type);
|
| reinterpret_cast<Map*>(result)->set_instance_size(instance_size);
|
| reinterpret_cast<Map*>(result)->
|
| @@ -1382,7 +1376,7 @@
|
| if (result->IsFailure()) return result;
|
|
|
| Map* map = reinterpret_cast<Map*>(result);
|
| - map->set_map(THIS->meta_map());
|
| + map->set_map(meta_map());
|
| map->set_instance_type(instance_type);
|
| map->set_scavenger(GetScavenger(instance_type, instance_size));
|
| map->set_prototype(null_value());
|
| @@ -1390,8 +1384,8 @@
|
| map->set_instance_size(instance_size);
|
| map->set_inobject_properties(0);
|
| map->set_pre_allocated_property_fields(0);
|
| - map->set_instance_descriptors(THIS->empty_descriptor_array());
|
| - map->set_code_cache(THIS->empty_fixed_array());
|
| + map->set_instance_descriptors(empty_descriptor_array());
|
| + map->set_code_cache(empty_fixed_array());
|
| map->set_unused_property_fields(0);
|
| map->set_bit_field(0);
|
| map->set_bit_field2((1 << Map::kIsExtensible) | (1 << Map::kHasFastElements));
|
| @@ -1410,8 +1404,8 @@
|
| Object* result = AllocateStruct(CODE_CACHE_TYPE);
|
| if (result->IsFailure()) return result;
|
| CodeCache* code_cache = CodeCache::cast(result);
|
| - code_cache->set_default_cache(THIS->empty_fixed_array());
|
| - code_cache->set_normal_type_cache(THIS->undefined_value());
|
| + code_cache->set_default_cache(empty_fixed_array());
|
| + code_cache->set_normal_type_cache(undefined_value());
|
| return code_cache;
|
| }
|
|
|
| @@ -1464,6 +1458,7 @@
|
| obj = Allocate(oddball_map(), OLD_DATA_SPACE);
|
| if (obj->IsFailure()) return false;
|
| set_null_value(obj);
|
| + Oddball::cast(obj)->set_kind(Oddball::kNull);
|
|
|
| // Allocate the empty descriptor array.
|
| obj = AllocateEmptyFixedArray();
|
| @@ -1617,7 +1612,7 @@
|
| Object* result = AllocateRaw(HeapNumber::kSize, space, OLD_DATA_SPACE);
|
| if (result->IsFailure()) return result;
|
|
|
| - HeapObject::cast(result)->set_map(THIS->heap_number_map());
|
| + HeapObject::cast(result)->set_map(heap_number_map());
|
| HeapNumber::cast(result)->set_value(value);
|
| return result;
|
| }
|
| @@ -1633,7 +1628,7 @@
|
| ASSERT(allocation_allowed_ && gc_state_ == NOT_IN_GC);
|
| Object* result = new_space_.AllocateRaw(HeapNumber::kSize);
|
| if (result->IsFailure()) return result;
|
| - HeapObject::cast(result)->set_map(THIS->heap_number_map());
|
| + HeapObject::cast(result)->set_map(heap_number_map());
|
| HeapNumber::cast(result)->set_value(value);
|
| return result;
|
| }
|
| @@ -1642,17 +1637,18 @@
|
| Object* Heap::AllocateJSGlobalPropertyCell(Object* value) {
|
| Object* result = AllocateRawCell();
|
| if (result->IsFailure()) return result;
|
| - HeapObject::cast(result)->set_map(THIS->global_property_cell_map());
|
| + HeapObject::cast(result)->set_map(global_property_cell_map());
|
| JSGlobalPropertyCell::cast(result)->set_value(value);
|
| return result;
|
| }
|
|
|
|
|
| Object* Heap::CreateOddball(const char* to_string,
|
| - Object* to_number) {
|
| + Object* to_number,
|
| + byte kind) {
|
| Object* result = Allocate(oddball_map(), OLD_DATA_SPACE);
|
| if (result->IsFailure()) return result;
|
| - return Oddball::cast(result)->Initialize(to_string, to_number);
|
| + return Oddball::cast(result)->Initialize(to_string, to_number, kind);
|
| }
|
|
|
|
|
| @@ -1663,7 +1659,7 @@
|
| if (obj->IsFailure()) return false;
|
| set_neander_map(Map::cast(obj));
|
|
|
| - obj = AllocateJSObjectFromMap(THIS->neander_map());
|
| + obj = AllocateJSObjectFromMap(neander_map());
|
| if (obj->IsFailure()) return false;
|
| Object* elements = AllocateFixedArray(2);
|
| if (elements->IsFailure()) return false;
|
| @@ -1740,6 +1736,7 @@
|
| obj = Allocate(oddball_map(), OLD_DATA_SPACE);
|
| if (obj->IsFailure()) return false;
|
| set_undefined_value(obj);
|
| + Oddball::cast(obj)->set_kind(Oddball::kUndefined);
|
| ASSERT(!InNewSpace(undefined_value()));
|
|
|
| // Allocate initial symbol table.
|
| @@ -1755,26 +1752,32 @@
|
| Oddball::cast(undefined_value())->set_to_number(nan_value());
|
|
|
| // Allocate the null_value
|
| - obj = Oddball::cast(null_value())->Initialize("null", Smi::FromInt(0));
|
| + obj = Oddball::cast(null_value())->Initialize("null",
|
| + Smi::FromInt(0),
|
| + Oddball::kNull);
|
| if (obj->IsFailure()) return false;
|
|
|
| - obj = CreateOddball("true", Smi::FromInt(1));
|
| + obj = CreateOddball("true", Smi::FromInt(1), Oddball::kTrue);
|
| if (obj->IsFailure()) return false;
|
| set_true_value(obj);
|
|
|
| - obj = CreateOddball("false", Smi::FromInt(0));
|
| + obj = CreateOddball("false", Smi::FromInt(0), Oddball::kFalse);
|
| if (obj->IsFailure()) return false;
|
| set_false_value(obj);
|
|
|
| - obj = CreateOddball("hole", Smi::FromInt(-1));
|
| + obj = CreateOddball("hole", Smi::FromInt(-1), Oddball::kTheHole);
|
| if (obj->IsFailure()) return false;
|
| set_the_hole_value(obj);
|
|
|
| - obj = CreateOddball("no_interceptor_result_sentinel", Smi::FromInt(-2));
|
| + obj = CreateOddball("no_interceptor_result_sentinel",
|
| + Smi::FromInt(-2),
|
| + Oddball::kOther);
|
| if (obj->IsFailure()) return false;
|
| set_no_interceptor_result_sentinel(obj);
|
|
|
| - obj = CreateOddball("termination_exception", Smi::FromInt(-3));
|
| + obj = CreateOddball("termination_exception",
|
| + Smi::FromInt(-3),
|
| + Oddball::kOther);
|
| if (obj->IsFailure()) return false;
|
| set_termination_exception(obj);
|
|
|
| @@ -1867,9 +1870,9 @@
|
|
|
| void Heap::FlushNumberStringCache() {
|
| // Flush the number to string cache.
|
| - int len = THIS->number_string_cache()->length();
|
| + int len = number_string_cache()->length();
|
| for (int i = 0; i < len; i++) {
|
| - THIS->number_string_cache()->set_undefined(i);
|
| + number_string_cache()->set_undefined(i);
|
| }
|
| }
|
|
|
| @@ -1887,35 +1890,35 @@
|
|
|
| Object* Heap::GetNumberStringCache(Object* number) {
|
| int hash;
|
| - int mask = (THIS->number_string_cache()->length() >> 1) - 1;
|
| + int mask = (number_string_cache()->length() >> 1) - 1;
|
| if (number->IsSmi()) {
|
| hash = smi_get_hash(Smi::cast(number)) & mask;
|
| } else {
|
| hash = double_get_hash(number->Number()) & mask;
|
| }
|
| - Object* key = THIS->number_string_cache()->get(hash * 2);
|
| + Object* key = number_string_cache()->get(hash * 2);
|
| if (key == number) {
|
| - return String::cast(THIS->number_string_cache()->get(hash * 2 + 1));
|
| + return String::cast(number_string_cache()->get(hash * 2 + 1));
|
| } else if (key->IsHeapNumber() &&
|
| number->IsHeapNumber() &&
|
| key->Number() == number->Number()) {
|
| - return String::cast(THIS->number_string_cache()->get(hash * 2 + 1));
|
| + return String::cast(number_string_cache()->get(hash * 2 + 1));
|
| }
|
| - return THIS->undefined_value();
|
| + return undefined_value();
|
| }
|
|
|
|
|
| void Heap::SetNumberStringCache(Object* number, String* string) {
|
| int hash;
|
| - int mask = (THIS->number_string_cache()->length() >> 1) - 1;
|
| + int mask = (number_string_cache()->length() >> 1) - 1;
|
| if (number->IsSmi()) {
|
| hash = smi_get_hash(Smi::cast(number)) & mask;
|
| - THIS->number_string_cache()->set(hash * 2, Smi::cast(number));
|
| + number_string_cache()->set(hash * 2, Smi::cast(number));
|
| } else {
|
| hash = double_get_hash(number->Number()) & mask;
|
| - THIS->number_string_cache()->set(hash * 2, number);
|
| + number_string_cache()->set(hash * 2, number);
|
| }
|
| - THIS->number_string_cache()->set(hash * 2 + 1, string);
|
| + number_string_cache()->set(hash * 2 + 1, string);
|
| }
|
|
|
|
|
| @@ -1923,7 +1926,7 @@
|
| isolate_->counters()->number_to_string_runtime()->Increment();
|
| if (check_number_string_cache) {
|
| Object* cached = GetNumberStringCache(number);
|
| - if (cached != THIS->undefined_value()) {
|
| + if (cached != undefined_value()) {
|
| return cached;
|
| }
|
| }
|
| @@ -2000,7 +2003,7 @@
|
| // Statically ensure that it is safe to allocate proxies in paged spaces.
|
| STATIC_ASSERT(Proxy::kSize <= Page::kMaxHeapObjectSize);
|
| AllocationSpace space = (pretenure == TENURED) ? OLD_DATA_SPACE : NEW_SPACE;
|
| - Object* result = Allocate(THIS->proxy_map(), space);
|
| + Object* result = Allocate(proxy_map(), space);
|
| if (result->IsFailure()) return result;
|
|
|
| Proxy::cast(result)->set_proxy(proxy);
|
| @@ -2009,7 +2012,7 @@
|
|
|
|
|
| Object* Heap::AllocateSharedFunctionInfo(Object* name) {
|
| - Object* result = Allocate(THIS->shared_function_info_map(),
|
| + Object* result = Allocate(shared_function_info_map(),
|
| OLD_POINTER_SPACE);
|
| if (result->IsFailure()) return result;
|
|
|
| @@ -2024,15 +2027,15 @@
|
| share->set_expected_nof_properties(0);
|
| share->set_length(0);
|
| share->set_formal_parameter_count(0);
|
| - share->set_instance_class_name(THIS->Object_symbol());
|
| - share->set_function_data(THIS->undefined_value());
|
| - share->set_script(THIS->undefined_value());
|
| + share->set_instance_class_name(Object_symbol());
|
| + share->set_function_data(undefined_value());
|
| + share->set_script(undefined_value());
|
| share->set_start_position_and_type(0);
|
| - share->set_debug_info(THIS->undefined_value());
|
| - share->set_inferred_name(THIS->empty_string());
|
| + share->set_debug_info(undefined_value());
|
| + share->set_inferred_name(empty_string());
|
| share->set_compiler_hints(0);
|
| share->set_this_property_assignments_count(0);
|
| - share->set_this_property_assignments(THIS->undefined_value());
|
| + share->set_this_property_assignments(undefined_value());
|
| share->set_num_literals(0);
|
| share->set_end_position(0);
|
| share->set_function_token_position(0);
|
| @@ -2170,7 +2173,7 @@
|
| }
|
|
|
| Map* map = (is_ascii || is_ascii_data_in_two_byte_string) ?
|
| - THIS->cons_ascii_string_map() : THIS->cons_string_map();
|
| + cons_ascii_string_map() : cons_string_map();
|
|
|
| Object* result = Allocate(map, NEW_SPACE);
|
| if (result->IsFailure()) return result;
|
| @@ -2234,7 +2237,7 @@
|
| return Failure::OutOfMemoryException();
|
| }
|
|
|
| - Map* map = THIS->external_ascii_string_map();
|
| + Map* map = external_ascii_string_map();
|
| Object* result = Allocate(map, NEW_SPACE);
|
| if (result->IsFailure()) return result;
|
|
|
| @@ -2286,15 +2289,15 @@
|
|
|
| Object* Heap::LookupSingleCharacterStringFromCode(uint16_t code) {
|
| if (code <= String::kMaxAsciiCharCode) {
|
| - Object* value = THIS->single_character_string_cache()->get(code);
|
| - if (value != THIS->undefined_value()) return value;
|
| + Object* value = single_character_string_cache()->get(code);
|
| + if (value != undefined_value()) return value;
|
|
|
| char buffer[1];
|
| buffer[0] = static_cast<char>(code);
|
| Object* result = LookupSymbol(Vector<const char>(buffer, 1));
|
|
|
| if (result->IsFailure()) return result;
|
| - THIS->single_character_string_cache()->set(code, result);
|
| + single_character_string_cache()->set(code, result);
|
| return result;
|
| }
|
|
|
| @@ -2319,7 +2322,7 @@
|
| : lo_space_->AllocateRaw(size);
|
| if (result->IsFailure()) return result;
|
|
|
| - reinterpret_cast<ByteArray*>(result)->set_map(THIS->byte_array_map());
|
| + reinterpret_cast<ByteArray*>(result)->set_map(byte_array_map());
|
| reinterpret_cast<ByteArray*>(result)->set_length(length);
|
| return result;
|
| }
|
| @@ -2335,7 +2338,7 @@
|
| Object* result = AllocateRaw(size, space, OLD_DATA_SPACE);
|
| if (result->IsFailure()) return result;
|
|
|
| - reinterpret_cast<ByteArray*>(result)->set_map(THIS->byte_array_map());
|
| + reinterpret_cast<ByteArray*>(result)->set_map(byte_array_map());
|
| reinterpret_cast<ByteArray*>(result)->set_length(length);
|
| return result;
|
| }
|
| @@ -2345,11 +2348,11 @@
|
| if (size == 0) return;
|
| HeapObject* filler = HeapObject::FromAddress(addr);
|
| if (size == kPointerSize) {
|
| - filler->set_map(THIS->one_pointer_filler_map());
|
| + filler->set_map(one_pointer_filler_map());
|
| } else if (size == 2 * kPointerSize) {
|
| - filler->set_map(THIS->two_pointer_filler_map());
|
| + filler->set_map(two_pointer_filler_map());
|
| } else {
|
| - filler->set_map(THIS->byte_array_map());
|
| + filler->set_map(byte_array_map());
|
| ByteArray::cast(filler)->set_length(ByteArray::LengthFor(size));
|
| }
|
| }
|
| @@ -2362,7 +2365,7 @@
|
| Object* result = AllocateRaw(PixelArray::kAlignedSize, space, OLD_DATA_SPACE);
|
| if (result->IsFailure()) return result;
|
|
|
| - reinterpret_cast<PixelArray*>(result)->set_map(THIS->pixel_array_map());
|
| + reinterpret_cast<PixelArray*>(result)->set_map(pixel_array_map());
|
| reinterpret_cast<PixelArray*>(result)->set_length(length);
|
| reinterpret_cast<PixelArray*>(result)->set_external_pointer(external_pointer);
|
|
|
| @@ -2495,7 +2498,7 @@
|
| if (result->IsFailure()) return result;
|
|
|
| // Initialize the object
|
| - HeapObject::cast(result)->set_map(THIS->code_map());
|
| + HeapObject::cast(result)->set_map(code_map());
|
| Code* code = Code::cast(result);
|
| ASSERT(!isolate_->code_range()->exists() ||
|
| isolate_->code_range()->contains(code->address()));
|
| @@ -2620,8 +2623,8 @@
|
| function->initialize_elements();
|
| function->set_shared(shared);
|
| function->set_prototype_or_initial_map(prototype);
|
| - function->set_context(THIS->undefined_value());
|
| - function->set_literals(THIS->empty_fixed_array());
|
| + function->set_context(undefined_value());
|
| + function->set_literals(empty_fixed_array());
|
| return function;
|
| }
|
|
|
| @@ -2637,7 +2640,7 @@
|
| // When creating the prototype for the function we must set its
|
| // constructor to the function.
|
| Object* result =
|
| - JSObject::cast(prototype)->SetProperty(THIS->constructor_symbol(),
|
| + JSObject::cast(prototype)->SetProperty(constructor_symbol(),
|
| function,
|
| DONT_ENUM);
|
| if (result->IsFailure()) return result;
|
| @@ -3056,23 +3059,23 @@
|
|
|
| // Find the corresponding symbol map for strings.
|
| Map* map = string->map();
|
| - if (map == THIS->ascii_string_map()) {
|
| - return THIS->ascii_symbol_map();
|
| + if (map == ascii_string_map()) {
|
| + return ascii_symbol_map();
|
| }
|
| - if (map == THIS->string_map()) {
|
| - return THIS->symbol_map();
|
| + if (map == string_map()) {
|
| + return symbol_map();
|
| }
|
| - if (map == THIS->cons_string_map()) {
|
| - return THIS->cons_symbol_map();
|
| + if (map == cons_string_map()) {
|
| + return cons_symbol_map();
|
| }
|
| - if (map == THIS->cons_ascii_string_map()) {
|
| - return THIS->cons_ascii_symbol_map();
|
| + if (map == cons_ascii_string_map()) {
|
| + return cons_ascii_symbol_map();
|
| }
|
| - if (map == THIS->external_string_map()) {
|
| - return THIS->external_symbol_map();
|
| + if (map == external_string_map()) {
|
| + return external_symbol_map();
|
| }
|
| - if (map == THIS->external_ascii_string_map()) {
|
| - return THIS->external_ascii_symbol_map();
|
| + if (map == external_ascii_string_map()) {
|
| + return external_ascii_symbol_map();
|
| }
|
| if (map == external_string_with_ascii_data_map()) {
|
| return external_symbol_with_ascii_data_map();
|
| @@ -3107,13 +3110,13 @@
|
| if (chars > SeqAsciiString::kMaxLength) {
|
| return Failure::OutOfMemoryException();
|
| }
|
| - map = THIS->ascii_symbol_map();
|
| + map = ascii_symbol_map();
|
| size = SeqAsciiString::SizeFor(chars);
|
| } else {
|
| if (chars > SeqTwoByteString::kMaxLength) {
|
| return Failure::OutOfMemoryException();
|
| }
|
| - map = THIS->symbol_map();
|
| + map = symbol_map();
|
| size = SeqTwoByteString::SizeFor(chars);
|
| }
|
|
|
| @@ -3165,7 +3168,7 @@
|
| if (result->IsFailure()) return result;
|
|
|
| // Partially initialize the object.
|
| - HeapObject::cast(result)->set_map(THIS->ascii_string_map());
|
| + HeapObject::cast(result)->set_map(ascii_string_map());
|
| String::cast(result)->set_length(length);
|
| String::cast(result)->set_hash_field(String::kEmptyHashField);
|
| ASSERT_EQ(size, HeapObject::cast(result)->Size());
|
| @@ -3197,7 +3200,7 @@
|
| if (result->IsFailure()) return result;
|
|
|
| // Partially initialize the object.
|
| - HeapObject::cast(result)->set_map(THIS->string_map());
|
| + HeapObject::cast(result)->set_map(string_map());
|
| String::cast(result)->set_length(length);
|
| String::cast(result)->set_hash_field(String::kEmptyHashField);
|
| ASSERT_EQ(size, HeapObject::cast(result)->Size());
|
| @@ -3210,7 +3213,7 @@
|
| Object* result = AllocateRaw(size, OLD_DATA_SPACE, OLD_DATA_SPACE);
|
| if (result->IsFailure()) return result;
|
| // Initialize the object.
|
| - reinterpret_cast<FixedArray*>(result)->set_map(THIS->fixed_array_map());
|
| + reinterpret_cast<FixedArray*>(result)->set_map(fixed_array_map());
|
| reinterpret_cast<FixedArray*>(result)->set_length(0);
|
| return result;
|
| }
|
| @@ -3253,16 +3256,16 @@
|
|
|
| Object* Heap::AllocateFixedArray(int length) {
|
| ASSERT(length >= 0);
|
| - if (length == 0) return THIS->empty_fixed_array();
|
| + if (length == 0) return empty_fixed_array();
|
| Object* result = AllocateRawFixedArray(length);
|
| if (!result->IsFailure()) {
|
| // Initialize header.
|
| FixedArray* array = reinterpret_cast<FixedArray*>(result);
|
| - array->set_map(THIS->fixed_array_map());
|
| + array->set_map(fixed_array_map());
|
| array->set_length(length);
|
| // Initialize body.
|
| - ASSERT(!InNewSpace(THIS->undefined_value()));
|
| - MemsetPointer(array->data_start(), THIS->undefined_value(), length);
|
| + ASSERT(!InNewSpace(undefined_value()));
|
| + MemsetPointer(array->data_start(), undefined_value(), length);
|
| }
|
| return result;
|
| }
|
| @@ -3338,7 +3341,7 @@
|
| Object* Heap::AllocateHashTable(int length, PretenureFlag pretenure) {
|
| Object* result = AllocateFixedArray(length, pretenure);
|
| if (result->IsFailure()) return result;
|
| - reinterpret_cast<HeapObject*>(result)->set_map(THIS->hash_table_map());
|
| + reinterpret_cast<HeapObject*>(result)->set_map(hash_table_map());
|
| ASSERT(result->IsHashTable());
|
| return result;
|
| }
|
| @@ -3348,7 +3351,7 @@
|
| Object* result = AllocateFixedArray(Context::GLOBAL_CONTEXT_SLOTS);
|
| if (result->IsFailure()) return result;
|
| Context* context = reinterpret_cast<Context*>(result);
|
| - context->set_map(THIS->global_context_map());
|
| + context->set_map(global_context_map());
|
| ASSERT(context->IsGlobalContext());
|
| ASSERT(result->IsContext());
|
| return result;
|
| @@ -3360,7 +3363,7 @@
|
| Object* result = AllocateFixedArray(length);
|
| if (result->IsFailure()) return result;
|
| Context* context = reinterpret_cast<Context*>(result);
|
| - context->set_map(THIS->context_map());
|
| + context->set_map(context_map());
|
| context->set_closure(function);
|
| context->set_fcontext(context);
|
| context->set_previous(NULL);
|
| @@ -3379,8 +3382,8 @@
|
| Object* result = AllocateFixedArray(Context::MIN_CONTEXT_SLOTS);
|
| if (result->IsFailure()) return result;
|
| Context* context = reinterpret_cast<Context*>(result);
|
| - context->set_map(is_catch_context ? THIS->catch_context_map() :
|
| - THIS->context_map());
|
| + context->set_map(is_catch_context ? catch_context_map() :
|
| + context_map());
|
| context->set_closure(previous->closure());
|
| context->set_fcontext(previous->fcontext());
|
| context->set_previous(previous);
|
| @@ -3397,7 +3400,7 @@
|
| Map* map;
|
| switch (type) {
|
| #define MAKE_CASE(NAME, Name, name) \
|
| - case NAME##_TYPE: map = THIS->name##_map(); break;
|
| + case NAME##_TYPE: map = name##_map(); break;
|
| STRUCT_LIST(MAKE_CASE)
|
| #undef MAKE_CASE
|
| default:
|
| @@ -3670,7 +3673,7 @@
|
|
|
| Object* Heap::LookupSymbol(Vector<const char> string) {
|
| Object* symbol = NULL;
|
| - Object* new_table = THIS->symbol_table()->LookupSymbol(string, &symbol);
|
| + Object* new_table = symbol_table()->LookupSymbol(string, &symbol);
|
| if (new_table->IsFailure()) return new_table;
|
| // Can't use set_symbol_table because SymbolTable::cast knows that
|
| // SymbolTable is a singleton and checks for identity.
|
| @@ -3683,7 +3686,7 @@
|
| Object* Heap::LookupSymbol(String* string) {
|
| if (string->IsSymbol()) return string;
|
| Object* symbol = NULL;
|
| - Object* new_table = THIS->symbol_table()->LookupString(string, &symbol);
|
| + Object* new_table = symbol_table()->LookupString(string, &symbol);
|
| if (new_table->IsFailure()) return new_table;
|
| // Can't use set_symbol_table because SymbolTable::cast knows that
|
| // SymbolTable is a singleton and checks for identity.
|
| @@ -3698,7 +3701,7 @@
|
| *symbol = string;
|
| return true;
|
| }
|
| - return THIS->symbol_table()->LookupSymbolIfExists(string, symbol);
|
| + return symbol_table()->LookupSymbolIfExists(string, symbol);
|
| }
|
|
|
|
|
| @@ -4682,11 +4685,11 @@
|
|
|
| if (create_heap_objects) {
|
| // Create initial maps.
|
| - if (!THIS->CreateInitialMaps()) return false;
|
| - if (!THIS->CreateApiObjects()) return false;
|
| + if (!CreateInitialMaps()) return false;
|
| + if (!CreateApiObjects()) return false;
|
|
|
| // Create initial objects
|
| - if (!THIS->CreateInitialObjects()) return false;
|
| + if (!CreateInitialObjects()) return false;
|
| }
|
|
|
| LOG(IntEvent("heap-capacity", Capacity()));
|
| @@ -4972,8 +4975,8 @@
|
| void ExternalStringTable::CleanUp() {
|
| int last = 0;
|
| for (int i = 0; i < new_space_strings_.length(); ++i) {
|
| - if (new_space_strings_[i] == HEAP->raw_unchecked_null_value()) continue;
|
| - if (HEAP->InNewSpace(new_space_strings_[i])) {
|
| + if (new_space_strings_[i] == heap_->raw_unchecked_null_value()) continue;
|
| + if (heap_->InNewSpace(new_space_strings_[i])) {
|
| new_space_strings_[last++] = new_space_strings_[i];
|
| } else {
|
| old_space_strings_.Add(new_space_strings_[i]);
|
| @@ -4982,8 +4985,8 @@
|
| new_space_strings_.Rewind(last);
|
| last = 0;
|
| for (int i = 0; i < old_space_strings_.length(); ++i) {
|
| - if (old_space_strings_[i] == HEAP->raw_unchecked_null_value()) continue;
|
| - ASSERT(!HEAP->InNewSpace(old_space_strings_[i]));
|
| + if (old_space_strings_[i] == heap_->raw_unchecked_null_value()) continue;
|
| + ASSERT(!heap_->InNewSpace(old_space_strings_[i]));
|
| old_space_strings_[last++] = old_space_strings_[i];
|
| }
|
| old_space_strings_.Rewind(last);
|
|
|