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/v8.h" | 5 #include "src/v8.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/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // r4: Callee's JS function. | 111 // r4: Callee's JS function. |
112 // cp: Callee's context. | 112 // cp: Callee's context. |
113 // pp: Callee's constant pool pointer (if enabled) | 113 // pp: Callee's constant pool pointer (if enabled) |
114 // fp: Caller's frame pointer. | 114 // fp: Caller's frame pointer. |
115 // lr: Caller's pc. | 115 // lr: Caller's pc. |
116 // ip: Our own function entry (required by the prologue) | 116 // ip: Our own function entry (required by the prologue) |
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 (graph()->this_has_uses() && is_sloppy(info_->language_mode()) && | 121 if (is_sloppy(info_->language_mode()) && info()->MayUseThis() && |
122 !info_->is_native()) { | 122 !info_->is_native()) { |
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 __ LoadP(r5, MemOperand(sp, receiver_offset)); | 125 __ LoadP(r5, MemOperand(sp, receiver_offset)); |
126 __ CompareRoot(r5, Heap::kUndefinedValueRootIndex); | 126 __ CompareRoot(r5, Heap::kUndefinedValueRootIndex); |
127 __ bne(&ok); | 127 __ bne(&ok); |
128 | 128 |
129 __ LoadP(r5, GlobalObjectOperand()); | 129 __ LoadP(r5, GlobalObjectOperand()); |
130 __ LoadP(r5, FieldMemOperand(r5, GlobalObject::kGlobalProxyOffset)); | 130 __ LoadP(r5, FieldMemOperand(r5, GlobalObject::kGlobalProxyOffset)); |
131 | 131 |
(...skipping 6073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6205 __ Push(scope_info); | 6205 __ Push(scope_info); |
6206 __ push(ToRegister(instr->function())); | 6206 __ push(ToRegister(instr->function())); |
6207 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6207 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6208 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6208 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6209 } | 6209 } |
6210 | 6210 |
6211 | 6211 |
6212 #undef __ | 6212 #undef __ |
6213 } | 6213 } |
6214 } // namespace v8::internal | 6214 } // namespace v8::internal |
OLD | NEW |