| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" | 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/crankshaft/hydrogen-osr.h" | 9 #include "src/crankshaft/hydrogen-osr.h" |
| 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" | 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 if (strlen(FLAG_stop_at) > 0 && | 106 if (strlen(FLAG_stop_at) > 0 && |
| 107 info_->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 107 info_->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
| 108 __ stop("stop_at"); | 108 __ stop("stop_at"); |
| 109 } | 109 } |
| 110 #endif | 110 #endif |
| 111 | 111 |
| 112 // a1: Callee's JS function. | 112 // a1: Callee's JS function. |
| 113 // cp: Callee's context. | 113 // cp: Callee's context. |
| 114 // fp: Caller's frame pointer. | 114 // fp: Caller's frame pointer. |
| 115 // lr: Caller's pc. | 115 // lr: Caller's pc. |
| 116 | |
| 117 // Sloppy mode functions and builtins need to replace the receiver with the | |
| 118 // global proxy when called as functions (without an explicit receiver | |
| 119 // object). | |
| 120 if (info()->MustReplaceUndefinedReceiverWithGlobalProxy()) { | |
| 121 Label ok; | |
| 122 int receiver_offset = info_->scope()->num_parameters() * kPointerSize; | |
| 123 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | |
| 124 __ ld(a2, MemOperand(sp, receiver_offset)); | |
| 125 __ Branch(&ok, ne, a2, Operand(at)); | |
| 126 | |
| 127 __ ld(a2, GlobalObjectOperand()); | |
| 128 __ ld(a2, FieldMemOperand(a2, JSGlobalObject::kGlobalProxyOffset)); | |
| 129 | |
| 130 __ sd(a2, MemOperand(sp, receiver_offset)); | |
| 131 | |
| 132 __ bind(&ok); | |
| 133 } | |
| 134 } | 116 } |
| 135 | 117 |
| 136 info()->set_prologue_offset(masm_->pc_offset()); | 118 info()->set_prologue_offset(masm_->pc_offset()); |
| 137 if (NeedsEagerFrame()) { | 119 if (NeedsEagerFrame()) { |
| 138 if (info()->IsStub()) { | 120 if (info()->IsStub()) { |
| 139 __ StubPrologue(); | 121 __ StubPrologue(); |
| 140 } else { | 122 } else { |
| 141 __ Prologue(info()->IsCodePreAgingActive()); | 123 __ Prologue(info()->IsCodePreAgingActive()); |
| 142 } | 124 } |
| 143 frame_is_built_ = true; | 125 frame_is_built_ = true; |
| (...skipping 5885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6029 __ Push(at, ToRegister(instr->function())); | 6011 __ Push(at, ToRegister(instr->function())); |
| 6030 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6012 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 6031 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6013 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6032 } | 6014 } |
| 6033 | 6015 |
| 6034 | 6016 |
| 6035 #undef __ | 6017 #undef __ |
| 6036 | 6018 |
| 6037 } // namespace internal | 6019 } // namespace internal |
| 6038 } // namespace v8 | 6020 } // namespace v8 |
| OLD | NEW |