Chromium Code Reviews| Index: runtime/vm/intermediate_language_ia32.cc |
| =================================================================== |
| --- runtime/vm/intermediate_language_ia32.cc (revision 39726) |
| +++ runtime/vm/intermediate_language_ia32.cc (working copy) |
| @@ -84,6 +84,13 @@ |
| void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| Register result = locs()->in(0).reg(); |
| ASSERT(result == EAX); |
| + |
| + if (compiler->intrinsic_mode()) { |
| + // Intrinsics don't have a frame. |
| + __ ret(); |
| + return; |
| + } |
| + |
| #if defined(DEBUG) |
| __ Comment("Stack Check"); |
| Label done; |
| @@ -930,7 +937,7 @@ |
| const intptr_t kNumInputs = 1; |
| return LocationSummary::Make(isolate, |
| kNumInputs, |
| - Location::RequiresRegister(), |
| + Location::SameAsFirstInput(), |
|
srdjan
2014/09/02 18:48:21
Why this change?
Florian Schneider
2014/09/02 21:03:20
Not strictly necessary, but reduces number of regi
|
| LocationSummary::kNoCall); |
| } |
| @@ -1674,10 +1681,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(); |
| @@ -1690,6 +1699,10 @@ |
| } |
| __ Bind(entry_label()); |
| + if (is_intrinsic_) { |
| + __ EnterStubFrame(); |
| + } |
| + |
| const Code& stub = |
| Code::Handle(isolate, stub_code->GetAllocationStubForClass(cls_)); |
| const ExternalLabel label(stub.EntryPoint()); |
| @@ -1705,6 +1718,9 @@ |
| locs); |
| __ MoveRegister(result_, EAX); |
| compiler->RestoreLiveRegisters(locs); |
| + if (is_intrinsic_) { |
| + __ LeaveFrame(); |
| + } |
| __ jmp(exit_label()); |
| } |
| @@ -1714,7 +1730,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, |
| @@ -1729,6 +1746,7 @@ |
| Instruction* instruction_; |
| const Class& cls_; |
| Register result_; |
| + bool is_intrinsic_; |
| }; |