| Index: runtime/vm/intermediate_language_x64.cc
|
| ===================================================================
|
| --- runtime/vm/intermediate_language_x64.cc (revision 39909)
|
| +++ runtime/vm/intermediate_language_x64.cc (working copy)
|
| @@ -83,6 +83,13 @@
|
| void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register result = locs()->in(0).reg();
|
| ASSERT(result == RAX);
|
| +
|
| + if (compiler->intrinsic_mode()) {
|
| + // Intrinsics don't have a frame.
|
| + __ ret();
|
| + return;
|
| + }
|
| +
|
| #if defined(DEBUG)
|
| __ Comment("Stack Check");
|
| Label done;
|
| @@ -1508,10 +1515,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();
|
| @@ -1524,6 +1533,10 @@
|
| }
|
| __ Bind(entry_label());
|
|
|
| + if (is_intrinsic_) {
|
| + __ EnterStubFrame(true);
|
| + }
|
| +
|
| const Code& stub =
|
| Code::Handle(isolate, stub_code->GetAllocationStubForClass(cls_));
|
| const ExternalLabel label(stub.EntryPoint());
|
| @@ -1539,6 +1552,9 @@
|
| locs);
|
| __ MoveRegister(result_, RAX);
|
| compiler->RestoreLiveRegisters(locs);
|
| + if (is_intrinsic_) {
|
| + __ LeaveStubFrame();
|
| + }
|
| __ jmp(exit_label());
|
| }
|
|
|
| @@ -1547,7 +1563,8 @@
|
| const Class& cls,
|
| Register result) {
|
| BoxAllocationSlowPath* slow_path =
|
| - new BoxAllocationSlowPath(instruction, cls, result);
|
| + new BoxAllocationSlowPath(instruction, cls, result,
|
| + compiler->intrinsic_mode());
|
| compiler->AddSlowPathCode(slow_path);
|
|
|
| __ TryAllocate(cls,
|
| @@ -1561,7 +1578,8 @@
|
| private:
|
| Instruction* instruction_;
|
| const Class& cls_;
|
| - Register result_;
|
| + const Register result_;
|
| + const bool is_intrinsic_;
|
| };
|
|
|
|
|
|
|