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/arm/lithium-codegen-arm.h" | 5 #include "src/arm/lithium-codegen-arm.h" |
6 #include "src/arm/lithium-gap-resolver-arm.h" | 6 #include "src/arm/lithium-gap-resolver-arm.h" |
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/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 // r1: Callee's JS function. | 112 // r1: Callee's JS function. |
113 // cp: Callee's context. | 113 // cp: Callee's context. |
114 // pp: Callee's constant pool pointer (if enabled) | 114 // pp: Callee's constant pool pointer (if enabled) |
115 // fp: Caller's frame pointer. | 115 // fp: Caller's frame pointer. |
116 // lr: Caller's pc. | 116 // lr: Caller's pc. |
117 | 117 |
118 // Sloppy mode functions and builtins need to replace the receiver with the | 118 // Sloppy mode functions and builtins need to replace the receiver with the |
119 // global proxy when called as functions (without an explicit receiver | 119 // global proxy when called as functions (without an explicit receiver |
120 // object). | 120 // object). |
121 if (is_sloppy(info_->language_mode()) && info()->MayUseThis() && | 121 if (info()->MustReplaceUndefinedReceiverWithGlobalProxy()) { |
122 !info_->is_native() && info_->scope()->has_this_declaration()) { | |
123 Label ok; | 122 Label ok; |
124 int receiver_offset = info_->scope()->num_parameters() * kPointerSize; | 123 int receiver_offset = info_->scope()->num_parameters() * kPointerSize; |
125 __ ldr(r2, MemOperand(sp, receiver_offset)); | 124 __ ldr(r2, MemOperand(sp, receiver_offset)); |
126 __ CompareRoot(r2, Heap::kUndefinedValueRootIndex); | 125 __ CompareRoot(r2, Heap::kUndefinedValueRootIndex); |
127 __ b(ne, &ok); | 126 __ b(ne, &ok); |
128 | 127 |
129 __ ldr(r2, GlobalObjectOperand()); | 128 __ ldr(r2, GlobalObjectOperand()); |
130 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalProxyOffset)); | 129 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalProxyOffset)); |
131 | 130 |
132 __ str(r2, MemOperand(sp, receiver_offset)); | 131 __ str(r2, MemOperand(sp, receiver_offset)); |
(...skipping 5740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5873 __ push(ToRegister(instr->function())); | 5872 __ push(ToRegister(instr->function())); |
5874 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5873 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5875 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5874 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5876 } | 5875 } |
5877 | 5876 |
5878 | 5877 |
5879 #undef __ | 5878 #undef __ |
5880 | 5879 |
5881 } // namespace internal | 5880 } // namespace internal |
5882 } // namespace v8 | 5881 } // namespace v8 |
OLD | NEW |