From: danno@chromium.org Date: Fri, 14 Jun 2013 16:06:12 +0000 (+0000) Subject: Refactor only: Rename JSGlobaPropertyCell to PropertyCell X-Git-Tag: upstream/4.7.83~13819 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=61a23ceb4d84d6d6ea344175626bd44e5c22fb37;p=platform%2Fupstream%2Fv8.git Refactor only: Rename JSGlobaPropertyCell to PropertyCell R=mvstanton@chromium.org Review URL: https://codereview.chromium.org/17064002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15165 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc index e75e7f7..ca44ffe 100644 --- a/src/arm/code-stubs-arm.cc +++ b/src/arm/code-stubs-arm.cc @@ -7346,7 +7346,7 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) { // Get the elements kind and case on that. __ cmp(r2, Operand(undefined_sentinel)); __ b(eq, &no_info); - __ ldr(r3, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset)); + __ ldr(r3, FieldMemOperand(r2, PropertyCell::kValueOffset)); __ JumpIfNotSmi(r3, &no_info); __ SmiUntag(r3); __ jmp(&switch_ready); diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index 253c63d..ef860e0 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -2764,7 +2764,7 @@ void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { PredictableCodeSizeScope predictable(masm_, 5 * Assembler::kInstrSize); Handle cell = factory()->NewCell(factory()->the_hole_value()); __ mov(ip, Operand(Handle(cell))); - __ ldr(ip, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset)); + __ ldr(ip, FieldMemOperand(ip, PropertyCell::kValueOffset)); __ cmp(map, Operand(ip)); __ b(ne, &cache_miss); // We use Factory::the_hole_value() on purpose instead of loading from the @@ -5253,7 +5253,7 @@ void LCodeGen::DoCheckFunction(LCheckFunction* instr) { AllowDeferredHandleDereference smi_check; if (isolate()->heap()->InNewSpace(*target)) { Register reg = ToRegister(instr->value()); - Handle cell = isolate()->factory()->NewJSGlobalPropertyCell(target); + Handle cell = isolate()->factory()->NewPropertyCell(target); __ mov(ip, Operand(Handle(cell))); __ ldr(ip, FieldMemOperand(ip, Cell::kValueOffset)); __ cmp(reg, ip); diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc index 737e449..97333e3 100644 --- a/src/arm/stub-cache-arm.cc +++ b/src/arm/stub-cache-arm.cc @@ -2706,7 +2706,7 @@ Handle CallStubCompiler::CompileCallInterceptor(Handle object, Handle CallStubCompiler::CompileCallGlobal( Handle object, Handle holder, - Handle cell, + Handle cell, Handle function, Handle name) { // ----------- S t a t e ------------- @@ -2879,7 +2879,7 @@ Handle StoreStubCompiler::CompileStoreInterceptor( Handle StoreStubCompiler::CompileStoreGlobal( Handle object, - Handle cell, + Handle cell, Handle name) { Label miss; @@ -3023,7 +3023,7 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, Handle LoadStubCompiler::CompileLoadGlobal( Handle object, Handle global, - Handle cell, + Handle cell, Handle name, bool is_dont_delete) { Label success, miss; diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index 0b39faa..4c1c0da 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -2500,8 +2500,8 @@ void Genesis::TransferNamedProperties(Handle from, Handle value = Handle(properties->ValueAt(i), isolate()); ASSERT(!value->IsCell()); - if (value->IsJSGlobalPropertyCell()) { - value = Handle(JSGlobalPropertyCell::cast(*value)->value(), + if (value->IsPropertyCell()) { + value = Handle(PropertyCell::cast(*value)->value(), isolate()); } PropertyDetails details = properties->DetailsAt(i); diff --git a/src/factory.cc b/src/factory.cc index fbe6cb8..8b842a7 100644 --- a/src/factory.cc +++ b/src/factory.cc @@ -491,13 +491,12 @@ Handle Factory::NewCell(Handle value) { } -Handle Factory::NewJSGlobalPropertyCell( - Handle value) { +Handle Factory::NewPropertyCell(Handle value) { AllowDeferredHandleDereference convert_to_cell; CALL_HEAP_FUNCTION( isolate(), - isolate()->heap()->AllocateJSGlobalPropertyCell(*value), - JSGlobalPropertyCell); + isolate()->heap()->AllocatePropertyCell(*value), + PropertyCell); } diff --git a/src/factory.h b/src/factory.h index 07ce96e..cde8432 100644 --- a/src/factory.h +++ b/src/factory.h @@ -237,8 +237,7 @@ class Factory { Handle NewCell(Handle value); - Handle NewJSGlobalPropertyCell( - Handle value); + Handle NewPropertyCell(Handle value); Handle NewMap( InstanceType type, diff --git a/src/heap-inl.h b/src/heap-inl.h index 208b1ad..eb9d9c0 100644 --- a/src/heap-inl.h +++ b/src/heap-inl.h @@ -313,13 +313,13 @@ MaybeObject* Heap::AllocateRawCell() { } -MaybeObject* Heap::AllocateRawJSGlobalPropertyCell() { +MaybeObject* Heap::AllocateRawPropertyCell() { #ifdef DEBUG isolate_->counters()->objs_since_last_full()->Increment(); isolate_->counters()->objs_since_last_young()->Increment(); #endif MaybeObject* result = - property_cell_space_->AllocateRaw(JSGlobalPropertyCell::kSize); + property_cell_space_->AllocateRaw(PropertyCell::kSize); if (result->IsFailure()) old_gen_exhausted_ = true; return result; } diff --git a/src/heap-snapshot-generator.cc b/src/heap-snapshot-generator.cc index 611f6a7..217d1ca 100644 --- a/src/heap-snapshot-generator.cc +++ b/src/heap-snapshot-generator.cc @@ -890,7 +890,7 @@ const char* V8HeapExplorer::GetSystemEntryName(HeapObject* object) { default: return "system / Map"; } case CELL_TYPE: return "system / Cell"; - case PROPERTY_CELL_TYPE: return "system / JSGlobalPropertyCell"; + case PROPERTY_CELL_TYPE: return "system / PropertyCell"; case FOREIGN_TYPE: return "system / Foreign"; case ODDBALL_TYPE: return "system / Oddball"; #define MAKE_STRUCT_CASE(NAME, Name, name) \ @@ -981,9 +981,9 @@ void V8HeapExplorer::ExtractReferences(HeapObject* obj) { } else if (obj->IsCell()) { ExtractCellReferences(entry, Cell::cast(obj)); extract_indexed_refs = false; - } else if (obj->IsJSGlobalPropertyCell()) { - ExtractJSGlobalPropertyCellReferences( - entry, JSGlobalPropertyCell::cast(obj)); + } else if (obj->IsPropertyCell()) { + ExtractPropertyCellReferences( + entry, PropertyCell::cast(obj)); extract_indexed_refs = false; } if (extract_indexed_refs) { @@ -1283,8 +1283,8 @@ void V8HeapExplorer::ExtractCellReferences(int entry, Cell* cell) { } -void V8HeapExplorer::ExtractJSGlobalPropertyCellReferences( - int entry, JSGlobalPropertyCell* cell) { +void V8HeapExplorer::ExtractPropertyCellReferences(int entry, + PropertyCell* cell) { SetInternalReference(cell, entry, "value", cell->value()); SetInternalReference(cell, entry, "type", cell->type()); } @@ -1386,8 +1386,8 @@ void V8HeapExplorer::ExtractPropertyReferences(JSObject* js_obj, int entry) { if (dictionary->IsKey(k)) { Object* target = dictionary->ValueAt(i); // We assume that global objects can only have slow properties. - Object* value = target->IsJSGlobalPropertyCell() - ? JSGlobalPropertyCell::cast(target)->value() + Object* value = target->IsPropertyCell() + ? PropertyCell::cast(target)->value() : target; if (k != heap_->hidden_string()) { SetPropertyReference(js_obj, entry, String::cast(k), value); diff --git a/src/heap-snapshot-generator.h b/src/heap-snapshot-generator.h index 3a91f74..c9a82f0 100644 --- a/src/heap-snapshot-generator.h +++ b/src/heap-snapshot-generator.h @@ -465,8 +465,7 @@ class V8HeapExplorer : public HeapEntriesAllocator { void ExtractCodeCacheReferences(int entry, CodeCache* code_cache); void ExtractCodeReferences(int entry, Code* code); void ExtractCellReferences(int entry, Cell* cell); - void ExtractJSGlobalPropertyCellReferences(int entry, - JSGlobalPropertyCell* cell); + void ExtractPropertyCellReferences(int entry, PropertyCell* cell); void ExtractClosureReferences(JSObject* js_obj, int entry); void ExtractPropertyReferences(JSObject* js_obj, int entry); void ExtractElementReferences(JSObject* js_obj, int entry); diff --git a/src/heap.cc b/src/heap.cc index c3e7409..43c83e4 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -1394,8 +1394,8 @@ void Heap::Scavenge() { for (HeapObject* heap_object = js_global_property_cell_iterator.Next(); heap_object != NULL; heap_object = js_global_property_cell_iterator.Next()) { - if (heap_object->IsJSGlobalPropertyCell()) { - JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(heap_object); + if (heap_object->IsPropertyCell()) { + PropertyCell* cell = PropertyCell::cast(heap_object); Address value_address = cell->ValueAddress(); scavenge_visitor.VisitPointer(reinterpret_cast(value_address)); Address type_address = cell->TypeAddress(); @@ -2678,7 +2678,7 @@ bool Heap::CreateInitialMaps() { set_cell_map(Map::cast(obj)); { MaybeObject* maybe_obj = AllocateMap(PROPERTY_CELL_TYPE, - JSGlobalPropertyCell::kSize); + PropertyCell::kSize); if (!maybe_obj->ToObject(&obj)) return false; } set_global_property_cell_map(Map::cast(obj)); @@ -2823,15 +2823,15 @@ MaybeObject* Heap::AllocateCell(Object* value) { } -MaybeObject* Heap::AllocateJSGlobalPropertyCell(Object* value) { +MaybeObject* Heap::AllocatePropertyCell(Object* value) { Object* result; - { MaybeObject* maybe_result = AllocateRawJSGlobalPropertyCell(); + { MaybeObject* maybe_result = AllocateRawPropertyCell(); if (!maybe_result->ToObject(&result)) return maybe_result; } HeapObject::cast(result)->set_map_no_write_barrier( global_property_cell_map()); - JSGlobalPropertyCell::cast(result)->set_value(value); - JSGlobalPropertyCell::cast(result)->set_type(Type::None()); + PropertyCell::cast(result)->set_value(value); + PropertyCell::cast(result)->set_type(Type::None()); return result; } @@ -4724,7 +4724,7 @@ MaybeObject* Heap::AllocateGlobalObject(JSFunction* constructor) { // Make sure no field properties are described in the initial map. // This guarantees us that normalizing the properties does not - // require us to change property values to JSGlobalPropertyCells. + // require us to change property values to PropertyCells. ASSERT(map->NextFreePropertyIndex() == 0); // Make sure we don't have a ton of pre-allocated slots in the @@ -4753,7 +4753,7 @@ MaybeObject* Heap::AllocateGlobalObject(JSFunction* constructor) { ASSERT(details.type() == CALLBACKS); // Only accessors are expected. PropertyDetails d = PropertyDetails(details.attributes(), CALLBACKS, i + 1); Object* value = descs->GetCallbacksObject(i); - MaybeObject* maybe_value = AllocateJSGlobalPropertyCell(value); + MaybeObject* maybe_value = AllocatePropertyCell(value); if (!maybe_value->ToObject(&value)) return maybe_value; MaybeObject* maybe_added = dictionary->Add(descs->GetKey(i), value, d); @@ -6078,7 +6078,7 @@ void Heap::ReportHeapStatistics(const char* title) { map_space_->ReportStatistics(); PrintF("Cell space : "); cell_space_->ReportStatistics(); - PrintF("JSGlobalPropertyCell space : "); + PrintF("PropertyCell space : "); property_cell_space_->ReportStatistics(); PrintF("Large object space : "); lo_space_->ReportStatistics(); diff --git a/src/heap.h b/src/heap.h index 6f04776..78d9093 100644 --- a/src/heap.h +++ b/src/heap.h @@ -949,7 +949,7 @@ class Heap { // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation // failed. // Please note this does not perform a garbage collection. - MUST_USE_RESULT MaybeObject* AllocateJSGlobalPropertyCell(Object* value); + MUST_USE_RESULT MaybeObject* AllocatePropertyCell(Object* value); // Allocate Box. MUST_USE_RESULT MaybeObject* AllocateBox(Object* value, @@ -2131,7 +2131,7 @@ class Heap { MUST_USE_RESULT inline MaybeObject* AllocateRawCell(); // Allocate an uninitialized object in the global property cell space. - MUST_USE_RESULT inline MaybeObject* AllocateRawJSGlobalPropertyCell(); + MUST_USE_RESULT inline MaybeObject* AllocateRawPropertyCell(); // Initializes a JSObject based on its map. void InitializeJSObjectFromMap(JSObject* obj, diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index 209f53f..7554fd8 100644 --- a/src/hydrogen-instructions.h +++ b/src/hydrogen-instructions.h @@ -5068,7 +5068,7 @@ inline bool ReceiverObjectNeedsWriteBarrier(HValue* object, class HStoreGlobalCell: public HUnaryOperation { public: HStoreGlobalCell(HValue* value, - Handle cell, + Handle cell, PropertyDetails details) : HUnaryOperation(value), cell_(cell), @@ -5076,7 +5076,7 @@ class HStoreGlobalCell: public HUnaryOperation { SetGVNFlag(kChangesGlobalVars); } - Handle cell() const { return cell_; } + Handle cell() const { return cell_; } bool RequiresHoleCheck() { return !details_.IsDontDelete() || details_.IsReadOnly(); } @@ -5092,7 +5092,7 @@ class HStoreGlobalCell: public HUnaryOperation { DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell) private: - Handle cell_; + Handle cell_; PropertyDetails details_; }; diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 74a573e..fad0654 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -5626,7 +5626,7 @@ void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) { if (type == kUseCell) { Handle global(current_info()->global_object()); - Handle cell(global->GetPropertyCell(&lookup)); + Handle cell(global->GetPropertyCell(&lookup)); HLoadGlobalCell* instr = new(zone()) HLoadGlobalCell(cell, lookup.GetPropertyDetails()); return ast_context()->ReturnInstruction(instr, expr->id()); @@ -6606,7 +6606,7 @@ void HOptimizedGraphBuilder::HandleGlobalVariableAssignment( GlobalPropertyAccess type = LookupGlobalProperty(var, &lookup, true); if (type == kUseCell) { Handle global(current_info()->global_object()); - Handle cell(global->GetPropertyCell(&lookup)); + Handle cell(global->GetPropertyCell(&lookup)); HInstruction* instr = new(zone()) HStoreGlobalCell(value, cell, lookup.GetPropertyDetails()); instr->set_position(position); diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc index 1e9c330..f3483eb 100644 --- a/src/ia32/code-stubs-ia32.cc +++ b/src/ia32/code-stubs-ia32.cc @@ -4688,7 +4688,7 @@ static void GenerateRecordCallTargetNoArray(MacroAssembler* masm) { Label initialize, done; // Load the cache state into ecx. - __ mov(ecx, FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset)); + __ mov(ecx, FieldOperand(ebx, PropertyCell::kValueOffset)); // A monomorphic cache hit or an already megamorphic state: invoke the // function without changing the state. diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index cfda00a..ec87a9c 100644 --- a/src/ia32/lithium-codegen-ia32.cc +++ b/src/ia32/lithium-codegen-ia32.cc @@ -2885,7 +2885,7 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { Register value = ToRegister(instr->value()); - Handle cell_handle = instr->hydrogen()->cell(); + Handle cell_handle = instr->hydrogen()->cell(); // If the cell we are storing to contains the hole it could have // been deleted from the property dictionary. In that case, we need diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc index 38578c7..f390f88 100644 --- a/src/ia32/stub-cache-ia32.cc +++ b/src/ia32/stub-cache-ia32.cc @@ -764,13 +764,13 @@ static void GenerateCheckPropertyCell(MacroAssembler* masm, Handle name, Register scratch, Label* miss) { - Handle cell = + Handle cell = GlobalObject::EnsurePropertyCell(global, name); ASSERT(cell->value()->IsTheHole()); Handle the_hole = masm->isolate()->factory()->the_hole_value(); if (Serializer::enabled()) { __ mov(scratch, Immediate(cell)); - __ cmp(FieldOperand(scratch, JSGlobalPropertyCell::kValueOffset), + __ cmp(FieldOperand(scratch, PropertyCell::kValueOffset), Immediate(the_hole)); } else { __ cmp(Operand::ForCell(cell), Immediate(the_hole)); @@ -2780,7 +2780,7 @@ Handle CallStubCompiler::CompileCallInterceptor(Handle object, Handle CallStubCompiler::CompileCallGlobal( Handle object, Handle holder, - Handle cell, + Handle cell, Handle function, Handle name) { // ----------- S t a t e ------------- @@ -2963,7 +2963,7 @@ Handle StoreStubCompiler::CompileStoreInterceptor( Handle StoreStubCompiler::CompileStoreGlobal( Handle object, - Handle cell, + Handle cell, Handle name) { Label miss; @@ -2975,7 +2975,7 @@ Handle StoreStubCompiler::CompileStoreGlobal( // Compute the cell operand to use. __ mov(scratch1(), Immediate(cell)); Operand cell_operand = - FieldOperand(scratch1(), JSGlobalPropertyCell::kValueOffset); + FieldOperand(scratch1(), PropertyCell::kValueOffset); // Check that the value in the cell is not the hole. If it is, this // cell could have been deleted and reintroducing the global needs @@ -3136,7 +3136,7 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, Handle LoadStubCompiler::CompileLoadGlobal( Handle object, Handle global, - Handle cell, + Handle cell, Handle name, bool is_dont_delete) { Label success, miss; @@ -3147,7 +3147,7 @@ Handle LoadStubCompiler::CompileLoadGlobal( // Get the value from the cell. if (Serializer::enabled()) { __ mov(eax, Immediate(cell)); - __ mov(eax, FieldOperand(eax, JSGlobalPropertyCell::kValueOffset)); + __ mov(eax, FieldOperand(eax, PropertyCell::kValueOffset)); } else { __ mov(eax, Operand::ForCell(cell)); } diff --git a/src/ic.cc b/src/ic.cc index 029aafd..fc776ee 100644 --- a/src/ic.cc +++ b/src/ic.cc @@ -686,7 +686,7 @@ Handle CallICBase::ComputeMonomorphicStub(LookupResult* lookup, if (holder->IsGlobalObject()) { Handle global = Handle::cast(holder); - Handle cell( + Handle cell( global->GetPropertyCell(lookup), isolate()); if (!cell->value()->IsJSFunction()) return Handle::null(); Handle function(JSFunction::cast(cell->value())); @@ -1258,7 +1258,7 @@ Handle LoadIC::ComputeLoadHandler(LookupResult* lookup, case NORMAL: if (holder->IsGlobalObject()) { Handle global = Handle::cast(holder); - Handle cell( + Handle cell( global->GetPropertyCell(lookup), isolate()); return isolate()->stub_cache()->ComputeLoadGlobal( name, receiver, global, cell, lookup->IsDontDelete()); @@ -1696,7 +1696,7 @@ Handle StoreIC::ComputeStoreMonomorphic(LookupResult* lookup, // from the property cell. So the property must be directly on the // global object. Handle global = Handle::cast(receiver); - Handle cell( + Handle cell( global->GetPropertyCell(lookup), isolate()); return isolate()->stub_cache()->ComputeStoreGlobal( name, global, cell, strict_mode); diff --git a/src/mark-compact.cc b/src/mark-compact.cc index 4c27ec6..c06bfd7 100644 --- a/src/mark-compact.cc +++ b/src/mark-compact.cc @@ -2267,13 +2267,13 @@ void MarkCompactCollector::MarkLiveObjects() { heap()->property_cell_space()); HeapObject* cell; while ((cell = js_global_property_cell_iterator.Next()) != NULL) { - ASSERT(cell->IsJSGlobalPropertyCell()); + ASSERT(cell->IsPropertyCell()); if (IsMarked(cell)) { - int offset = JSGlobalPropertyCell::kValueOffset; + int offset = PropertyCell::kValueOffset; MarkCompactMarkingVisitor::VisitPointer( heap(), reinterpret_cast(cell->address() + offset)); - offset = JSGlobalPropertyCell::kTypeOffset; + offset = PropertyCell::kTypeOffset; MarkCompactMarkingVisitor::VisitPointer( heap(), reinterpret_cast(cell->address() + offset)); @@ -3429,14 +3429,14 @@ void MarkCompactCollector::EvacuateNewSpaceAndCandidates() { for (HeapObject* cell = js_global_property_cell_iterator.Next(); cell != NULL; cell = js_global_property_cell_iterator.Next()) { - if (cell->IsJSGlobalPropertyCell()) { + if (cell->IsPropertyCell()) { Address value_address = reinterpret_cast
(cell) + - (JSGlobalPropertyCell::kValueOffset - kHeapObjectTag); + (PropertyCell::kValueOffset - kHeapObjectTag); updating_visitor.VisitPointer(reinterpret_cast(value_address)); Address type_address = reinterpret_cast
(cell) + - (JSGlobalPropertyCell::kTypeOffset - kHeapObjectTag); + (PropertyCell::kTypeOffset - kHeapObjectTag); updating_visitor.VisitPointer(reinterpret_cast(type_address)); } } diff --git a/src/objects-debug.cc b/src/objects-debug.cc index 3b561ee..ca42383 100644 --- a/src/objects-debug.cc +++ b/src/objects-debug.cc @@ -167,7 +167,7 @@ void HeapObject::HeapObjectVerify() { Cell::cast(this)->CellVerify(); break; case PROPERTY_CELL_TYPE: - JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellVerify(); + PropertyCell::cast(this)->PropertyCellVerify(); break; case JS_ARRAY_TYPE: JSArray::cast(this)->JSArrayVerify(); @@ -624,8 +624,8 @@ void Cell::CellVerify() { } -void JSGlobalPropertyCell::JSGlobalPropertyCellVerify() { - CHECK(IsJSGlobalPropertyCell()); +void PropertyCell::PropertyCellVerify() { + CHECK(IsPropertyCell()); VerifyObjectField(kValueOffset); VerifyObjectField(kTypeOffset); } diff --git a/src/objects-inl.h b/src/objects-inl.h index 47d119a..a8aa1bf 100644 --- a/src/objects-inl.h +++ b/src/objects-inl.h @@ -669,7 +669,7 @@ template <> inline bool Is(Object* obj) { TYPE_CHECKER(Code, CODE_TYPE) TYPE_CHECKER(Oddball, ODDBALL_TYPE) TYPE_CHECKER(Cell, CELL_TYPE) -TYPE_CHECKER(JSGlobalPropertyCell, PROPERTY_CELL_TYPE) +TYPE_CHECKER(PropertyCell, PROPERTY_CELL_TYPE) TYPE_CHECKER(SharedFunctionInfo, SHARED_FUNCTION_INFO_TYPE) TYPE_CHECKER(JSGeneratorObject, JS_GENERATOR_OBJECT_TYPE) TYPE_CHECKER(JSModule, JS_MODULE_TYPE) @@ -1629,17 +1629,17 @@ Object* Cell::value() { void Cell::set_value(Object* val, WriteBarrierMode ignored) { // The write barrier is not used for global property cells. - ASSERT(!val->IsJSGlobalPropertyCell() && !val->IsCell()); + ASSERT(!val->IsPropertyCell() && !val->IsCell()); WRITE_FIELD(this, kValueOffset, val); } -Object* JSGlobalPropertyCell::type_raw() { +Object* PropertyCell::type_raw() { return READ_FIELD(this, kTypeOffset); } -void JSGlobalPropertyCell::set_type_raw(Object* val, WriteBarrierMode ignored) { +void PropertyCell::set_type_raw(Object* val, WriteBarrierMode ignored) { WRITE_FIELD(this, kTypeOffset, val); } @@ -2540,7 +2540,7 @@ CAST_ACCESSOR(HeapObject) CAST_ACCESSOR(HeapNumber) CAST_ACCESSOR(Oddball) CAST_ACCESSOR(Cell) -CAST_ACCESSOR(JSGlobalPropertyCell) +CAST_ACCESSOR(PropertyCell) CAST_ACCESSOR(SharedFunctionInfo) CAST_ACCESSOR(Map) CAST_ACCESSOR(JSFunction) diff --git a/src/objects-printer.cc b/src/objects-printer.cc index 33aa404..a57088b 100644 --- a/src/objects-printer.cc +++ b/src/objects-printer.cc @@ -186,7 +186,7 @@ void HeapObject::HeapObjectPrint(FILE* out) { Cell::cast(this)->CellPrint(out); break; case PROPERTY_CELL_TYPE: - JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellPrint(out); + PropertyCell::cast(this)->PropertyCellPrint(out); break; case JS_ARRAY_BUFFER_TYPE: JSArrayBuffer::cast(this)->JSArrayBufferPrint(out); @@ -926,8 +926,8 @@ void Cell::CellPrint(FILE* out) { } -void JSGlobalPropertyCell::JSGlobalPropertyCellPrint(FILE* out) { - HeapObject::PrintHeader(out, "JSGlobalPropertyCell"); +void PropertyCell::PropertyCellPrint(FILE* out) { + HeapObject::PrintHeader(out, "PropertyCell"); } diff --git a/src/objects-visiting-inl.h b/src/objects-visiting-inl.h index c138fdd..9dc245c 100644 --- a/src/objects-visiting-inl.h +++ b/src/objects-visiting-inl.h @@ -203,7 +203,7 @@ void StaticMarkingVisitor::Initialize() { table_.Register(kVisitPropertyCell, &FixedBodyVisitor::Visit); table_.template RegisterSpecializationsValueAt(result->GetDictionaryEntry()); if (IsGlobalObject()) { - value = JSGlobalPropertyCell::cast(value)->value(); + value = PropertyCell::cast(value)->value(); } - ASSERT(!value->IsJSGlobalPropertyCell() && !value->IsCell()); + ASSERT(!value->IsPropertyCell() && !value->IsCell()); return value; } @@ -639,7 +639,7 @@ Object* JSObject::GetNormalizedProperty(LookupResult* result) { Object* JSObject::SetNormalizedProperty(LookupResult* result, Object* value) { ASSERT(!HasFastProperties()); if (IsGlobalObject()) { - JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast( + PropertyCell* cell = PropertyCell::cast( property_dictionary()->ValueAt(result->GetDictionaryEntry())); cell->set_value(value); } else { @@ -669,7 +669,7 @@ MaybeObject* JSObject::SetNormalizedProperty(Name* name, if (IsGlobalObject()) { Heap* heap = name->GetHeap(); MaybeObject* maybe_store_value = - heap->AllocateJSGlobalPropertyCell(value); + heap->AllocatePropertyCell(value); if (!maybe_store_value->ToObject(&store_value)) return maybe_store_value; } Object* dict; @@ -696,8 +696,8 @@ MaybeObject* JSObject::SetNormalizedProperty(Name* name, details.attributes(), details.type(), enumeration_index); if (IsGlobalObject()) { - JSGlobalPropertyCell* cell = - JSGlobalPropertyCell::cast(property_dictionary()->ValueAt(entry)); + PropertyCell* cell = + PropertyCell::cast(property_dictionary()->ValueAt(entry)); cell->set_value(value); // Please note we have to update the property details. property_dictionary()->DetailsAtPut(entry, details); @@ -729,8 +729,7 @@ MaybeObject* JSObject::DeleteNormalizedProperty(Name* name, DeleteMode mode) { ASSERT(new_map->is_dictionary_map()); set_map(new_map); } - JSGlobalPropertyCell* cell = - JSGlobalPropertyCell::cast(dictionary->ValueAt(entry)); + PropertyCell* cell = PropertyCell::cast(dictionary->ValueAt(entry)); cell->set_value(cell->GetHeap()->the_hole_value()); dictionary->DetailsAtPut(entry, details.AsDeleted()); } else { @@ -1572,7 +1571,7 @@ void HeapObject::HeapObjectShortPrint(StringStream* accumulator) { break; case PROPERTY_CELL_TYPE: accumulator->Add("PropertyCell for "); - JSGlobalPropertyCell::cast(this)->value()->ShortPrint(accumulator); + PropertyCell::cast(this)->value()->ShortPrint(accumulator); break; default: accumulator->Add("", map()->instance_type()); @@ -1668,7 +1667,7 @@ void HeapObject::IterateBody(InstanceType type, int object_size, Cell::BodyDescriptor::IterateBody(this, v); break; case PROPERTY_CELL_TYPE: - JSGlobalPropertyCell::BodyDescriptor::IterateBody(this, v); + PropertyCell::BodyDescriptor::IterateBody(this, v); break; case SYMBOL_TYPE: Symbol::BodyDescriptor::IterateBody(this, v); @@ -1937,7 +1936,7 @@ MaybeObject* JSObject::AddSlowProperty(Name* name, int entry = dict->FindEntry(name); if (entry != NameDictionary::kNotFound) { store_value = dict->ValueAt(entry); - JSGlobalPropertyCell::cast(store_value)->set_value(value); + PropertyCell::cast(store_value)->set_value(value); // Assign an enumeration index to the property and update // SetNextEnumerationIndex. int index = dict->NextEnumerationIndex(); @@ -1948,10 +1947,10 @@ MaybeObject* JSObject::AddSlowProperty(Name* name, } Heap* heap = GetHeap(); { MaybeObject* maybe_store_value = - heap->AllocateJSGlobalPropertyCell(value); + heap->AllocatePropertyCell(value); if (!maybe_store_value->ToObject(&store_value)) return maybe_store_value; } - JSGlobalPropertyCell::cast(store_value)->set_value(value); + PropertyCell::cast(store_value)->set_value(value); } PropertyDetails details = PropertyDetails(attributes, NORMAL, 0); Object* result; @@ -3273,7 +3272,7 @@ void JSObject::LocalLookupRealNamedProperty(Name* name, LookupResult* result) { result->NotFound(); return; } - value = JSGlobalPropertyCell::cast(value)->value(); + value = PropertyCell::cast(value)->value(); } // Make sure to disallow caching for uninitialized constants // found in the dictionary-mode objects. @@ -14259,20 +14258,20 @@ MaybeObject* ExternalDoubleArray::SetValue(uint32_t index, Object* value) { } -JSGlobalPropertyCell* GlobalObject::GetPropertyCell(LookupResult* result) { +PropertyCell* GlobalObject::GetPropertyCell(LookupResult* result) { ASSERT(!HasFastProperties()); Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry()); - return JSGlobalPropertyCell::cast(value); + return PropertyCell::cast(value); } -Handle GlobalObject::EnsurePropertyCell( +Handle GlobalObject::EnsurePropertyCell( Handle global, Handle name) { Isolate* isolate = global->GetIsolate(); CALL_HEAP_FUNCTION(isolate, global->EnsurePropertyCell(*name), - JSGlobalPropertyCell); + PropertyCell); } @@ -14283,7 +14282,7 @@ MaybeObject* GlobalObject::EnsurePropertyCell(Name* name) { Heap* heap = GetHeap(); Object* cell; { MaybeObject* maybe_cell = - heap->AllocateJSGlobalPropertyCell(heap->the_hole_value()); + heap->AllocatePropertyCell(heap->the_hole_value()); if (!maybe_cell->ToObject(&cell)) return maybe_cell; } PropertyDetails details(NONE, NORMAL, 0); @@ -14297,7 +14296,7 @@ MaybeObject* GlobalObject::EnsurePropertyCell(Name* name) { return cell; } else { Object* value = property_dictionary()->ValueAt(entry); - ASSERT(value->IsJSGlobalPropertyCell()); + ASSERT(value->IsPropertyCell()); return value; } } @@ -15080,8 +15079,8 @@ Object* Dictionary::SlowReverseLookup(Object* value) { Object* k = HashTable::KeyAt(i); if (Dictionary::IsKey(k)) { Object* e = ValueAt(i); - if (e->IsJSGlobalPropertyCell()) { - e = JSGlobalPropertyCell::cast(e)->value(); + if (e->IsPropertyCell()) { + e = PropertyCell::cast(e)->value(); } if (e == value) return k; } @@ -15811,12 +15810,12 @@ void JSTypedArray::Neuter() { } -Type* JSGlobalPropertyCell::type() { +Type* PropertyCell::type() { return static_cast(type_raw()); } -void JSGlobalPropertyCell::set_type(Type* type, WriteBarrierMode ignored) { +void PropertyCell::set_type(Type* type, WriteBarrierMode ignored) { set_type_raw(type, ignored); } diff --git a/src/objects.h b/src/objects.h index dd21db3..1d02ed7 100644 --- a/src/objects.h +++ b/src/objects.h @@ -120,7 +120,7 @@ // - Symbol // - HeapNumber // - Cell -// - JSGlobalPropertyCell +// - PropertyCell // - Code // - Map // - Oddball @@ -1017,7 +1017,7 @@ class MaybeObject BASE_EMBEDDED { V(UndetectableObject) \ V(AccessCheckNeeded) \ V(Cell) \ - V(JSGlobalPropertyCell) \ + V(PropertyCell) \ V(ObjectHashTable) \ @@ -4379,7 +4379,7 @@ class DeoptimizationOutputData: public FixedArray { // Forward declaration. class Cell; -class JSGlobalPropertyCell; +class PropertyCell; // TypeFeedbackCells is a fixed array used to hold the association between // cache cells and AST ids for code generated by the full compiler. @@ -6809,7 +6809,7 @@ class GlobalObject: public JSObject { DECL_ACCESSORS(global_receiver, JSObject) // Retrieve the property cell used to store a property. - JSGlobalPropertyCell* GetPropertyCell(LookupResult* result); + PropertyCell* GetPropertyCell(LookupResult* result); // This is like GetProperty, but is used when you know the lookup won't fail // by throwing an exception. This is for the debug and builtins global @@ -6821,7 +6821,7 @@ class GlobalObject: public JSObject { } // Ensure that the global object has a cell for the given property name. - static Handle EnsurePropertyCell( + static Handle EnsurePropertyCell( Handle global, Handle name); // TODO(kmillikin): This function can be eliminated once the stub cache is @@ -8553,7 +8553,7 @@ class Cell: public HeapObject { static inline Cell* FromValueAddress(Address value) { Object* result = FromAddress(value - kValueOffset); - ASSERT(result->IsCell() || result->IsJSGlobalPropertyCell()); + ASSERT(result->IsCell() || result->IsPropertyCell()); return static_cast(result); } @@ -8578,21 +8578,21 @@ class Cell: public HeapObject { }; -class JSGlobalPropertyCell: public Cell { +class PropertyCell: public Cell { public: Type* type(); void set_type(Type* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER); // Casting. - static inline JSGlobalPropertyCell* cast(Object* obj); + static inline PropertyCell* cast(Object* obj); inline Address TypeAddress() { return address() + kTypeOffset; } // Dispatched behavior. - DECLARE_PRINTER(JSGlobalPropertyCell) - DECLARE_VERIFIER(JSGlobalPropertyCell) + DECLARE_PRINTER(PropertyCell) + DECLARE_VERIFIER(PropertyCell) // Layout description. static const int kTypeOffset = kValueOffset + kPointerSize; @@ -8601,11 +8601,11 @@ class JSGlobalPropertyCell: public Cell { typedef FixedBodyDescriptor< kValueOffset, kTypeOffset + kPointerSize, - JSGlobalPropertyCell::kSize> BodyDescriptor; + PropertyCell::kSize> BodyDescriptor; private: DECL_ACCESSORS(type_raw, Object) - DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalPropertyCell); + DISALLOW_IMPLICIT_CONSTRUCTORS(PropertyCell); }; diff --git a/src/property.h b/src/property.h index 5bb2c4d..f36bc7a 100644 --- a/src/property.h +++ b/src/property.h @@ -351,7 +351,7 @@ class LookupResult BASE_EMBEDDED { Object* value; value = holder()->property_dictionary()->ValueAt(GetDictionaryEntry()); if (holder()->IsGlobalObject()) { - value = JSGlobalPropertyCell::cast(value)->value(); + value = PropertyCell::cast(value)->value(); } return value; } diff --git a/src/runtime.cc b/src/runtime.cc index 01165c8..9211b56 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -4513,7 +4513,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_KeyedGetProperty) { (dictionary->DetailsAt(entry).type() == NORMAL)) { Object* value = dictionary->ValueAt(entry); if (!receiver->IsGlobalObject()) return value; - value = JSGlobalPropertyCell::cast(value)->value(); + value = PropertyCell::cast(value)->value(); if (!value->IsTheHole()) return value; // If value is the hole do the general lookup. } diff --git a/src/spaces.cc b/src/spaces.cc index 60293ea..825d2a6 100644 --- a/src/spaces.cc +++ b/src/spaces.cc @@ -2897,7 +2897,7 @@ void CellSpace::VerifyObject(HeapObject* object) { void PropertyCellSpace::VerifyObject(HeapObject* object) { // The object should be a global object property cell or a free-list node. - CHECK(object->IsJSGlobalPropertyCell() || + CHECK(object->IsPropertyCell() || object->map() == heap()->two_pointer_filler_map()); } diff --git a/src/spaces.h b/src/spaces.h index d964549..5b27542 100644 --- a/src/spaces.h +++ b/src/spaces.h @@ -2660,14 +2660,14 @@ class PropertyCellSpace : public FixedSpace { // Creates a property cell space object with a maximum capacity. PropertyCellSpace(Heap* heap, intptr_t max_capacity, AllocationSpace id) - : FixedSpace(heap, max_capacity, id, JSGlobalPropertyCell::kSize) + : FixedSpace(heap, max_capacity, id, PropertyCell::kSize) {} virtual int RoundSizeDownToObjectAlignment(int size) { - if (IsPowerOf2(JSGlobalPropertyCell::kSize)) { - return RoundDown(size, JSGlobalPropertyCell::kSize); + if (IsPowerOf2(PropertyCell::kSize)) { + return RoundDown(size, PropertyCell::kSize); } else { - return (size / JSGlobalPropertyCell::kSize) * JSGlobalPropertyCell::kSize; + return (size / PropertyCell::kSize) * PropertyCell::kSize; } } diff --git a/src/stub-cache.cc b/src/stub-cache.cc index 40a7938..2a27f4f 100644 --- a/src/stub-cache.cc +++ b/src/stub-cache.cc @@ -321,7 +321,7 @@ Handle StubCache::ComputeLoadNormal(Handle name, Handle StubCache::ComputeLoadGlobal(Handle name, Handle receiver, Handle holder, - Handle cell, + Handle cell, bool is_dont_delete) { Handle stub_holder = StubHolder(receiver, holder); Handle stub = FindIC(name, stub_holder, Code::LOAD_IC, Code::NORMAL); @@ -497,7 +497,7 @@ Handle StubCache::ComputeStoreNormal(StrictModeFlag strict_mode) { Handle StubCache::ComputeStoreGlobal(Handle name, Handle receiver, - Handle cell, + Handle cell, StrictModeFlag strict_mode) { Handle stub = FindIC( name, Handle::cast(receiver), @@ -734,7 +734,7 @@ Handle StubCache::ComputeCallGlobal(int argc, Handle name, Handle receiver, Handle holder, - Handle cell, + Handle cell, Handle function) { InlineCacheHolderFlag cache_holder = IC::GetCodeCacheForObject(*receiver, *holder); diff --git a/src/stub-cache.h b/src/stub-cache.h index 0c756a1..c085b51 100644 --- a/src/stub-cache.h +++ b/src/stub-cache.h @@ -140,7 +140,7 @@ class StubCache { Handle ComputeLoadGlobal(Handle name, Handle object, Handle holder, - Handle cell, + Handle cell, bool is_dont_delete); // --- @@ -183,7 +183,7 @@ class StubCache { Handle ComputeStoreGlobal(Handle name, Handle object, - Handle cell, + Handle cell, StrictModeFlag strict_mode); Handle ComputeStoreCallback(Handle name, @@ -251,7 +251,7 @@ class StubCache { Handle name, Handle object, Handle holder, - Handle cell, + Handle cell, Handle function); // --- @@ -765,7 +765,7 @@ class LoadStubCompiler: public BaseLoadStubCompiler { Handle CompileLoadGlobal(Handle object, Handle holder, - Handle cell, + Handle cell, Handle name, bool is_dont_delete); @@ -890,7 +890,7 @@ class StoreStubCompiler: public BaseStoreStubCompiler { Handle name); Handle CompileStoreGlobal(Handle object, - Handle holder, + Handle holder, Handle name); private: @@ -1007,7 +1007,7 @@ class CallStubCompiler: public StubCompiler { Handle CompileCallGlobal(Handle object, Handle holder, - Handle cell, + Handle cell, Handle function, Handle name); diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc index 733da3b..3b9b1f4 100644 --- a/src/x64/stub-cache-x64.cc +++ b/src/x64/stub-cache-x64.cc @@ -746,7 +746,7 @@ static void GenerateCheckPropertyCell(MacroAssembler* masm, Handle name, Register scratch, Label* miss) { - Handle cell = + Handle cell = GlobalObject::EnsurePropertyCell(global, name); ASSERT(cell->value()->IsTheHole()); __ Move(scratch, cell); @@ -2472,7 +2472,7 @@ Handle CallStubCompiler::CompileCallConstant( Handle function) { if (HasCustomCallGenerator(function)) { Handle code = CompileCustomCall(object, holder, - Handle::null(), + Handle::null(), function, Handle::cast(name)); // A null handle means bail out to the regular compiler code below. if (!code.is_null()) return code; @@ -2552,7 +2552,7 @@ Handle CallStubCompiler::CompileCallInterceptor(Handle object, Handle CallStubCompiler::CompileCallGlobal( Handle object, Handle holder, - Handle cell, + Handle cell, Handle function, Handle name) { // ----------- S t a t e ------------- @@ -2735,7 +2735,7 @@ Handle StoreStubCompiler::CompileStoreInterceptor( Handle StoreStubCompiler::CompileStoreGlobal( Handle object, - Handle cell, + Handle cell, Handle name) { Label miss; @@ -2747,7 +2747,7 @@ Handle StoreStubCompiler::CompileStoreGlobal( // Compute the cell operand to use. __ Move(scratch1(), cell); Operand cell_operand = - FieldOperand(scratch1(), JSGlobalPropertyCell::kValueOffset); + FieldOperand(scratch1(), PropertyCell::kValueOffset); // Check that the value in the cell is not the hole. If it is, this // cell could have been deleted and reintroducing the global needs @@ -2915,7 +2915,7 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, Handle LoadStubCompiler::CompileLoadGlobal( Handle object, Handle global, - Handle cell, + Handle cell, Handle name, bool is_dont_delete) { Label success, miss; @@ -2929,7 +2929,7 @@ Handle LoadStubCompiler::CompileLoadGlobal( // Get the value from the cell. __ Move(rbx, cell); - __ movq(rbx, FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset)); + __ movq(rbx, FieldOperand(rbx, PropertyCell::kValueOffset)); // Check for deleted property if property can actually be deleted. if (!is_dont_delete) {