OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ppc/lithium-codegen-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/crankshaft/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // global proxy when called as functions (without an explicit receiver | 122 // global proxy when called as functions (without an explicit receiver |
123 // object). | 123 // object). |
124 if (info()->MustReplaceUndefinedReceiverWithGlobalProxy()) { | 124 if (info()->MustReplaceUndefinedReceiverWithGlobalProxy()) { |
125 Label ok; | 125 Label ok; |
126 int receiver_offset = info_->scope()->num_parameters() * kPointerSize; | 126 int receiver_offset = info_->scope()->num_parameters() * kPointerSize; |
127 __ LoadP(r5, MemOperand(sp, receiver_offset)); | 127 __ LoadP(r5, MemOperand(sp, receiver_offset)); |
128 __ CompareRoot(r5, Heap::kUndefinedValueRootIndex); | 128 __ CompareRoot(r5, Heap::kUndefinedValueRootIndex); |
129 __ bne(&ok); | 129 __ bne(&ok); |
130 | 130 |
131 __ LoadP(r5, GlobalObjectOperand()); | 131 __ LoadP(r5, GlobalObjectOperand()); |
132 __ LoadP(r5, FieldMemOperand(r5, GlobalObject::kGlobalProxyOffset)); | 132 __ LoadP(r5, FieldMemOperand(r5, JSGlobalObject::kGlobalProxyOffset)); |
133 | 133 |
134 __ StoreP(r5, MemOperand(sp, receiver_offset)); | 134 __ StoreP(r5, MemOperand(sp, receiver_offset)); |
135 | 135 |
136 __ bind(&ok); | 136 __ bind(&ok); |
137 } | 137 } |
138 } | 138 } |
139 | 139 |
140 int prologue_offset = masm_->pc_offset(); | 140 int prologue_offset = masm_->pc_offset(); |
141 | 141 |
142 if (prologue_offset) { | 142 if (prologue_offset) { |
(...skipping 3353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3496 // Deoptimize if the receiver is not a JS object. | 3496 // Deoptimize if the receiver is not a JS object. |
3497 __ TestIfSmi(receiver, r0); | 3497 __ TestIfSmi(receiver, r0); |
3498 DeoptimizeIf(eq, instr, Deoptimizer::kSmi, cr0); | 3498 DeoptimizeIf(eq, instr, Deoptimizer::kSmi, cr0); |
3499 __ CompareObjectType(receiver, scratch, scratch, FIRST_SPEC_OBJECT_TYPE); | 3499 __ CompareObjectType(receiver, scratch, scratch, FIRST_SPEC_OBJECT_TYPE); |
3500 DeoptimizeIf(lt, instr, Deoptimizer::kNotAJavaScriptObject); | 3500 DeoptimizeIf(lt, instr, Deoptimizer::kNotAJavaScriptObject); |
3501 | 3501 |
3502 __ b(&result_in_receiver); | 3502 __ b(&result_in_receiver); |
3503 __ bind(&global_object); | 3503 __ bind(&global_object); |
3504 __ LoadP(result, FieldMemOperand(function, JSFunction::kContextOffset)); | 3504 __ LoadP(result, FieldMemOperand(function, JSFunction::kContextOffset)); |
3505 __ LoadP(result, ContextOperand(result, Context::GLOBAL_OBJECT_INDEX)); | 3505 __ LoadP(result, ContextOperand(result, Context::GLOBAL_OBJECT_INDEX)); |
3506 __ LoadP(result, FieldMemOperand(result, GlobalObject::kGlobalProxyOffset)); | 3506 __ LoadP(result, FieldMemOperand(result, JSGlobalObject::kGlobalProxyOffset)); |
3507 if (result.is(receiver)) { | 3507 if (result.is(receiver)) { |
3508 __ bind(&result_in_receiver); | 3508 __ bind(&result_in_receiver); |
3509 } else { | 3509 } else { |
3510 Label result_ok; | 3510 Label result_ok; |
3511 __ b(&result_ok); | 3511 __ b(&result_ok); |
3512 __ bind(&result_in_receiver); | 3512 __ bind(&result_in_receiver); |
3513 __ mr(result, receiver); | 3513 __ mr(result, receiver); |
3514 __ bind(&result_ok); | 3514 __ bind(&result_ok); |
3515 } | 3515 } |
3516 } | 3516 } |
(...skipping 2563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6080 __ Push(scope_info); | 6080 __ Push(scope_info); |
6081 __ push(ToRegister(instr->function())); | 6081 __ push(ToRegister(instr->function())); |
6082 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6082 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6083 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6083 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6084 } | 6084 } |
6085 | 6085 |
6086 | 6086 |
6087 #undef __ | 6087 #undef __ |
6088 } // namespace internal | 6088 } // namespace internal |
6089 } // namespace v8 | 6089 } // namespace v8 |
OLD | NEW |