Index: src/arm/macro-assembler-arm.cc |
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc |
index a149deed36eadbd57a916d4c1c6e3fad1de9608a..8e187a49f331ea25eb8881eb1b337473d425549a 100644 |
--- a/src/arm/macro-assembler-arm.cc |
+++ b/src/arm/macro-assembler-arm.cc |
@@ -233,7 +233,19 @@ void MacroAssembler::Push(Handle<Object> handle) { |
void MacroAssembler::Move(Register dst, Handle<Object> value) { |
- mov(dst, Operand(value)); |
+ AllowDeferredHandleDereference smi_check; |
+ if (value->IsSmi()) { |
+ mov(dst, Operand(value)); |
+ } else { |
+ ASSERT(value->IsHeapObject()); |
+ if (isolate()->heap()->InNewSpace(*value)) { |
+ Handle<Cell> cell = isolate()->factory()->NewCell(value); |
+ mov(dst, Operand(cell)); |
+ ldr(dst, FieldMemOperand(dst, Cell::kValueOffset)); |
+ } else { |
+ mov(dst, Operand(value)); |
+ } |
+ } |
} |
@@ -394,19 +406,6 @@ void MacroAssembler::StoreRoot(Register source, |
} |
-void MacroAssembler::LoadHeapObject(Register result, |
- Handle<HeapObject> object) { |
- AllowDeferredHandleDereference using_raw_address; |
- if (isolate()->heap()->InNewSpace(*object)) { |
- Handle<Cell> cell = isolate()->factory()->NewCell(object); |
- mov(result, Operand(cell)); |
- ldr(result, FieldMemOperand(result, Cell::kValueOffset)); |
- } else { |
- mov(result, Operand(object)); |
- } |
-} |
- |
- |
void MacroAssembler::InNewSpace(Register object, |
Register scratch, |
Condition cond, |
@@ -1285,7 +1284,7 @@ void MacroAssembler::InvokeFunction(Handle<JSFunction> function, |
ASSERT(flag == JUMP_FUNCTION || has_frame()); |
// Get the function and setup the context. |
- LoadHeapObject(r1, function); |
+ Move(r1, function); |
ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); |
// We call indirectly through the code field in the function to |