ARM64: Fix some stub-cache TODOs

BUG=
R=ulan@chromium.org

Review URL: https://codereview.chromium.org/208023002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20164 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6c417833
...@@ -394,22 +394,21 @@ void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, ...@@ -394,22 +394,21 @@ void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm,
} else if (representation.IsHeapObject()) { } else if (representation.IsHeapObject()) {
__ JumpIfSmi(value_reg, miss_label); __ JumpIfSmi(value_reg, miss_label);
} else if (representation.IsDouble()) { } else if (representation.IsDouble()) {
UseScratchRegisterScope temps(masm);
Register temp_double = temps.AcquireD();
__ SmiUntagToDouble(temp_double, value_reg, kSpeculativeUntag);
Label do_store, heap_number; Label do_store, heap_number;
__ AllocateHeapNumber(storage_reg, slow, scratch1, scratch2); __ AllocateHeapNumber(storage_reg, slow, scratch1, scratch2);
// TODO(jbramley): Is fp_scratch the most appropriate FP scratch register? __ JumpIfSmi(value_reg, &do_store);
// It's only used in Fcmp, but it's not really safe to use it like this.
__ JumpIfNotSmi(value_reg, &heap_number);
__ SmiUntagToDouble(fp_scratch, value_reg);
__ B(&do_store);
__ Bind(&heap_number);
__ CheckMap(value_reg, scratch1, Heap::kHeapNumberMapRootIndex, __ CheckMap(value_reg, scratch1, Heap::kHeapNumberMapRootIndex,
miss_label, DONT_DO_SMI_CHECK); miss_label, DONT_DO_SMI_CHECK);
__ Ldr(fp_scratch, FieldMemOperand(value_reg, HeapNumber::kValueOffset)); __ Ldr(temp_double, FieldMemOperand(value_reg, HeapNumber::kValueOffset));
__ Bind(&do_store); __ Bind(&do_store);
__ Str(fp_scratch, FieldMemOperand(storage_reg, HeapNumber::kValueOffset)); __ Str(temp_double, FieldMemOperand(storage_reg, HeapNumber::kValueOffset));
} }
// Stub never generated for non-global objects that require access checks. // Stub never generated for non-global objects that require access checks.
...@@ -546,6 +545,11 @@ void StoreStubCompiler::GenerateStoreField(MacroAssembler* masm, ...@@ -546,6 +545,11 @@ void StoreStubCompiler::GenerateStoreField(MacroAssembler* masm,
} else if (representation.IsHeapObject()) { } else if (representation.IsHeapObject()) {
__ JumpIfSmi(value_reg, miss_label); __ JumpIfSmi(value_reg, miss_label);
} else if (representation.IsDouble()) { } else if (representation.IsDouble()) {
UseScratchRegisterScope temps(masm);
Register temp_double = temps.AcquireD();
__ SmiUntagToDouble(temp_double, value_reg, kSpeculativeUntag);
// Load the double storage. // Load the double storage.
if (index < 0) { if (index < 0) {
int offset = (index * kPointerSize) + object->map()->instance_size(); int offset = (index * kPointerSize) + object->map()->instance_size();
...@@ -559,19 +563,15 @@ void StoreStubCompiler::GenerateStoreField(MacroAssembler* masm, ...@@ -559,19 +563,15 @@ void StoreStubCompiler::GenerateStoreField(MacroAssembler* masm,
// Store the value into the storage. // Store the value into the storage.
Label do_store, heap_number; Label do_store, heap_number;
// TODO(jbramley): Is fp_scratch the most appropriate FP scratch register?
// It's only used in Fcmp, but it's not really safe to use it like this.
__ JumpIfNotSmi(value_reg, &heap_number);
__ SmiUntagToDouble(fp_scratch, value_reg);
__ B(&do_store);
__ Bind(&heap_number); __ JumpIfSmi(value_reg, &do_store);
__ CheckMap(value_reg, scratch2, Heap::kHeapNumberMapRootIndex, __ CheckMap(value_reg, scratch2, Heap::kHeapNumberMapRootIndex,
miss_label, DONT_DO_SMI_CHECK); miss_label, DONT_DO_SMI_CHECK);
__ Ldr(fp_scratch, FieldMemOperand(value_reg, HeapNumber::kValueOffset)); __ Ldr(temp_double, FieldMemOperand(value_reg, HeapNumber::kValueOffset));
__ Bind(&do_store); __ Bind(&do_store);
__ Str(fp_scratch, FieldMemOperand(scratch1, HeapNumber::kValueOffset)); __ Str(temp_double, FieldMemOperand(scratch1, HeapNumber::kValueOffset));
// Return the value (register x0). // Return the value (register x0).
ASSERT(value_reg.is(x0)); ASSERT(value_reg.is(x0));
...@@ -1009,12 +1009,9 @@ void LoadStubCompiler::GenerateLoadCallback( ...@@ -1009,12 +1009,9 @@ void LoadStubCompiler::GenerateLoadCallback(
} else { } else {
__ Mov(scratch3(), Operand(Handle<Object>(callback->data(), isolate()))); __ Mov(scratch3(), Operand(Handle<Object>(callback->data(), isolate())));
} }
// TODO(jbramley): Find another scratch register and combine the pushes
// together. Can we use scratch1() here?
__ LoadRoot(scratch4(), Heap::kUndefinedValueRootIndex); __ LoadRoot(scratch4(), Heap::kUndefinedValueRootIndex);
__ Push(scratch3(), scratch4()); __ Mov(scratch2(), Operand(ExternalReference::isolate_address(isolate())));
__ Mov(scratch3(), ExternalReference::isolate_address(isolate())); __ Push(scratch3(), scratch4(), scratch4(), scratch2(), reg, name());
__ Push(scratch4(), scratch3(), reg, name());
Register args_addr = scratch2(); Register args_addr = scratch2();
__ Add(args_addr, __ StackPointer(), kPointerSize); __ Add(args_addr, __ StackPointer(), kPointerSize);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment