From: mvstanton@chromium.org Date: Mon, 8 Jul 2013 15:00:12 +0000 (+0000) Subject: Rename AllocationSite::payload to AllocationSite::transition_info X-Git-Tag: upstream/4.7.83~13475 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=23695eb86ec438064c26663bc0d1ff3161637cad;p=platform%2Fupstream%2Fv8.git Rename AllocationSite::payload to AllocationSite::transition_info BUG= R=hpayer@chromium.org Review URL: https://codereview.chromium.org/18749004 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15556 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc index 2919f57..4cfb247 100644 --- a/src/arm/code-stubs-arm.cc +++ b/src/arm/code-stubs-arm.cc @@ -6973,7 +6973,7 @@ static void CreateArrayDispatchOneArgument(MacroAssembler* masm) { // Save the resulting elements kind in type info __ SmiTag(r3); __ ldr(r5, FieldMemOperand(r2, Cell::kValueOffset)); - __ str(r3, FieldMemOperand(r5, AllocationSite::kPayloadOffset)); + __ str(r3, FieldMemOperand(r5, AllocationSite::kTransitionInfoOffset)); __ SmiUntag(r3); __ bind(&normal_sequence); @@ -7081,7 +7081,7 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) { __ CompareRoot(r4, Heap::kAllocationSiteMapRootIndex); __ b(ne, &no_info); - __ ldr(r3, FieldMemOperand(r3, AllocationSite::kPayloadOffset)); + __ ldr(r3, FieldMemOperand(r3, AllocationSite::kTransitionInfoOffset)); __ SmiUntag(r3); __ jmp(&switch_ready); __ bind(&no_info); diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc index fc41ef9..3189cf8 100644 --- a/src/arm/stub-cache-arm.cc +++ b/src/arm/stub-cache-arm.cc @@ -1729,7 +1729,7 @@ Handle CallStubCompiler::CompileArrayCodeCall( } Handle site = isolate()->factory()->NewAllocationSite(); - site->set_payload(Smi::FromInt(GetInitialFastElementsKind())); + site->set_transition_info(Smi::FromInt(GetInitialFastElementsKind())); Handle site_feedback_cell = isolate()->factory()->NewCell(site); __ mov(r0, Operand(argc)); __ mov(r2, Operand(site_feedback_cell)); diff --git a/src/ast.cc b/src/ast.cc index 721878b..bf111f8 100644 --- a/src/ast.cc +++ b/src/ast.cc @@ -678,7 +678,7 @@ void CallNew::RecordTypeFeedback(TypeFeedbackOracle* oracle) { ASSERT(!value->IsTheHole()); if (value->IsAllocationSite()) { AllocationSite* site = AllocationSite::cast(value); - elements_kind_ = site->GetElementsKindPayload(); + elements_kind_ = site->GetElementsKind(); } } } diff --git a/src/builtins.cc b/src/builtins.cc index d17137f..f081e3d 100644 --- a/src/builtins.cc +++ b/src/builtins.cc @@ -214,7 +214,7 @@ static MaybeObject* ArrayCodeGenericCommon(Arguments* args, AllocationSiteInfo* info = AllocationSiteInfo::FindForJSObject(array); if (info != NULL && info->IsValid()) { AllocationSite* site = info->GetAllocationSite(); - ElementsKind to_kind = site->GetElementsKindPayload(); + ElementsKind to_kind = site->GetElementsKind(); if (IsMoreGeneralElementsKindTransition(array->GetElementsKind(), to_kind)) { // We have advice that we should change the elements kind diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc index 4d1c27c..51734da 100644 --- a/src/code-stubs-hydrogen.cc +++ b/src/code-stubs-hydrogen.cc @@ -446,7 +446,7 @@ HValue* CodeStubGraphBuilder::BuildCodeStub() { HValue* initial_elements_kind = AddInstruction(new(zone) HConstant( GetInitialFastElementsKind())); AddInstruction(new(zone) HStoreNamedField(object, - HObjectAccess::ForAllocationSitePayload(), initial_elements_kind)); + HObjectAccess::ForAllocationSiteTransitionInfo(), initial_elements_kind)); // We use a hammer (SkipWriteBarrier()) to indicate that we know the input // cell is really a Cell, and so no write barrier is needed. diff --git a/src/heap.cc b/src/heap.cc index 62b673f..53207b7 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -4549,7 +4549,7 @@ MaybeObject* Heap::AllocateJSObjectWithAllocationSite(JSFunction* constructor, // advice Map* initial_map = constructor->initial_map(); - Smi* smi = Smi::cast(allocation_site->payload()); + Smi* smi = Smi::cast(allocation_site->transition_info()); ElementsKind to_kind = static_cast(smi->value()); AllocationSiteMode mode = TRACK_ALLOCATION_SITE; if (to_kind != initial_map->elements_kind()) { diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index 22de75b..9e8ba76 100644 --- a/src/hydrogen-instructions.h +++ b/src/hydrogen-instructions.h @@ -5347,8 +5347,8 @@ class HObjectAccess { return HObjectAccess(kArrayLengths, JSArray::kLengthOffset); } - static HObjectAccess ForAllocationSitePayload() { - return HObjectAccess(kInobject, AllocationSite::kPayloadOffset); + static HObjectAccess ForAllocationSiteTransitionInfo() { + return HObjectAccess(kInobject, AllocationSite::kTransitionInfoOffset); } static HObjectAccess ForFixedArrayLength() { diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 2c3059a..591b870 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -4650,7 +4650,7 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { } site = isolate()->factory()->NewAllocationSite(); - site->set_payload(*raw_boilerplate); + site->set_transition_info(*raw_boilerplate); literals->set(expr->literal_index(), *site); if (JSObject::cast(*raw_boilerplate)->elements()->map() == @@ -4660,7 +4660,7 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { } else { ASSERT(literals_cell->IsAllocationSite()); site = Handle::cast(literals_cell); - raw_boilerplate = Handle(site->payload(), isolate()); + raw_boilerplate = Handle(site->transition_info(), isolate()); } ASSERT(!raw_boilerplate.is_null()); diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc index 293b929..a17b8fc 100644 --- a/src/ia32/code-stubs-ia32.cc +++ b/src/ia32/code-stubs-ia32.cc @@ -7522,7 +7522,7 @@ static void CreateArrayDispatchOneArgument(MacroAssembler* masm) { // Save the resulting elements kind in type info __ SmiTag(edx); - __ mov(FieldOperand(ecx, AllocationSite::kPayloadOffset), edx); + __ mov(FieldOperand(ecx, AllocationSite::kTransitionInfoOffset), edx); __ SmiUntag(edx); __ bind(&normal_sequence); @@ -7633,7 +7633,7 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) { masm->isolate()->heap()->allocation_site_map()))); __ j(not_equal, &no_info); - __ mov(edx, FieldOperand(edx, AllocationSite::kPayloadOffset)); + __ mov(edx, FieldOperand(edx, AllocationSite::kTransitionInfoOffset)); __ SmiUntag(edx); __ jmp(&switch_ready); __ bind(&no_info); diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc index 87ea51c..77efbd8 100644 --- a/src/ia32/stub-cache-ia32.cc +++ b/src/ia32/stub-cache-ia32.cc @@ -1725,7 +1725,7 @@ Handle CallStubCompiler::CompileArrayCodeCall( } Handle site = isolate()->factory()->NewAllocationSite(); - site->set_payload(Smi::FromInt(GetInitialFastElementsKind())); + site->set_transition_info(Smi::FromInt(GetInitialFastElementsKind())); Handle site_feedback_cell = isolate()->factory()->NewCell(site); __ mov(eax, Immediate(argc)); __ mov(ebx, site_feedback_cell); diff --git a/src/objects-inl.h b/src/objects-inl.h index e9ba48a..f251129 100644 --- a/src/objects-inl.h +++ b/src/objects-inl.h @@ -4448,7 +4448,7 @@ ACCESSORS(SignatureInfo, args, Object, kArgsOffset) ACCESSORS(TypeSwitchInfo, types, Object, kTypesOffset) -ACCESSORS(AllocationSite, payload, Object, kPayloadOffset) +ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset) ACCESSORS(AllocationSiteInfo, allocation_site, Object, kAllocationSiteOffset) ACCESSORS(Script, source, Object, kSourceOffset) diff --git a/src/objects-printer.cc b/src/objects-printer.cc index 0d80359..db324d0 100644 --- a/src/objects-printer.cc +++ b/src/objects-printer.cc @@ -1119,9 +1119,9 @@ void TypeSwitchInfo::TypeSwitchInfoPrint(FILE* out) { void AllocationSite::AllocationSitePrint(FILE* out) { HeapObject::PrintHeader(out, "AllocationSite"); - PrintF(out, " - payload: "); - if (payload()->IsCell()) { - Cell* cell = Cell::cast(payload()); + PrintF(out, " - transition_info: "); + if (transition_info()->IsCell()) { + Cell* cell = Cell::cast(transition_info()); Object* cell_contents = cell->value(); if (cell_contents->IsSmi()) { ElementsKind kind = static_cast( @@ -1131,15 +1131,15 @@ void AllocationSite::AllocationSitePrint(FILE* out) { PrintF(out, "\n"); return; } - } else if (payload()->IsJSArray()) { + } else if (transition_info()->IsJSArray()) { PrintF(out, "Array literal "); - payload()->ShortPrint(out); + transition_info()->ShortPrint(out); PrintF(out, "\n"); return; } - PrintF(out, "unknown payload "); - payload()->ShortPrint(out); + PrintF(out, "unknown transition_info"); + transition_info()->ShortPrint(out); PrintF(out, "\n"); } diff --git a/src/objects.cc b/src/objects.cc index 83781f2..239e231 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -12316,13 +12316,13 @@ MaybeObject* JSObject::UpdateAllocationSite(ElementsKind to_kind) { // Walk through to the Allocation Site AllocationSite* site = info->GetAllocationSite(); if (site->IsLiteralSite()) { - JSArray* payload = JSArray::cast(site->payload()); - ElementsKind kind = payload->GetElementsKind(); + JSArray* transition_info = JSArray::cast(site->transition_info()); + ElementsKind kind = transition_info->GetElementsKind(); if (AllocationSite::GetMode(kind, to_kind) == TRACK_ALLOCATION_SITE) { // If the array is huge, it's not likely to be defined in a local // function, so we shouldn't make new instances of it very often. uint32_t length = 0; - CHECK(payload->length()->ToArrayIndex(&length)); + CHECK(transition_info->length()->ToArrayIndex(&length)); if (length <= AllocationSite::kMaximumArrayBytesToPretransition) { if (FLAG_trace_track_allocation_sites) { PrintF( @@ -12331,11 +12331,11 @@ MaybeObject* JSObject::UpdateAllocationSite(ElementsKind to_kind) { ElementsKindToString(kind), ElementsKindToString(to_kind)); } - return payload->TransitionElementsKind(to_kind); + return transition_info->TransitionElementsKind(to_kind); } } } else { - ElementsKind kind = site->GetElementsKindPayload(); + ElementsKind kind = site->GetElementsKind(); if (AllocationSite::GetMode(kind, to_kind) == TRACK_ALLOCATION_SITE) { if (FLAG_trace_track_allocation_sites) { PrintF("AllocationSite: JSArray %p site updated %s->%s\n", @@ -12343,7 +12343,7 @@ MaybeObject* JSObject::UpdateAllocationSite(ElementsKind to_kind) { ElementsKindToString(kind), ElementsKindToString(to_kind)); } - site->set_payload(Smi::FromInt(to_kind)); + site->set_transition_info(Smi::FromInt(to_kind)); } } return this; diff --git a/src/objects.h b/src/objects.h index 7aae786..470d8e8 100644 --- a/src/objects.h +++ b/src/objects.h @@ -7465,31 +7465,30 @@ enum AllocationSiteMode { class AllocationSite: public Struct { public: - static const int kPayloadOffset = HeapObject::kHeaderSize; - static const int kSize = kPayloadOffset + kPointerSize; + static const int kTransitionInfoOffset = HeapObject::kHeaderSize; + static const int kSize = kTransitionInfoOffset + kPointerSize; static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024; - // TODO(mvstanton): rename payload to transition_info. - DECL_ACCESSORS(payload, Object) + DECL_ACCESSORS(transition_info, Object) void Initialize() { - SetElementsKindPayload(GetInitialFastElementsKind()); + SetElementsKind(GetInitialFastElementsKind()); } - ElementsKind GetElementsKindPayload() { + ElementsKind GetElementsKind() { ASSERT(!IsLiteralSite()); - return static_cast(Smi::cast(payload())->value()); + return static_cast(Smi::cast(transition_info())->value()); } - void SetElementsKindPayload(ElementsKind kind) { - set_payload(Smi::FromInt(static_cast(kind))); + void SetElementsKind(ElementsKind kind) { + set_transition_info(Smi::FromInt(static_cast(kind))); } bool IsLiteralSite() { - // If the payload is a smi, then it represents an ElementsKind + // If transition_info is a smi, then it represents an ElementsKind // for a constructed array. Otherwise, it must be a boilerplate // for an array literal - return payload()->IsJSArray(); + return transition_info()->IsJSArray(); } DECLARE_PRINTER(AllocationSite) diff --git a/src/runtime.cc b/src/runtime.cc index 6cf8610..2a473e4 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -515,7 +515,7 @@ static Handle GetLiteralAllocationSite( Runtime::CreateArrayLiteralBoilerplate(isolate, literals, elements); if (boilerplate.is_null()) return site; site = isolate->factory()->NewAllocationSite(); - site->set_payload(*boilerplate); + site->set_transition_info(*boilerplate); literals->set(literals_index, *site); } else { site = Handle::cast(literal_site); @@ -536,7 +536,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateArrayLiteral) { literals_index, elements); RETURN_IF_EMPTY_HANDLE(isolate, site); - JSObject* boilerplate = JSObject::cast(site->payload()); + JSObject* boilerplate = JSObject::cast(site->transition_info()); return boilerplate->DeepCopy(isolate); } @@ -552,7 +552,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateArrayLiteralShallow) { literals_index, elements); RETURN_IF_EMPTY_HANDLE(isolate, site); - JSObject* boilerplate = JSObject::cast(site->payload()); + JSObject* boilerplate = JSObject::cast(site->transition_info()); if (boilerplate->elements()->map() == isolate->heap()->fixed_cow_array_map()) { isolate->counters()->cow_arrays_created_runtime()->Increment(); @@ -5221,7 +5221,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StoreArrayLiteralElement) { JSArray* boilerplate = NULL; if (raw_literal_cell->IsAllocationSite()) { AllocationSite* site = AllocationSite::cast(raw_literal_cell); - boilerplate = JSArray::cast(site->payload()); + boilerplate = JSArray::cast(site->transition_info()); } else { boilerplate = JSArray::cast(raw_literal_cell); } @@ -13845,11 +13845,11 @@ static MaybeObject* ArrayConstructorCommon(Isolate* isolate, Handle site = Handle( AllocationSite::cast(cell->value()), isolate); ASSERT(!site->IsLiteralSite()); - ElementsKind to_kind = site->GetElementsKindPayload(); + ElementsKind to_kind = site->GetElementsKind(); if (holey && !IsFastHoleyElementsKind(to_kind)) { to_kind = GetHoleyElementsKind(to_kind); // Update the allocation site info to reflect the advice alteration. - site->SetElementsKindPayload(to_kind); + site->SetElementsKind(to_kind); } maybe_array = isolate->heap()->AllocateJSObjectWithAllocationSite( diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc index 98c3961..dadc682 100644 --- a/src/x64/code-stubs-x64.cc +++ b/src/x64/code-stubs-x64.cc @@ -6566,7 +6566,7 @@ static void CreateArrayDispatchOneArgument(MacroAssembler* masm) { // Save the resulting elements kind in type info __ Integer32ToSmi(rdx, rdx); - __ movq(FieldOperand(rcx, AllocationSite::kPayloadOffset), rdx); + __ movq(FieldOperand(rcx, AllocationSite::kTransitionInfoOffset), rdx); __ SmiToInteger32(rdx, rdx); __ bind(&normal_sequence); @@ -6678,7 +6678,7 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) { Handle(masm->isolate()->heap()->allocation_site_map())); __ j(not_equal, &no_info); - __ movq(rdx, FieldOperand(rdx, AllocationSite::kPayloadOffset)); + __ movq(rdx, FieldOperand(rdx, AllocationSite::kTransitionInfoOffset)); __ SmiToInteger32(rdx, rdx); __ jmp(&switch_ready); __ bind(&no_info); diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc index 9a1ea8e..ceb3ef1 100644 --- a/src/x64/stub-cache-x64.cc +++ b/src/x64/stub-cache-x64.cc @@ -1642,7 +1642,7 @@ Handle CallStubCompiler::CompileArrayCodeCall( } Handle site = isolate()->factory()->NewAllocationSite(); - site->set_payload(Smi::FromInt(GetInitialFastElementsKind())); + site->set_transition_info(Smi::FromInt(GetInitialFastElementsKind())); Handle site_feedback_cell = isolate()->factory()->NewCell(site); __ movq(rax, Immediate(argc)); __ Move(rbx, site_feedback_cell);