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

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 1185343005: Revert of Revert of [strong] Implement strong mode restrictions on property access (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/arm/code-stubs-arm.cc ('k') | 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 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after
2235 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" 2235 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next"
2236 __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter 2236 __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter
2237 __ Push(load_name, r3, r0); // "next", iter, received 2237 __ Push(load_name, r3, r0); // "next", iter, received
2238 2238
2239 // result = receiver[f](arg); 2239 // result = receiver[f](arg);
2240 __ bind(&l_call); 2240 __ bind(&l_call);
2241 __ ldr(load_receiver, MemOperand(sp, kPointerSize)); 2241 __ ldr(load_receiver, MemOperand(sp, kPointerSize));
2242 __ ldr(load_name, MemOperand(sp, 2 * kPointerSize)); 2242 __ ldr(load_name, MemOperand(sp, 2 * kPointerSize));
2243 __ mov(LoadDescriptor::SlotRegister(), 2243 __ mov(LoadDescriptor::SlotRegister(),
2244 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); 2244 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot())));
2245 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); 2245 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code();
2246 CallIC(ic, TypeFeedbackId::None()); 2246 CallIC(ic, TypeFeedbackId::None());
2247 __ mov(r1, r0); 2247 __ mov(r1, r0);
2248 __ str(r1, MemOperand(sp, 2 * kPointerSize)); 2248 __ str(r1, MemOperand(sp, 2 * kPointerSize));
2249 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); 2249 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD);
2250 __ CallStub(&stub); 2250 __ CallStub(&stub);
2251 2251
2252 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2252 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2253 __ Drop(1); // The function is still on the stack; drop it. 2253 __ Drop(1); // The function is still on the stack; drop it.
2254 2254
2255 // if (!result.done) goto l_try; 2255 // if (!result.done) goto l_try;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
2416 2416
2417 2417
2418 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { 2418 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
2419 SetSourcePosition(prop->position()); 2419 SetSourcePosition(prop->position());
2420 Literal* key = prop->key()->AsLiteral(); 2420 Literal* key = prop->key()->AsLiteral();
2421 DCHECK(!prop->IsSuperAccess()); 2421 DCHECK(!prop->IsSuperAccess());
2422 2422
2423 __ mov(LoadDescriptor::NameRegister(), Operand(key->value())); 2423 __ mov(LoadDescriptor::NameRegister(), Operand(key->value()));
2424 __ mov(LoadDescriptor::SlotRegister(), 2424 __ mov(LoadDescriptor::SlotRegister(),
2425 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); 2425 Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
2426 CallLoadIC(NOT_CONTEXTUAL); 2426 CallLoadIC(NOT_CONTEXTUAL, language_mode());
2427 } 2427 }
2428 2428
2429 2429
2430 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { 2430 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
2431 // Stack: receiver, home_object. 2431 // Stack: receiver, home_object.
2432 SetSourcePosition(prop->position()); 2432 SetSourcePosition(prop->position());
2433 Literal* key = prop->key()->AsLiteral(); 2433 Literal* key = prop->key()->AsLiteral();
2434 DCHECK(!key->value()->IsSmi()); 2434 DCHECK(!key->value()->IsSmi());
2435 DCHECK(prop->IsSuperAccess()); 2435 DCHECK(prop->IsSuperAccess());
2436 2436
2437 __ Push(key->value()); 2437 __ Push(key->value());
2438 __ CallRuntime(Runtime::kLoadFromSuper, 3); 2438 __ Push(Smi::FromInt(language_mode()));
2439 __ CallRuntime(Runtime::kLoadFromSuper, 4);
2439 } 2440 }
2440 2441
2441 2442
2442 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { 2443 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
2443 SetSourcePosition(prop->position()); 2444 SetSourcePosition(prop->position());
2444 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); 2445 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code();
2445 __ mov(LoadDescriptor::SlotRegister(), 2446 __ mov(LoadDescriptor::SlotRegister(),
2446 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); 2447 Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
2447 CallIC(ic); 2448 CallIC(ic);
2448 } 2449 }
2449 2450
2450 2451
2451 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { 2452 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
2452 // Stack: receiver, home_object, key. 2453 // Stack: receiver, home_object, key.
2454 __ Push(Smi::FromInt(language_mode()));
2453 SetSourcePosition(prop->position()); 2455 SetSourcePosition(prop->position());
2454 2456
2455 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); 2457 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4);
2456 } 2458 }
2457 2459
2458 2460
2459 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, 2461 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
2460 Token::Value op, 2462 Token::Value op,
2461 Expression* left_expr, 2463 Expression* left_expr,
2462 Expression* right_expr) { 2464 Expression* right_expr) {
2463 Label done, smi_case, stub_call; 2465 Label done, smi_case, stub_call;
2464 2466
2465 Register scratch1 = r2; 2467 Register scratch1 = r2;
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
2991 // Load the function from the receiver. 2993 // Load the function from the receiver.
2992 const Register scratch = r1; 2994 const Register scratch = r1;
2993 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); 2995 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference();
2994 VisitForStackValue(super_ref->home_object()); 2996 VisitForStackValue(super_ref->home_object());
2995 VisitForAccumulatorValue(super_ref->this_var()); 2997 VisitForAccumulatorValue(super_ref->this_var());
2996 __ Push(r0); 2998 __ Push(r0);
2997 __ Push(r0); 2999 __ Push(r0);
2998 __ ldr(scratch, MemOperand(sp, kPointerSize * 2)); 3000 __ ldr(scratch, MemOperand(sp, kPointerSize * 2));
2999 __ Push(scratch); 3001 __ Push(scratch);
3000 __ Push(key->value()); 3002 __ Push(key->value());
3003 __ Push(Smi::FromInt(language_mode()));
3001 3004
3002 // Stack here: 3005 // Stack here:
3003 // - home_object 3006 // - home_object
3004 // - this (receiver) 3007 // - this (receiver)
3005 // - this (receiver) <-- LoadFromSuper will pop here and below. 3008 // - this (receiver) <-- LoadFromSuper will pop here and below.
3006 // - home_object 3009 // - home_object
3007 // - key 3010 // - key
3008 __ CallRuntime(Runtime::kLoadFromSuper, 3); 3011 // - language_mode
3012 __ CallRuntime(Runtime::kLoadFromSuper, 4);
3009 3013
3010 // Replace home_object with target function. 3014 // Replace home_object with target function.
3011 __ str(r0, MemOperand(sp, kPointerSize)); 3015 __ str(r0, MemOperand(sp, kPointerSize));
3012 3016
3013 // Stack here: 3017 // Stack here:
3014 // - target function 3018 // - target function
3015 // - this (receiver) 3019 // - this (receiver)
3016 EmitCall(expr, CallICState::METHOD); 3020 EmitCall(expr, CallICState::METHOD);
3017 } 3021 }
3018 3022
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
3051 // Load the function from the receiver. 3055 // Load the function from the receiver.
3052 const Register scratch = r1; 3056 const Register scratch = r1;
3053 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); 3057 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference();
3054 VisitForStackValue(super_ref->home_object()); 3058 VisitForStackValue(super_ref->home_object());
3055 VisitForAccumulatorValue(super_ref->this_var()); 3059 VisitForAccumulatorValue(super_ref->this_var());
3056 __ Push(r0); 3060 __ Push(r0);
3057 __ Push(r0); 3061 __ Push(r0);
3058 __ ldr(scratch, MemOperand(sp, kPointerSize * 2)); 3062 __ ldr(scratch, MemOperand(sp, kPointerSize * 2));
3059 __ Push(scratch); 3063 __ Push(scratch);
3060 VisitForStackValue(prop->key()); 3064 VisitForStackValue(prop->key());
3065 __ Push(Smi::FromInt(language_mode()));
3061 3066
3062 // Stack here: 3067 // Stack here:
3063 // - home_object 3068 // - home_object
3064 // - this (receiver) 3069 // - this (receiver)
3065 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. 3070 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below.
3066 // - home_object 3071 // - home_object
3067 // - key 3072 // - key
3068 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); 3073 // - language_mode
3074 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4);
3069 3075
3070 // Replace home_object with target function. 3076 // Replace home_object with target function.
3071 __ str(r0, MemOperand(sp, kPointerSize)); 3077 __ str(r0, MemOperand(sp, kPointerSize));
3072 3078
3073 // Stack here: 3079 // Stack here:
3074 // - target function 3080 // - target function
3075 // - this (receiver) 3081 // - this (receiver)
3076 EmitCall(expr, CallICState::METHOD); 3082 EmitCall(expr, CallICState::METHOD);
3077 } 3083 }
3078 3084
(...skipping 2537 matching lines...) Expand 10 before | Expand all | Expand 10 after
5616 DCHECK(interrupt_address == 5622 DCHECK(interrupt_address ==
5617 isolate->builtins()->OsrAfterStackCheck()->entry()); 5623 isolate->builtins()->OsrAfterStackCheck()->entry());
5618 return OSR_AFTER_STACK_CHECK; 5624 return OSR_AFTER_STACK_CHECK;
5619 } 5625 }
5620 5626
5621 5627
5622 } // namespace internal 5628 } // namespace internal
5623 } // namespace v8 5629 } // namespace v8
5624 5630
5625 #endif // V8_TARGET_ARCH_ARM 5631 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698