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

Side by Side Diff: src/arm/full-codegen-arm.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 | « no previous file | src/arm/lithium-codegen-arm.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 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_ARM
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 if (strlen(FLAG_stop_at) > 0 && 120 if (strlen(FLAG_stop_at) > 0 &&
121 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { 121 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) {
122 __ stop("stop-at"); 122 __ stop("stop-at");
123 } 123 }
124 #endif 124 #endif
125 125
126 // Sloppy mode functions and builtins need to replace the receiver with the 126 // Sloppy mode functions and builtins need to replace the receiver with the
127 // global proxy when called as functions (without an explicit receiver 127 // global proxy when called as functions (without an explicit receiver
128 // object). 128 // object).
129 if (is_sloppy(info->language_mode()) && !info->is_native() && 129 if (is_sloppy(info->language_mode()) && !info->is_native() &&
130 info->MayUseThis() && info->scope()->has_this_declaration()) { 130 info->MayUseThis()) {
131 Label ok; 131 Label ok;
132 int receiver_offset = info->scope()->num_parameters() * kPointerSize; 132 int receiver_offset = info->scope()->num_parameters() * kPointerSize;
133 __ ldr(r2, MemOperand(sp, receiver_offset)); 133 __ ldr(r2, MemOperand(sp, receiver_offset));
134 __ CompareRoot(r2, Heap::kUndefinedValueRootIndex); 134 __ CompareRoot(r2, Heap::kUndefinedValueRootIndex);
135 __ b(ne, &ok); 135 __ b(ne, &ok);
136 136
137 __ ldr(r2, GlobalObjectOperand()); 137 __ ldr(r2, GlobalObjectOperand());
138 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalProxyOffset)); 138 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalProxyOffset));
139 139
140 __ str(r2, MemOperand(sp, receiver_offset)); 140 __ str(r2, MemOperand(sp, receiver_offset));
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 __ push(r1); 209 __ push(r1);
210 __ CallRuntime(Runtime::kNewFunctionContext, 1); 210 __ CallRuntime(Runtime::kNewFunctionContext, 1);
211 } 211 }
212 function_in_register = false; 212 function_in_register = false;
213 // Context is returned in r0. It replaces the context passed to us. 213 // Context is returned in r0. It replaces the context passed to us.
214 // It's saved in the stack and kept live in cp. 214 // It's saved in the stack and kept live in cp.
215 __ mov(cp, r0); 215 __ mov(cp, r0);
216 __ str(r0, MemOperand(fp, StandardFrameConstants::kContextOffset)); 216 __ str(r0, MemOperand(fp, StandardFrameConstants::kContextOffset));
217 // Copy any necessary parameters into the context. 217 // Copy any necessary parameters into the context.
218 int num_parameters = info->scope()->num_parameters(); 218 int num_parameters = info->scope()->num_parameters();
219 int first_parameter = info->scope()->has_this_declaration() ? -1 : 0; 219 for (int i = 0; i < num_parameters; i++) {
220 for (int i = first_parameter; i < num_parameters; i++) { 220 Variable* var = scope()->parameter(i);
221 Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i);
222 if (var->IsContextSlot()) { 221 if (var->IsContextSlot()) {
223 int parameter_offset = StandardFrameConstants::kCallerSPOffset + 222 int parameter_offset = StandardFrameConstants::kCallerSPOffset +
224 (num_parameters - 1 - i) * kPointerSize; 223 (num_parameters - 1 - i) * kPointerSize;
225 // Load parameter from stack. 224 // Load parameter from stack.
226 __ ldr(r0, MemOperand(fp, parameter_offset)); 225 __ ldr(r0, MemOperand(fp, parameter_offset));
227 // Store it in the context. 226 // Store it in the context.
228 MemOperand target = ContextOperand(cp, var->index()); 227 MemOperand target = ContextOperand(cp, var->index());
229 __ str(r0, target); 228 __ str(r0, target);
230 229
231 // Update the write barrier. 230 // Update the write barrier.
(...skipping 2828 matching lines...) Expand 10 before | Expand all | Expand 10 after
3060 if (arg_count > 0) { 3059 if (arg_count > 0) {
3061 __ ldr(r5, MemOperand(sp, arg_count * kPointerSize)); 3060 __ ldr(r5, MemOperand(sp, arg_count * kPointerSize));
3062 } else { 3061 } else {
3063 __ LoadRoot(r5, Heap::kUndefinedValueRootIndex); 3062 __ LoadRoot(r5, Heap::kUndefinedValueRootIndex);
3064 } 3063 }
3065 3064
3066 // r4: the receiver of the enclosing function. 3065 // r4: the receiver of the enclosing function.
3067 __ ldr(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 3066 __ ldr(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
3068 3067
3069 // r3: the receiver of the enclosing function. 3068 // r3: the receiver of the enclosing function.
3070 Variable* this_var = scope()->LookupThis(); 3069 int receiver_offset = 2 + info_->scope()->num_parameters();
3071 DCHECK_NOT_NULL(this_var); 3070 __ ldr(r3, MemOperand(fp, receiver_offset * kPointerSize));
3072 __ ldr(r3, VarOperand(this_var, r3));
3073 3071
3074 // r2: language mode. 3072 // r2: language mode.
3075 __ mov(r2, Operand(Smi::FromInt(language_mode()))); 3073 __ mov(r2, Operand(Smi::FromInt(language_mode())));
3076 3074
3077 // r1: the start position of the scope the calls resides in. 3075 // r1: the start position of the scope the calls resides in.
3078 __ mov(r1, Operand(Smi::FromInt(scope()->start_position()))); 3076 __ mov(r1, Operand(Smi::FromInt(scope()->start_position())));
3079 3077
3080 // Do the runtime call. 3078 // Do the runtime call.
3081 __ Push(r5); 3079 __ Push(r5);
3082 __ Push(r4, r3, r2, r1); 3080 __ Push(r4, r3, r2, r1);
(...skipping 2424 matching lines...) Expand 10 before | Expand all | Expand 10 after
5507 5505
5508 DCHECK(interrupt_address == 5506 DCHECK(interrupt_address ==
5509 isolate->builtins()->OsrAfterStackCheck()->entry()); 5507 isolate->builtins()->OsrAfterStackCheck()->entry());
5510 return OSR_AFTER_STACK_CHECK; 5508 return OSR_AFTER_STACK_CHECK;
5511 } 5509 }
5512 5510
5513 5511
5514 } } // namespace v8::internal 5512 } } // namespace v8::internal
5515 5513
5516 #endif // V8_TARGET_ARCH_ARM 5514 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698