Index: src/x64/code-stubs-x64.cc |
=================================================================== |
--- src/x64/code-stubs-x64.cc (revision 7146) |
+++ src/x64/code-stubs-x64.cc (working copy) |
@@ -46,8 +46,8 @@ |
__ Ret(); |
__ bind(&check_heap_number); |
- __ Move(rbx, Factory::heap_number_map()); |
- __ cmpq(rbx, FieldOperand(rax, HeapObject::kMapOffset)); |
+ __ CompareRoot(FieldOperand(rax, HeapObject::kMapOffset), |
+ Heap::kHeapNumberMapRootIndex); |
__ j(not_equal, &call_builtin); |
__ Ret(); |
@@ -104,7 +104,7 @@ |
__ pop(rdx); |
__ push(rsi); |
__ push(rdx); |
- __ Push(Factory::false_value()); |
+ __ PushRoot(Heap::kFalseValueRootIndex); |
__ push(rcx); // Restore return address. |
__ TailCallRuntime(Runtime::kNewClosure, 3, 1); |
} |
@@ -2493,7 +2493,8 @@ |
// Check that the JSArray is in fast case. |
__ movq(rbx, FieldOperand(rdi, JSArray::kElementsOffset)); |
__ movq(rdi, FieldOperand(rbx, HeapObject::kMapOffset)); |
- __ Cmp(rdi, Factory::fixed_array_map()); |
+ __ CompareRoot(FieldOperand(rbx, HeapObject::kMapOffset), |
+ Heap::kFixedArrayMapRootIndex); |
__ j(not_equal, &runtime); |
// Check that the last match info has space for the capture registers and the |
// additional information. Ensure no overflow in add. |
@@ -2528,8 +2529,8 @@ |
__ testb(rbx, Immediate(kIsNotStringMask | kExternalStringTag)); |
__ j(not_zero, &runtime); |
// String is a cons string. |
- __ movq(rdx, FieldOperand(rdi, ConsString::kSecondOffset)); |
- __ Cmp(rdx, Factory::empty_string()); |
+ __ CompareRoot(FieldOperand(rdi, ConsString::kSecondOffset), |
+ Heap::kEmptyStringRootIndex); |
__ j(not_equal, &runtime); |
__ movq(rdi, FieldOperand(rdi, ConsString::kFirstOffset)); |
__ movq(rbx, FieldOperand(rdi, HeapObject::kMapOffset)); |
@@ -2793,8 +2794,8 @@ |
__ movq(FieldOperand(rax, HeapObject::kMapOffset), rdx); |
// Set empty properties FixedArray. |
- __ Move(FieldOperand(rax, JSObject::kPropertiesOffset), |
- Factory::empty_fixed_array()); |
+ __ LoadRoot(kScratchRegister, Heap::kEmptyFixedArrayRootIndex); |
+ __ movq(FieldOperand(rax, JSObject::kPropertiesOffset), kScratchRegister); |
// Set elements to point to FixedArray allocated right after the JSArray. |
__ lea(rcx, Operand(rax, JSRegExpResult::kSize)); |
@@ -2814,13 +2815,13 @@ |
// rbx: Number of elements in array as int32. |
// Set map. |
- __ Move(FieldOperand(rcx, HeapObject::kMapOffset), |
- Factory::fixed_array_map()); |
+ __ LoadRoot(kScratchRegister, Heap::kFixedArrayMapRootIndex); |
+ __ movq(FieldOperand(rcx, HeapObject::kMapOffset), kScratchRegister); |
// Set length. |
__ Integer32ToSmi(rdx, rbx); |
__ movq(FieldOperand(rcx, FixedArray::kLengthOffset), rdx); |
// Fill contents of fixed-array with the-hole. |
- __ Move(rdx, Factory::the_hole_value()); |
+ __ LoadRoot(rdx, Heap::kTheHoleValueRootIndex); |
__ lea(rcx, FieldOperand(rcx, FixedArray::kHeaderSize)); |
// Fill fixed array elements with hole. |
// rax: JSArray. |
@@ -4945,7 +4946,7 @@ |
__ bind(&index_out_of_range); |
// When the index is out of range, the spec requires us to return |
// the empty string. |
- __ Move(result, Factory::empty_string()); |
+ __ LoadRoot(result, Heap::kEmptyStringRootIndex); |
__ jmp(&done); |
__ bind(&need_conversion); |