Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1700)

Unified Diff: src/x64/code-stubs-x64.cc

Issue 140963004: Array constructor shouldn't require a Cell, just an AllocationSite. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Code comments. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index acdc69ecef22fc666e12bbb1ce528cd99e358dcc..13977495bf06a7dbd340d2011a3bbf491d0e0134 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -187,7 +187,7 @@ static void InitializeArrayConstructorDescriptor(
// register state
// rax -- number of arguments
// rdi -- function
- // rbx -- type info cell with elements kind
+ // rbx -- allocation site with elements kind
static Register registers_variable_args[] = { rdi, rbx, rax };
static Register registers_no_args[] = { rdi, rbx };
@@ -5232,7 +5232,7 @@ static void CreateArrayDispatch(MacroAssembler* masm,
static void CreateArrayDispatchOneArgument(MacroAssembler* masm,
AllocationSiteOverrideMode mode) {
- // rbx - type info cell (if mode != DISABLE_ALLOCATION_SITES)
+ // rbx - allocation site (if mode != DISABLE_ALLOCATION_SITES)
// rdx - kind (if mode != DISABLE_ALLOCATION_SITES)
// rax - number of arguments
// rdi - constructor?
@@ -5278,19 +5278,19 @@ static void CreateArrayDispatchOneArgument(MacroAssembler* masm,
// We are going to create a holey array, but our kind is non-holey.
// Fix kind and retry (only if we have an allocation site in the cell).
__ incl(rdx);
- __ movp(rcx, FieldOperand(rbx, Cell::kValueOffset));
+
if (FLAG_debug_code) {
Handle<Map> allocation_site_map =
masm->isolate()->factory()->allocation_site_map();
- __ Cmp(FieldOperand(rcx, 0), allocation_site_map);
- __ Assert(equal, kExpectedAllocationSiteInCell);
+ __ Cmp(FieldOperand(rbx, 0), allocation_site_map);
+ __ Assert(equal, kExpectedAllocationSite);
}
// Save the resulting elements kind in type info. We can't just store r3
// in the AllocationSite::transition_info field because elements kind is
// restricted to a portion of the field...upper bits need to be left alone.
STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
- __ SmiAddConstant(FieldOperand(rcx, AllocationSite::kTransitionInfoOffset),
+ __ SmiAddConstant(FieldOperand(rbx, AllocationSite::kTransitionInfoOffset),
Smi::FromInt(kFastElementsKindPackedToHoley));
__ bind(&normal_sequence);
@@ -5423,13 +5423,13 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) {
// AllocationSite, call an array constructor that doesn't use AllocationSites.
__ Cmp(rbx, undefined_sentinel);
__ j(equal, &no_info);
- __ movp(rdx, FieldOperand(rbx, Cell::kValueOffset));
- __ Cmp(FieldOperand(rdx, 0),
+ __ movp(rbx, FieldOperand(rbx, Cell::kValueOffset));
+ __ Cmp(FieldOperand(rbx, 0),
masm->isolate()->factory()->allocation_site_map());
__ j(not_equal, &no_info);
// Only look at the lower 16 bits of the transition info.
- __ movp(rdx, FieldOperand(rdx, AllocationSite::kTransitionInfoOffset));
+ __ movp(rdx, FieldOperand(rbx, AllocationSite::kTransitionInfoOffset));
__ SmiToInteger32(rdx, rdx);
STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
__ and_(rdx, Immediate(AllocationSite::ElementsKindBits::kMask));
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698