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/v8.h" | 5 #include "src/v8.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/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 #endif | 111 #endif |
112 | 112 |
113 // a1: Callee's JS function. | 113 // a1: Callee's JS function. |
114 // cp: Callee's context. | 114 // cp: Callee's context. |
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 (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 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 125 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
126 __ ld(a2, MemOperand(sp, receiver_offset)); | 126 __ ld(a2, MemOperand(sp, receiver_offset)); |
127 __ Branch(&ok, ne, a2, Operand(at)); | 127 __ Branch(&ok, ne, a2, Operand(at)); |
128 | 128 |
129 __ ld(a2, GlobalObjectOperand()); | 129 __ ld(a2, GlobalObjectOperand()); |
130 __ ld(a2, FieldMemOperand(a2, GlobalObject::kGlobalProxyOffset)); | 130 __ ld(a2, FieldMemOperand(a2, GlobalObject::kGlobalProxyOffset)); |
131 | 131 |
(...skipping 5922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6054 __ li(at, scope_info); | 6054 __ li(at, scope_info); |
6055 __ Push(at, ToRegister(instr->function())); | 6055 __ Push(at, ToRegister(instr->function())); |
6056 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6056 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6057 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6057 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6058 } | 6058 } |
6059 | 6059 |
6060 | 6060 |
6061 #undef __ | 6061 #undef __ |
6062 | 6062 |
6063 } } // namespace v8::internal | 6063 } } // namespace v8::internal |
OLD | NEW |