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

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

Issue 1199983002: [strong] Implement strong property access semantics (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add TODOs Created 5 years, 5 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/ppc/code-stubs-ppc.cc ('k') | src/ppc/lithium-codegen-ppc.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 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/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_PPC 7 #if V8_TARGET_ARCH_PPC
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 2196 matching lines...) Expand 10 before | Expand all | Expand 10 after
2207 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" 2207 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next"
2208 __ LoadP(r6, MemOperand(sp, 1 * kPointerSize)); // iter 2208 __ LoadP(r6, MemOperand(sp, 1 * kPointerSize)); // iter
2209 __ Push(load_name, r6, r3); // "next", iter, received 2209 __ Push(load_name, r6, r3); // "next", iter, received
2210 2210
2211 // result = receiver[f](arg); 2211 // result = receiver[f](arg);
2212 __ bind(&l_call); 2212 __ bind(&l_call);
2213 __ LoadP(load_receiver, MemOperand(sp, kPointerSize)); 2213 __ LoadP(load_receiver, MemOperand(sp, kPointerSize));
2214 __ LoadP(load_name, MemOperand(sp, 2 * kPointerSize)); 2214 __ LoadP(load_name, MemOperand(sp, 2 * kPointerSize));
2215 __ mov(LoadDescriptor::SlotRegister(), 2215 __ mov(LoadDescriptor::SlotRegister(),
2216 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); 2216 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot())));
2217 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); 2217 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code();
2218 CallIC(ic, TypeFeedbackId::None()); 2218 CallIC(ic, TypeFeedbackId::None());
2219 __ mr(r4, r3); 2219 __ mr(r4, r3);
2220 __ StoreP(r4, MemOperand(sp, 2 * kPointerSize)); 2220 __ StoreP(r4, MemOperand(sp, 2 * kPointerSize));
2221 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); 2221 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD);
2222 __ CallStub(&stub); 2222 __ CallStub(&stub);
2223 2223
2224 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2224 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2225 __ Drop(1); // The function is still on the stack; drop it. 2225 __ Drop(1); // The function is still on the stack; drop it.
2226 2226
2227 // if (!result.done) goto l_try; 2227 // if (!result.done) goto l_try;
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
2396 2396
2397 2397
2398 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { 2398 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
2399 SetSourcePosition(prop->position()); 2399 SetSourcePosition(prop->position());
2400 Literal* key = prop->key()->AsLiteral(); 2400 Literal* key = prop->key()->AsLiteral();
2401 DCHECK(!prop->IsSuperAccess()); 2401 DCHECK(!prop->IsSuperAccess());
2402 2402
2403 __ mov(LoadDescriptor::NameRegister(), Operand(key->value())); 2403 __ mov(LoadDescriptor::NameRegister(), Operand(key->value()));
2404 __ mov(LoadDescriptor::SlotRegister(), 2404 __ mov(LoadDescriptor::SlotRegister(),
2405 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); 2405 Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
2406 CallLoadIC(NOT_CONTEXTUAL); 2406 CallLoadIC(NOT_CONTEXTUAL, language_mode());
2407 } 2407 }
2408 2408
2409 2409
2410 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { 2410 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
2411 // Stack: receiver, home_object. 2411 // Stack: receiver, home_object.
2412 SetSourcePosition(prop->position()); 2412 SetSourcePosition(prop->position());
2413 Literal* key = prop->key()->AsLiteral(); 2413 Literal* key = prop->key()->AsLiteral();
2414 DCHECK(!key->value()->IsSmi()); 2414 DCHECK(!key->value()->IsSmi());
2415 DCHECK(prop->IsSuperAccess()); 2415 DCHECK(prop->IsSuperAccess());
2416 2416
2417 __ Push(key->value()); 2417 __ Push(key->value());
2418 __ CallRuntime(Runtime::kLoadFromSuper, 3); 2418 __ Push(Smi::FromInt(language_mode()));
2419 __ CallRuntime(Runtime::kLoadFromSuper, 4);
2419 } 2420 }
2420 2421
2421 2422
2422 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { 2423 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
2423 SetSourcePosition(prop->position()); 2424 SetSourcePosition(prop->position());
2424 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); 2425 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code();
2425 __ mov(LoadDescriptor::SlotRegister(), 2426 __ mov(LoadDescriptor::SlotRegister(),
2426 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); 2427 Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
2427 CallIC(ic); 2428 CallIC(ic);
2428 } 2429 }
2429 2430
2430 2431
2431 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { 2432 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
2432 // Stack: receiver, home_object, key. 2433 // Stack: receiver, home_object, key.
2434 __ Push(Smi::FromInt(language_mode()));
2433 SetSourcePosition(prop->position()); 2435 SetSourcePosition(prop->position());
2434 2436
2435 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); 2437 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4);
2436 } 2438 }
2437 2439
2438 2440
2439 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, 2441 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
2440 Token::Value op, 2442 Token::Value op,
2441 Expression* left_expr, 2443 Expression* left_expr,
2442 Expression* right_expr) { 2444 Expression* right_expr) {
2443 Label done, smi_case, stub_call; 2445 Label done, smi_case, stub_call;
2444 2446
2445 Register scratch1 = r5; 2447 Register scratch1 = r5;
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
2990 Literal* key = prop->key()->AsLiteral(); 2992 Literal* key = prop->key()->AsLiteral();
2991 DCHECK(!key->value()->IsSmi()); 2993 DCHECK(!key->value()->IsSmi());
2992 // Load the function from the receiver. 2994 // Load the function from the receiver.
2993 const Register scratch = r4; 2995 const Register scratch = r4;
2994 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); 2996 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference();
2995 VisitForAccumulatorValue(super_ref->home_object()); 2997 VisitForAccumulatorValue(super_ref->home_object());
2996 __ mr(scratch, r3); 2998 __ mr(scratch, r3);
2997 VisitForAccumulatorValue(super_ref->this_var()); 2999 VisitForAccumulatorValue(super_ref->this_var());
2998 __ Push(scratch, r3, r3, scratch); 3000 __ Push(scratch, r3, r3, scratch);
2999 __ Push(key->value()); 3001 __ Push(key->value());
3002 __ Push(Smi::FromInt(language_mode()));
3000 3003
3001 // Stack here: 3004 // Stack here:
3002 // - home_object 3005 // - home_object
3003 // - this (receiver) 3006 // - this (receiver)
3004 // - this (receiver) <-- LoadFromSuper will pop here and below. 3007 // - this (receiver) <-- LoadFromSuper will pop here and below.
3005 // - home_object 3008 // - home_object
3006 // - key 3009 // - key
3007 __ CallRuntime(Runtime::kLoadFromSuper, 3); 3010 // - language_mode
3011 __ CallRuntime(Runtime::kLoadFromSuper, 4);
3008 3012
3009 // Replace home_object with target function. 3013 // Replace home_object with target function.
3010 __ StoreP(r3, MemOperand(sp, kPointerSize)); 3014 __ StoreP(r3, MemOperand(sp, kPointerSize));
3011 3015
3012 // Stack here: 3016 // Stack here:
3013 // - target function 3017 // - target function
3014 // - this (receiver) 3018 // - this (receiver)
3015 EmitCall(expr, CallICState::METHOD); 3019 EmitCall(expr, CallICState::METHOD);
3016 } 3020 }
3017 3021
(...skipping 29 matching lines...) Expand all
3047 3051
3048 SetSourcePosition(prop->position()); 3052 SetSourcePosition(prop->position());
3049 // Load the function from the receiver. 3053 // Load the function from the receiver.
3050 const Register scratch = r4; 3054 const Register scratch = r4;
3051 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); 3055 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference();
3052 VisitForAccumulatorValue(super_ref->home_object()); 3056 VisitForAccumulatorValue(super_ref->home_object());
3053 __ mr(scratch, r3); 3057 __ mr(scratch, r3);
3054 VisitForAccumulatorValue(super_ref->this_var()); 3058 VisitForAccumulatorValue(super_ref->this_var());
3055 __ Push(scratch, r3, r3, scratch); 3059 __ Push(scratch, r3, r3, scratch);
3056 VisitForStackValue(prop->key()); 3060 VisitForStackValue(prop->key());
3061 __ Push(Smi::FromInt(language_mode()));
3057 3062
3058 // Stack here: 3063 // Stack here:
3059 // - home_object 3064 // - home_object
3060 // - this (receiver) 3065 // - this (receiver)
3061 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. 3066 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below.
3062 // - home_object 3067 // - home_object
3063 // - key 3068 // - key
3064 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); 3069 // - language_mode
3070 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4);
3065 3071
3066 // Replace home_object with target function. 3072 // Replace home_object with target function.
3067 __ StoreP(r3, MemOperand(sp, kPointerSize)); 3073 __ StoreP(r3, MemOperand(sp, kPointerSize));
3068 3074
3069 // Stack here: 3075 // Stack here:
3070 // - target function 3076 // - target function
3071 // - this (receiver) 3077 // - this (receiver)
3072 EmitCall(expr, CallICState::METHOD); 3078 EmitCall(expr, CallICState::METHOD);
3073 } 3079 }
3074 3080
(...skipping 2510 matching lines...) Expand 10 before | Expand all | Expand 10 after
5585 return ON_STACK_REPLACEMENT; 5591 return ON_STACK_REPLACEMENT;
5586 } 5592 }
5587 5593
5588 DCHECK(interrupt_address == 5594 DCHECK(interrupt_address ==
5589 isolate->builtins()->OsrAfterStackCheck()->entry()); 5595 isolate->builtins()->OsrAfterStackCheck()->entry());
5590 return OSR_AFTER_STACK_CHECK; 5596 return OSR_AFTER_STACK_CHECK;
5591 } 5597 }
5592 } // namespace internal 5598 } // namespace internal
5593 } // namespace v8 5599 } // namespace v8
5594 #endif // V8_TARGET_ARCH_PPC 5600 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/ppc/code-stubs-ppc.cc ('k') | src/ppc/lithium-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698