Chromium Code Reviews| Index: runtime/vm/intermediate_language_arm64.cc |
| =================================================================== |
| --- runtime/vm/intermediate_language_arm64.cc (revision 39909) |
| +++ runtime/vm/intermediate_language_arm64.cc (working copy) |
| @@ -61,7 +61,7 @@ |
| } else { |
| ASSERT(value.IsStackSlot()); |
| const intptr_t value_offset = value.ToStackSlotOffset(); |
| - __ LoadFromOffset(TMP, FP, value_offset, PP); |
| + __ LoadFromOffset(TMP, value.base_reg(), value_offset, PP); |
| __ Push(TMP); |
| } |
| } |
| @@ -85,6 +85,13 @@ |
| void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| const Register result = locs()->in(0).reg(); |
| ASSERT(result == R0); |
| + |
| + if (compiler->intrinsic_mode()) { |
| + // Intrinsics don't have a frame. |
| + __ ret(); |
| + return; |
| + } |
| + |
| #if defined(DEBUG) |
| Label stack_ok; |
| __ Comment("Stack Check"); |
| @@ -1575,10 +1582,12 @@ |
| public: |
| BoxAllocationSlowPath(Instruction* instruction, |
| const Class& cls, |
| - Register result) |
| + Register result, |
| + bool is_intrinsic) |
| : instruction_(instruction), |
| cls_(cls), |
| - result_(result) { } |
| + result_(result), |
| + is_intrinsic_(is_intrinsic) { } |
| virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
| Isolate* isolate = compiler->isolate(); |
| @@ -1591,6 +1600,10 @@ |
| } |
| __ Bind(entry_label()); |
| + if (is_intrinsic_) { |
| + __ EnterStubFrame(true); |
| + } |
| + |
| const Code& stub = |
| Code::Handle(isolate, stub_code->GetAllocationStubForClass(cls_)); |
| const ExternalLabel label(stub.EntryPoint()); |
| @@ -1607,6 +1620,9 @@ |
| __ mov(result_, R0); |
| compiler->RestoreLiveRegisters(locs); |
|
Vyacheslav Egorov (Google)
2014/09/09 21:30:50
Did you verify that we use a correct safe-point wh
Florian Schneider
2014/09/10 14:20:41
As discussed, I avoid generating the slow-path for
|
| + if (is_intrinsic_) { |
| + __ LeaveStubFrame(); |
| + } |
| __ b(exit_label()); |
| } |
| @@ -1616,7 +1632,8 @@ |
| Register result, |
| Register temp) { |
| BoxAllocationSlowPath* slow_path = |
| - new BoxAllocationSlowPath(instruction, cls, result); |
| + new BoxAllocationSlowPath(instruction, cls, result, |
| + compiler->intrinsic_mode()); |
| compiler->AddSlowPathCode(slow_path); |
| __ TryAllocate(cls, |
| @@ -1630,7 +1647,8 @@ |
| private: |
| Instruction* instruction_; |
| const Class& cls_; |
| - Register result_; |
| + const Register result_; |
| + const bool is_intrinsic_; |
| }; |