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/base/bits.h" | 5 #include "src/base/bits.h" |
6 #include "src/code-factory.h" | 6 #include "src/code-factory.h" |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/cpu-profiler.h" | 8 #include "src/cpu-profiler.h" |
9 #include "src/hydrogen-osr.h" | 9 #include "src/hydrogen-osr.h" |
10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // r4: Callee's JS function. | 113 // r4: Callee's JS function. |
114 // cp: Callee's context. | 114 // cp: Callee's context. |
115 // pp: Callee's constant pool pointer (if enabled) | 115 // pp: Callee's constant pool pointer (if enabled) |
116 // fp: Caller's frame pointer. | 116 // fp: Caller's frame pointer. |
117 // lr: Caller's pc. | 117 // lr: Caller's pc. |
118 // ip: Our own function entry (required by the prologue) | 118 // ip: Our own function entry (required by the prologue) |
119 | 119 |
120 // Sloppy mode functions and builtins need to replace the receiver with the | 120 // Sloppy mode functions and builtins need to replace the receiver with the |
121 // global proxy when called as functions (without an explicit receiver | 121 // global proxy when called as functions (without an explicit receiver |
122 // object). | 122 // object). |
123 if (is_sloppy(info_->language_mode()) && info_->MayUseThis() && | 123 if (info()->MustReplaceUndefinedReceiverWithGlobalProxy()) { |
124 !info_->is_native() && info_->scope()->has_this_declaration()) { | |
125 Label ok; | 124 Label ok; |
126 int receiver_offset = info_->scope()->num_parameters() * kPointerSize; | 125 int receiver_offset = info_->scope()->num_parameters() * kPointerSize; |
127 __ LoadP(r5, MemOperand(sp, receiver_offset)); | 126 __ LoadP(r5, MemOperand(sp, receiver_offset)); |
128 __ CompareRoot(r5, Heap::kUndefinedValueRootIndex); | 127 __ CompareRoot(r5, Heap::kUndefinedValueRootIndex); |
129 __ bne(&ok); | 128 __ bne(&ok); |
130 | 129 |
131 __ LoadP(r5, GlobalObjectOperand()); | 130 __ LoadP(r5, GlobalObjectOperand()); |
132 __ LoadP(r5, FieldMemOperand(r5, GlobalObject::kGlobalProxyOffset)); | 131 __ LoadP(r5, FieldMemOperand(r5, GlobalObject::kGlobalProxyOffset)); |
133 | 132 |
134 __ StoreP(r5, MemOperand(sp, receiver_offset)); | 133 __ StoreP(r5, MemOperand(sp, receiver_offset)); |
(...skipping 6022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6157 __ Push(scope_info); | 6156 __ Push(scope_info); |
6158 __ push(ToRegister(instr->function())); | 6157 __ push(ToRegister(instr->function())); |
6159 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6158 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6160 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6159 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6161 } | 6160 } |
6162 | 6161 |
6163 | 6162 |
6164 #undef __ | 6163 #undef __ |
6165 } // namespace internal | 6164 } // namespace internal |
6166 } // namespace v8 | 6165 } // namespace v8 |
OLD | NEW |