| 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/arm/lithium-codegen-arm.h" | 5 #include "src/crankshaft/arm/lithium-codegen-arm.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/arm/lithium-gap-resolver-arm.h" | 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // global proxy when called as functions (without an explicit receiver | 120 // global proxy when called as functions (without an explicit receiver |
| 121 // object). | 121 // object). |
| 122 if (info()->MustReplaceUndefinedReceiverWithGlobalProxy()) { | 122 if (info()->MustReplaceUndefinedReceiverWithGlobalProxy()) { |
| 123 Label ok; | 123 Label ok; |
| 124 int receiver_offset = info_->scope()->num_parameters() * kPointerSize; | 124 int receiver_offset = info_->scope()->num_parameters() * kPointerSize; |
| 125 __ ldr(r2, MemOperand(sp, receiver_offset)); | 125 __ ldr(r2, MemOperand(sp, receiver_offset)); |
| 126 __ CompareRoot(r2, Heap::kUndefinedValueRootIndex); | 126 __ CompareRoot(r2, Heap::kUndefinedValueRootIndex); |
| 127 __ b(ne, &ok); | 127 __ b(ne, &ok); |
| 128 | 128 |
| 129 __ ldr(r2, GlobalObjectOperand()); | 129 __ ldr(r2, GlobalObjectOperand()); |
| 130 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalProxyOffset)); | 130 __ ldr(r2, FieldMemOperand(r2, JSGlobalObject::kGlobalProxyOffset)); |
| 131 | 131 |
| 132 __ str(r2, MemOperand(sp, receiver_offset)); | 132 __ str(r2, MemOperand(sp, receiver_offset)); |
| 133 | 133 |
| 134 __ bind(&ok); | 134 __ bind(&ok); |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 | 137 |
| 138 info()->set_prologue_offset(masm_->pc_offset()); | 138 info()->set_prologue_offset(masm_->pc_offset()); |
| 139 if (NeedsEagerFrame()) { | 139 if (NeedsEagerFrame()) { |
| 140 if (info()->IsStub()) { | 140 if (info()->IsStub()) { |
| (...skipping 3164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3305 __ SmiTst(receiver); | 3305 __ SmiTst(receiver); |
| 3306 DeoptimizeIf(eq, instr, Deoptimizer::kSmi); | 3306 DeoptimizeIf(eq, instr, Deoptimizer::kSmi); |
| 3307 __ CompareObjectType(receiver, scratch, scratch, FIRST_SPEC_OBJECT_TYPE); | 3307 __ CompareObjectType(receiver, scratch, scratch, FIRST_SPEC_OBJECT_TYPE); |
| 3308 DeoptimizeIf(lt, instr, Deoptimizer::kNotAJavaScriptObject); | 3308 DeoptimizeIf(lt, instr, Deoptimizer::kNotAJavaScriptObject); |
| 3309 | 3309 |
| 3310 __ b(&result_in_receiver); | 3310 __ b(&result_in_receiver); |
| 3311 __ bind(&global_object); | 3311 __ bind(&global_object); |
| 3312 __ ldr(result, FieldMemOperand(function, JSFunction::kContextOffset)); | 3312 __ ldr(result, FieldMemOperand(function, JSFunction::kContextOffset)); |
| 3313 __ ldr(result, | 3313 __ ldr(result, |
| 3314 ContextOperand(result, Context::GLOBAL_OBJECT_INDEX)); | 3314 ContextOperand(result, Context::GLOBAL_OBJECT_INDEX)); |
| 3315 __ ldr(result, FieldMemOperand(result, GlobalObject::kGlobalProxyOffset)); | 3315 __ ldr(result, FieldMemOperand(result, JSGlobalObject::kGlobalProxyOffset)); |
| 3316 | 3316 |
| 3317 if (result.is(receiver)) { | 3317 if (result.is(receiver)) { |
| 3318 __ bind(&result_in_receiver); | 3318 __ bind(&result_in_receiver); |
| 3319 } else { | 3319 } else { |
| 3320 Label result_ok; | 3320 Label result_ok; |
| 3321 __ b(&result_ok); | 3321 __ b(&result_ok); |
| 3322 __ bind(&result_in_receiver); | 3322 __ bind(&result_in_receiver); |
| 3323 __ mov(result, receiver); | 3323 __ mov(result, receiver); |
| 3324 __ bind(&result_ok); | 3324 __ bind(&result_ok); |
| 3325 } | 3325 } |
| (...skipping 2466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5792 __ push(ToRegister(instr->function())); | 5792 __ push(ToRegister(instr->function())); |
| 5793 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5793 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5794 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5794 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5795 } | 5795 } |
| 5796 | 5796 |
| 5797 | 5797 |
| 5798 #undef __ | 5798 #undef __ |
| 5799 | 5799 |
| 5800 } // namespace internal | 5800 } // namespace internal |
| 5801 } // namespace v8 | 5801 } // namespace v8 |
| OLD | NEW |