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

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

Issue 1189153002: 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(), SLOPPY).code(); 2245 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).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, language_mode()); 2426 CallLoadIC(NOT_CONTEXTUAL);
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 __ Push(Smi::FromInt(language_mode())); 2438 __ CallRuntime(Runtime::kLoadFromSuper, 3);
2439 __ CallRuntime(Runtime::kLoadFromSuper, 4);
2440 } 2439 }
2441 2440
2442 2441
2443 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { 2442 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
2444 SetSourcePosition(prop->position()); 2443 SetSourcePosition(prop->position());
2445 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code(); 2444 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code();
2446 __ mov(LoadDescriptor::SlotRegister(), 2445 __ mov(LoadDescriptor::SlotRegister(),
2447 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); 2446 Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
2448 CallIC(ic); 2447 CallIC(ic);
2449 } 2448 }
2450 2449
2451 2450
2452 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { 2451 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
2453 // Stack: receiver, home_object, key. 2452 // Stack: receiver, home_object, key.
2454 __ Push(Smi::FromInt(language_mode()));
2455 SetSourcePosition(prop->position()); 2453 SetSourcePosition(prop->position());
2456 2454
2457 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4); 2455 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3);
2458 } 2456 }
2459 2457
2460 2458
2461 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, 2459 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
2462 Token::Value op, 2460 Token::Value op,
2463 Expression* left_expr, 2461 Expression* left_expr,
2464 Expression* right_expr) { 2462 Expression* right_expr) {
2465 Label done, smi_case, stub_call; 2463 Label done, smi_case, stub_call;
2466 2464
2467 Register scratch1 = r2; 2465 Register scratch1 = r2;
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
2993 // Load the function from the receiver. 2991 // Load the function from the receiver.
2994 const Register scratch = r1; 2992 const Register scratch = r1;
2995 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); 2993 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference();
2996 VisitForStackValue(super_ref->home_object()); 2994 VisitForStackValue(super_ref->home_object());
2997 VisitForAccumulatorValue(super_ref->this_var()); 2995 VisitForAccumulatorValue(super_ref->this_var());
2998 __ Push(r0); 2996 __ Push(r0);
2999 __ Push(r0); 2997 __ Push(r0);
3000 __ ldr(scratch, MemOperand(sp, kPointerSize * 2)); 2998 __ ldr(scratch, MemOperand(sp, kPointerSize * 2));
3001 __ Push(scratch); 2999 __ Push(scratch);
3002 __ Push(key->value()); 3000 __ Push(key->value());
3003 __ Push(Smi::FromInt(language_mode()));
3004 3001
3005 // Stack here: 3002 // Stack here:
3006 // - home_object 3003 // - home_object
3007 // - this (receiver) 3004 // - this (receiver)
3008 // - this (receiver) <-- LoadFromSuper will pop here and below. 3005 // - this (receiver) <-- LoadFromSuper will pop here and below.
3009 // - home_object 3006 // - home_object
3010 // - key 3007 // - key
3011 // - language_mode 3008 __ CallRuntime(Runtime::kLoadFromSuper, 3);
3012 __ CallRuntime(Runtime::kLoadFromSuper, 4);
3013 3009
3014 // Replace home_object with target function. 3010 // Replace home_object with target function.
3015 __ str(r0, MemOperand(sp, kPointerSize)); 3011 __ str(r0, MemOperand(sp, kPointerSize));
3016 3012
3017 // Stack here: 3013 // Stack here:
3018 // - target function 3014 // - target function
3019 // - this (receiver) 3015 // - this (receiver)
3020 EmitCall(expr, CallICState::METHOD); 3016 EmitCall(expr, CallICState::METHOD);
3021 } 3017 }
3022 3018
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
3055 // Load the function from the receiver. 3051 // Load the function from the receiver.
3056 const Register scratch = r1; 3052 const Register scratch = r1;
3057 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); 3053 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference();
3058 VisitForStackValue(super_ref->home_object()); 3054 VisitForStackValue(super_ref->home_object());
3059 VisitForAccumulatorValue(super_ref->this_var()); 3055 VisitForAccumulatorValue(super_ref->this_var());
3060 __ Push(r0); 3056 __ Push(r0);
3061 __ Push(r0); 3057 __ Push(r0);
3062 __ ldr(scratch, MemOperand(sp, kPointerSize * 2)); 3058 __ ldr(scratch, MemOperand(sp, kPointerSize * 2));
3063 __ Push(scratch); 3059 __ Push(scratch);
3064 VisitForStackValue(prop->key()); 3060 VisitForStackValue(prop->key());
3065 __ Push(Smi::FromInt(language_mode()));
3066 3061
3067 // Stack here: 3062 // Stack here:
3068 // - home_object 3063 // - home_object
3069 // - this (receiver) 3064 // - this (receiver)
3070 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. 3065 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below.
3071 // - home_object 3066 // - home_object
3072 // - key 3067 // - key
3073 // - language_mode 3068 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3);
3074 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4);
3075 3069
3076 // Replace home_object with target function. 3070 // Replace home_object with target function.
3077 __ str(r0, MemOperand(sp, kPointerSize)); 3071 __ str(r0, MemOperand(sp, kPointerSize));
3078 3072
3079 // Stack here: 3073 // Stack here:
3080 // - target function 3074 // - target function
3081 // - this (receiver) 3075 // - this (receiver)
3082 EmitCall(expr, CallICState::METHOD); 3076 EmitCall(expr, CallICState::METHOD);
3083 } 3077 }
3084 3078
(...skipping 2537 matching lines...) Expand 10 before | Expand all | Expand 10 after
5622 DCHECK(interrupt_address == 5616 DCHECK(interrupt_address ==
5623 isolate->builtins()->OsrAfterStackCheck()->entry()); 5617 isolate->builtins()->OsrAfterStackCheck()->entry());
5624 return OSR_AFTER_STACK_CHECK; 5618 return OSR_AFTER_STACK_CHECK;
5625 } 5619 }
5626 5620
5627 5621
5628 } // namespace internal 5622 } // namespace internal
5629 } // namespace v8 5623 } // namespace v8
5630 5624
5631 #endif // V8_TARGET_ARCH_ARM 5625 #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