Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index 32173008a3cd209b04025b6945043777ba07f42b..d99251e55c5e432eab261203592b23c5435c250e 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -350,6 +350,7 @@ static void GenerateFastCloneShallowArrayCommon( |
// |
// r3: boilerplate literal array. |
ASSERT(mode != FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS); |
+ bool tracking_on = allocation_site_info_mode == TRACK_ALLOCATION_SITE_INFO; |
// All sizes here are multiples of kPointerSize. |
int elements_size = 0; |
@@ -358,12 +359,11 @@ static void GenerateFastCloneShallowArrayCommon( |
? FixedDoubleArray::SizeFor(length) |
: FixedArray::SizeFor(length); |
} |
+ |
int size = JSArray::kSize; |
int allocation_info_start = size; |
- if (allocation_site_info_mode == TRACK_ALLOCATION_SITE_INFO) { |
- size += AllocationSiteInfo::kSize; |
- } |
- size += elements_size; |
+ size += tracking_on ? AllocationSiteInfo::kSize + elements_size |
+ : elements_size; |
// Allocate both the JS array and the elements array in one big |
// allocation. This avoids multiple limit checks. |
@@ -373,7 +373,7 @@ static void GenerateFastCloneShallowArrayCommon( |
} |
__ AllocateInNewSpace(size, r0, r1, r2, fail, flags); |
- if (allocation_site_info_mode == TRACK_ALLOCATION_SITE_INFO) { |
+ if (tracking_on) { |
__ mov(r2, Operand(Handle<Map>(masm->isolate()->heap()-> |
allocation_site_info_map()))); |
__ str(r2, FieldMemOperand(r0, allocation_info_start)); |
@@ -392,7 +392,7 @@ static void GenerateFastCloneShallowArrayCommon( |
// Get hold of the elements array of the boilerplate and setup the |
// elements pointer in the resulting object. |
__ ldr(r3, FieldMemOperand(r3, JSArray::kElementsOffset)); |
- if (allocation_site_info_mode == TRACK_ALLOCATION_SITE_INFO) { |
+ if (tracking_on) { |
__ add(r2, r0, Operand(JSArray::kSize + AllocationSiteInfo::kSize)); |
} else { |
__ add(r2, r0, Operand(JSArray::kSize)); |
@@ -423,22 +423,14 @@ void FastCloneShallowArrayStub::Generate(MacroAssembler* masm) { |
__ b(eq, &slow_case); |
FastCloneShallowArrayStub::Mode mode = mode_; |
- AllocationSiteInfoMode allocation_site_info_mode = |
- DONT_TRACK_ALLOCATION_SITE_INFO; |
- if (mode == CLONE_ANY_ELEMENTS_WITH_ALLOCATION_SITE_INFO) { |
- mode = CLONE_ANY_ELEMENTS; |
- allocation_site_info_mode = TRACK_ALLOCATION_SITE_INFO; |
- } |
- |
if (mode == CLONE_ANY_ELEMENTS) { |
Label double_elements, check_fast_elements; |
__ ldr(r0, FieldMemOperand(r3, JSArray::kElementsOffset)); |
__ ldr(r0, FieldMemOperand(r0, HeapObject::kMapOffset)); |
__ CompareRoot(r0, Heap::kFixedCOWArrayMapRootIndex); |
__ b(ne, &check_fast_elements); |
- GenerateFastCloneShallowArrayCommon(masm, 0, |
- COPY_ON_WRITE_ELEMENTS, |
- allocation_site_info_mode, |
+ GenerateFastCloneShallowArrayCommon(masm, 0, COPY_ON_WRITE_ELEMENTS, |
+ allocation_site_info_mode_, |
&slow_case); |
// Return and remove the on-stack parameters. |
__ add(sp, sp, Operand(3 * kPointerSize)); |
@@ -447,9 +439,8 @@ void FastCloneShallowArrayStub::Generate(MacroAssembler* masm) { |
__ bind(&check_fast_elements); |
__ CompareRoot(r0, Heap::kFixedArrayMapRootIndex); |
__ b(ne, &double_elements); |
- GenerateFastCloneShallowArrayCommon(masm, length_, |
- CLONE_ELEMENTS, |
- allocation_site_info_mode, |
+ GenerateFastCloneShallowArrayCommon(masm, length_, CLONE_ELEMENTS, |
+ allocation_site_info_mode_, |
&slow_case); |
// Return and remove the on-stack parameters. |
__ add(sp, sp, Operand(3 * kPointerSize)); |
@@ -483,7 +474,8 @@ void FastCloneShallowArrayStub::Generate(MacroAssembler* masm) { |
} |
GenerateFastCloneShallowArrayCommon(masm, length_, mode, |
- allocation_site_info_mode, &slow_case); |
+ allocation_site_info_mode_, |
+ &slow_case); |
// Return and remove the on-stack parameters. |
__ add(sp, sp, Operand(3 * kPointerSize)); |