Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(585)

Side by Side Diff: src/mips64/lithium-codegen-mips64.cc

Issue 1129723003: Revert of Resolve references to "this" the same way as normal variables (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/mips64/full-codegen-mips64.cc ('k') | src/parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 (is_sloppy(info()->language_mode()) && info()->MayUseThis() && 121 if (is_sloppy(info_->language_mode()) && info()->MayUseThis() &&
122 !info()->is_native() && info()->scope()->has_this_declaration()) { 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
132 __ sd(a2, MemOperand(sp, receiver_offset)); 132 __ sd(a2, MemOperand(sp, receiver_offset));
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 __ push(a1); 185 __ push(a1);
186 __ CallRuntime(Runtime::kNewFunctionContext, 1); 186 __ CallRuntime(Runtime::kNewFunctionContext, 1);
187 } 187 }
188 RecordSafepoint(Safepoint::kNoLazyDeopt); 188 RecordSafepoint(Safepoint::kNoLazyDeopt);
189 // Context is returned in both v0. It replaces the context passed to us. 189 // Context is returned in both v0. It replaces the context passed to us.
190 // It's saved in the stack and kept live in cp. 190 // It's saved in the stack and kept live in cp.
191 __ mov(cp, v0); 191 __ mov(cp, v0);
192 __ sd(v0, MemOperand(fp, StandardFrameConstants::kContextOffset)); 192 __ sd(v0, MemOperand(fp, StandardFrameConstants::kContextOffset));
193 // Copy any necessary parameters into the context. 193 // Copy any necessary parameters into the context.
194 int num_parameters = scope()->num_parameters(); 194 int num_parameters = scope()->num_parameters();
195 int first_parameter = scope()->has_this_declaration() ? -1 : 0; 195 for (int i = 0; i < num_parameters; i++) {
196 for (int i = first_parameter; i < num_parameters; i++) { 196 Variable* var = scope()->parameter(i);
197 Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i);
198 if (var->IsContextSlot()) { 197 if (var->IsContextSlot()) {
199 int parameter_offset = StandardFrameConstants::kCallerSPOffset + 198 int parameter_offset = StandardFrameConstants::kCallerSPOffset +
200 (num_parameters - 1 - i) * kPointerSize; 199 (num_parameters - 1 - i) * kPointerSize;
201 // Load parameter from stack. 200 // Load parameter from stack.
202 __ ld(a0, MemOperand(fp, parameter_offset)); 201 __ ld(a0, MemOperand(fp, parameter_offset));
203 // Store it in the context. 202 // Store it in the context.
204 MemOperand target = ContextOperand(cp, var->index()); 203 MemOperand target = ContextOperand(cp, var->index());
205 __ sd(a0, target); 204 __ sd(a0, target);
206 // Update the write barrier. This clobbers a3 and a0. 205 // Update the write barrier. This clobbers a3 and a0.
207 if (need_write_barrier) { 206 if (need_write_barrier) {
(...skipping 5847 matching lines...) Expand 10 before | Expand all | Expand 10 after
6055 __ li(at, scope_info); 6054 __ li(at, scope_info);
6056 __ Push(at, ToRegister(instr->function())); 6055 __ Push(at, ToRegister(instr->function()));
6057 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6056 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6058 RecordSafepoint(Safepoint::kNoLazyDeopt); 6057 RecordSafepoint(Safepoint::kNoLazyDeopt);
6059 } 6058 }
6060 6059
6061 6060
6062 #undef __ 6061 #undef __
6063 6062
6064 } } // namespace v8::internal 6063 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips64/full-codegen-mips64.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698