Reviewers: Hannes Payer,
Message:
Hi Hannes, here is the TODO we discussed, to rename AllocationSite::payload.
Thanks,
--Michael
Description:
Rename AllocationSite::payload to AllocationSite::transition_info
BUG=
Please review this at https://codereview.chromium.org/18749004/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/arm/code-stubs-arm.cc
M src/arm/stub-cache-arm.cc
M src/ast.cc
M src/builtins.cc
M src/code-stubs-hydrogen.cc
M src/heap.cc
M src/hydrogen-instructions.h
M src/hydrogen.cc
M src/ia32/code-stubs-ia32.cc
M src/ia32/stub-cache-ia32.cc
M src/objects-inl.h
M src/objects-printer.cc
M src/objects.h
M src/objects.cc
M src/runtime.cc
M src/x64/code-stubs-x64.cc
M src/x64/stub-cache-x64.cc
Index: src/arm/code-stubs-arm.cc
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc
index
58678e78a1a80e5502d5f63b96948344ecd95b27..40544e7893658dbdb3c063d61a2a1806ff82c219
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);
@@ -7084,7 +7084,7 @@ void ArrayConstructorStub::Generate(MacroAssembler*
masm) {
__ Assert(eq, "Expected AllocationSite object in register edx");
}
- __ ldr(r3, FieldMemOperand(r3, AllocationSite::kPayloadOffset));
+ __ ldr(r3, FieldMemOperand(r3, AllocationSite::kTransitionInfoOffset));
__ SmiUntag(r3);
__ jmp(&switch_ready);
__ bind(&no_info);
Index: src/arm/stub-cache-arm.cc
diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc
index
fc41ef97db940e19a2225cbcb7e5ce610cbe948b..3189cf8f9e2f1c27e214fbaf44bb700d46923a7e
100644
--- a/src/arm/stub-cache-arm.cc
+++ b/src/arm/stub-cache-arm.cc
@@ -1729,7 +1729,7 @@ Handle<Code> CallStubCompiler::CompileArrayCodeCall(
}
Handle<AllocationSite> site = isolate()->factory()->NewAllocationSite();
- site->set_payload(Smi::FromInt(GetInitialFastElementsKind()));
+ site->set_transition_info(Smi::FromInt(GetInitialFastElementsKind()));
Handle<Cell> site_feedback_cell = isolate()->factory()->NewCell(site);
__ mov(r0, Operand(argc));
__ mov(r2, Operand(site_feedback_cell));
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index
721878b7650746d6eff705defe4c754869509e5f..bf111f81126b44893431a6e085b3e6bf022a9976
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();
}
}
}
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index
d17137f2289f8a82326fef5953de930dbff9be94..f081e3d23b50f95b2ca46914d9e38b7c81d9ec3a
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
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index
4d1c27c0e685cd0e8d7713a6c36026d1032cc448..51734da2f16a754110d4acb04f6192e2aeb10664
100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -446,7 +446,7 @@ HValue*
CodeStubGraphBuilder<CreateAllocationSiteStub>::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.
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index
5fc79f6a39b9641f94268bb5b3ee2dcf516926c3..54e38fe68465a44af63e1d1a43ac7f61bf039fd0
100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -4547,7 +4547,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<ElementsKind>(smi->value());
AllocationSiteMode mode = TRACK_ALLOCATION_SITE;
if (to_kind != initial_map->elements_kind()) {
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index
22de75b19390c7300f4324722dd9adcc127834ee..9e8ba7665478e427be342b85716f47a39de86efb
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() {
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index
2c3059a44d8671fc5ec2f4bd7d82ed38a3b75091..591b870a44292e3cc0bf947248d370f23a01a836
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<AllocationSite>::cast(literals_cell);
- raw_boilerplate = Handle<Object>(site->payload(), isolate());
+ raw_boilerplate = Handle<Object>(site->transition_info(), isolate());
}
ASSERT(!raw_boilerplate.is_null());
Index: src/ia32/code-stubs-ia32.cc
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc
index
093794bdcc834c95250812103db57412ab08403e..fd2bb5c7d59783071d344e78906b9e4f22fbbf24
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);
@@ -7636,7 +7636,7 @@ void ArrayConstructorStub::Generate(MacroAssembler*
masm) {
__ Assert(equal, "Expected AllocationSite object in register edx");
}
- __ mov(edx, FieldOperand(edx, AllocationSite::kPayloadOffset));
+ __ mov(edx, FieldOperand(edx, AllocationSite::kTransitionInfoOffset));
__ SmiUntag(edx);
__ jmp(&switch_ready);
__ bind(&no_info);
Index: src/ia32/stub-cache-ia32.cc
diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc
index
87ea51c8ddd70bcfa1cd80ce917c2f286b98fa2b..77efbd869e240ecbf986b9a528ad75703b90e05b
100644
--- a/src/ia32/stub-cache-ia32.cc
+++ b/src/ia32/stub-cache-ia32.cc
@@ -1725,7 +1725,7 @@ Handle<Code> CallStubCompiler::CompileArrayCodeCall(
}
Handle<AllocationSite> site = isolate()->factory()->NewAllocationSite();
- site->set_payload(Smi::FromInt(GetInitialFastElementsKind()));
+ site->set_transition_info(Smi::FromInt(GetInitialFastElementsKind()));
Handle<Cell> site_feedback_cell = isolate()->factory()->NewCell(site);
__ mov(eax, Immediate(argc));
__ mov(ebx, site_feedback_cell);
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index
e9ba48a60db25d5d71c625947e27652ea9a07679..f25112939cada014a807e9c7c35d2d61d8230a75
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)
Index: src/objects-printer.cc
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index
0d803590d7cca1761b0081eb65348ebfb3abb42f..2140af222c477b4c4c093bad47c368e70d66a8f0
100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -1120,8 +1120,8 @@ 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());
+ if (transition_info()->IsCell()) {
+ Cell* cell = Cell::cast(transition_info());
Object* cell_contents = cell->value();
if (cell_contents->IsSmi()) {
ElementsKind kind = static_cast<ElementsKind>(
@@ -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");
}
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index
4c00cb853ed9a749afc50d08c32b9c498415df7f..dfb3428f489e0a5e640002c70f76445a86c3c41e
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;
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index
7aae7864d6528fdf5f124fb5e201dd0ab1d298dd..6c1e50ddf21cc0c9bf7ba26f6de7e42aa6ea0351
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<ElementsKind>(Smi::cast(payload())->value());
+ return
static_cast<ElementsKind>(Smi::cast(transition_info())->value());
}
- void SetElementsKindPayload(ElementsKind kind) {
- set_payload(Smi::FromInt(static_cast<int>(kind)));
+ void SetElementsKind(ElementsKind kind) {
+ set_transition_info(Smi::FromInt(static_cast<int>(kind)));
}
bool IsLiteralSite() {
// If the payload 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)
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index
6cf8610854f89c55a04b7abe986fc273a060d67c..2a473e437179b5518c6a9dc8627d5bf37e668aba
100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -515,7 +515,7 @@ static Handle<AllocationSite> 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<AllocationSite>::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<AllocationSite> site = Handle<AllocationSite>(
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(
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index
3338013be8b0f178e6859c5c091de0a6068579d7..8747b1991b7c80d0cd56d3280a2cc3db2e6162ba
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);
@@ -6680,7 +6680,7 @@ void ArrayConstructorStub::Generate(MacroAssembler*
masm) {
__ Assert(equal, "Expected AllocationSite object in register rdx");
}
- __ movq(rdx, FieldOperand(rdx, AllocationSite::kPayloadOffset));
+ __ movq(rdx, FieldOperand(rdx, AllocationSite::kTransitionInfoOffset));
__ SmiToInteger32(rdx, rdx);
__ jmp(&switch_ready);
__ bind(&no_info);
Index: src/x64/stub-cache-x64.cc
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc
index
9a1ea8e6d97698ca6767a650dedd313e6c274c08..ceb3ef161a4fad1273fdc83cfe9713c68cbe9a2e
100644
--- a/src/x64/stub-cache-x64.cc
+++ b/src/x64/stub-cache-x64.cc
@@ -1642,7 +1642,7 @@ Handle<Code> CallStubCompiler::CompileArrayCodeCall(
}
Handle<AllocationSite> site = isolate()->factory()->NewAllocationSite();
- site->set_payload(Smi::FromInt(GetInitialFastElementsKind()));
+ site->set_transition_info(Smi::FromInt(GetInitialFastElementsKind()));
Handle<Cell> site_feedback_cell = isolate()->factory()->NewCell(site);
__ movq(rax, Immediate(argc));
__ Move(rbx, site_feedback_cell);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.