| OLD | NEW |
| 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 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2203 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" | 2203 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" |
| 2204 __ LoadP(r6, MemOperand(sp, 1 * kPointerSize)); // iter | 2204 __ LoadP(r6, MemOperand(sp, 1 * kPointerSize)); // iter |
| 2205 __ Push(load_name, r6, r3); // "next", iter, received | 2205 __ Push(load_name, r6, r3); // "next", iter, received |
| 2206 | 2206 |
| 2207 // result = receiver[f](arg); | 2207 // result = receiver[f](arg); |
| 2208 __ bind(&l_call); | 2208 __ bind(&l_call); |
| 2209 __ LoadP(load_receiver, MemOperand(sp, kPointerSize)); | 2209 __ LoadP(load_receiver, MemOperand(sp, kPointerSize)); |
| 2210 __ LoadP(load_name, MemOperand(sp, 2 * kPointerSize)); | 2210 __ LoadP(load_name, MemOperand(sp, 2 * kPointerSize)); |
| 2211 __ mov(LoadDescriptor::SlotRegister(), | 2211 __ mov(LoadDescriptor::SlotRegister(), |
| 2212 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); | 2212 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); |
| 2213 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 2213 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code(); |
| 2214 CallIC(ic, TypeFeedbackId::None()); | 2214 CallIC(ic, TypeFeedbackId::None()); |
| 2215 __ mr(r4, r3); | 2215 __ mr(r4, r3); |
| 2216 __ StoreP(r4, MemOperand(sp, 2 * kPointerSize)); | 2216 __ StoreP(r4, MemOperand(sp, 2 * kPointerSize)); |
| 2217 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); | 2217 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); |
| 2218 __ CallStub(&stub); | 2218 __ CallStub(&stub); |
| 2219 | 2219 |
| 2220 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2220 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2221 __ Drop(1); // The function is still on the stack; drop it. | 2221 __ Drop(1); // The function is still on the stack; drop it. |
| 2222 | 2222 |
| 2223 // if (!result.done) goto l_try; | 2223 // if (!result.done) goto l_try; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2392 | 2392 |
| 2393 | 2393 |
| 2394 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2394 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
| 2395 SetSourcePosition(prop->position()); | 2395 SetSourcePosition(prop->position()); |
| 2396 Literal* key = prop->key()->AsLiteral(); | 2396 Literal* key = prop->key()->AsLiteral(); |
| 2397 DCHECK(!prop->IsSuperAccess()); | 2397 DCHECK(!prop->IsSuperAccess()); |
| 2398 | 2398 |
| 2399 __ mov(LoadDescriptor::NameRegister(), Operand(key->value())); | 2399 __ mov(LoadDescriptor::NameRegister(), Operand(key->value())); |
| 2400 __ mov(LoadDescriptor::SlotRegister(), | 2400 __ mov(LoadDescriptor::SlotRegister(), |
| 2401 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2401 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
| 2402 CallLoadIC(NOT_CONTEXTUAL); | 2402 CallLoadIC(NOT_CONTEXTUAL, language_mode()); |
| 2403 } | 2403 } |
| 2404 | 2404 |
| 2405 | 2405 |
| 2406 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { | 2406 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { |
| 2407 // Stack: receiver, home_object. | 2407 // Stack: receiver, home_object. |
| 2408 SetSourcePosition(prop->position()); | 2408 SetSourcePosition(prop->position()); |
| 2409 Literal* key = prop->key()->AsLiteral(); | 2409 Literal* key = prop->key()->AsLiteral(); |
| 2410 DCHECK(!key->value()->IsSmi()); | 2410 DCHECK(!key->value()->IsSmi()); |
| 2411 DCHECK(prop->IsSuperAccess()); | 2411 DCHECK(prop->IsSuperAccess()); |
| 2412 | 2412 |
| 2413 __ Push(key->value()); | 2413 __ Push(key->value()); |
| 2414 __ CallRuntime(Runtime::kLoadFromSuper, 3); | 2414 __ Push(Smi::FromInt(language_mode())); |
| 2415 __ CallRuntime(Runtime::kLoadFromSuper, 4); |
| 2415 } | 2416 } |
| 2416 | 2417 |
| 2417 | 2418 |
| 2418 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2419 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
| 2419 SetSourcePosition(prop->position()); | 2420 SetSourcePosition(prop->position()); |
| 2420 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 2421 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code(); |
| 2421 __ mov(LoadDescriptor::SlotRegister(), | 2422 __ mov(LoadDescriptor::SlotRegister(), |
| 2422 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2423 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
| 2423 CallIC(ic); | 2424 CallIC(ic); |
| 2424 } | 2425 } |
| 2425 | 2426 |
| 2426 | 2427 |
| 2427 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 2428 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
| 2428 // Stack: receiver, home_object, key. | 2429 // Stack: receiver, home_object, key. |
| 2430 __ Push(Smi::FromInt(language_mode())); |
| 2429 SetSourcePosition(prop->position()); | 2431 SetSourcePosition(prop->position()); |
| 2430 | 2432 |
| 2431 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); | 2433 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4); |
| 2432 } | 2434 } |
| 2433 | 2435 |
| 2434 | 2436 |
| 2435 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, | 2437 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, |
| 2436 Token::Value op, | 2438 Token::Value op, |
| 2437 Expression* left_expr, | 2439 Expression* left_expr, |
| 2438 Expression* right_expr) { | 2440 Expression* right_expr) { |
| 2439 Label done, smi_case, stub_call; | 2441 Label done, smi_case, stub_call; |
| 2440 | 2442 |
| 2441 Register scratch1 = r5; | 2443 Register scratch1 = r5; |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2986 Literal* key = prop->key()->AsLiteral(); | 2988 Literal* key = prop->key()->AsLiteral(); |
| 2987 DCHECK(!key->value()->IsSmi()); | 2989 DCHECK(!key->value()->IsSmi()); |
| 2988 // Load the function from the receiver. | 2990 // Load the function from the receiver. |
| 2989 const Register scratch = r4; | 2991 const Register scratch = r4; |
| 2990 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 2992 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
| 2991 VisitForAccumulatorValue(super_ref->home_object()); | 2993 VisitForAccumulatorValue(super_ref->home_object()); |
| 2992 __ mr(scratch, r3); | 2994 __ mr(scratch, r3); |
| 2993 VisitForAccumulatorValue(super_ref->this_var()); | 2995 VisitForAccumulatorValue(super_ref->this_var()); |
| 2994 __ Push(scratch, r3, r3, scratch); | 2996 __ Push(scratch, r3, r3, scratch); |
| 2995 __ Push(key->value()); | 2997 __ Push(key->value()); |
| 2998 __ Push(Smi::FromInt(language_mode())); |
| 2996 | 2999 |
| 2997 // Stack here: | 3000 // Stack here: |
| 2998 // - home_object | 3001 // - home_object |
| 2999 // - this (receiver) | 3002 // - this (receiver) |
| 3000 // - this (receiver) <-- LoadFromSuper will pop here and below. | 3003 // - this (receiver) <-- LoadFromSuper will pop here and below. |
| 3001 // - home_object | 3004 // - home_object |
| 3002 // - key | 3005 // - key |
| 3003 __ CallRuntime(Runtime::kLoadFromSuper, 3); | 3006 // - language_mode |
| 3007 __ CallRuntime(Runtime::kLoadFromSuper, 4); |
| 3004 | 3008 |
| 3005 // Replace home_object with target function. | 3009 // Replace home_object with target function. |
| 3006 __ StoreP(r3, MemOperand(sp, kPointerSize)); | 3010 __ StoreP(r3, MemOperand(sp, kPointerSize)); |
| 3007 | 3011 |
| 3008 // Stack here: | 3012 // Stack here: |
| 3009 // - target function | 3013 // - target function |
| 3010 // - this (receiver) | 3014 // - this (receiver) |
| 3011 EmitCall(expr, CallICState::METHOD); | 3015 EmitCall(expr, CallICState::METHOD); |
| 3012 } | 3016 } |
| 3013 | 3017 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 3043 | 3047 |
| 3044 SetSourcePosition(prop->position()); | 3048 SetSourcePosition(prop->position()); |
| 3045 // Load the function from the receiver. | 3049 // Load the function from the receiver. |
| 3046 const Register scratch = r4; | 3050 const Register scratch = r4; |
| 3047 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 3051 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
| 3048 VisitForAccumulatorValue(super_ref->home_object()); | 3052 VisitForAccumulatorValue(super_ref->home_object()); |
| 3049 __ mr(scratch, r3); | 3053 __ mr(scratch, r3); |
| 3050 VisitForAccumulatorValue(super_ref->this_var()); | 3054 VisitForAccumulatorValue(super_ref->this_var()); |
| 3051 __ Push(scratch, r3, r3, scratch); | 3055 __ Push(scratch, r3, r3, scratch); |
| 3052 VisitForStackValue(prop->key()); | 3056 VisitForStackValue(prop->key()); |
| 3057 __ Push(Smi::FromInt(language_mode())); |
| 3053 | 3058 |
| 3054 // Stack here: | 3059 // Stack here: |
| 3055 // - home_object | 3060 // - home_object |
| 3056 // - this (receiver) | 3061 // - this (receiver) |
| 3057 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. | 3062 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. |
| 3058 // - home_object | 3063 // - home_object |
| 3059 // - key | 3064 // - key |
| 3060 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); | 3065 // - language_mode |
| 3066 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4); |
| 3061 | 3067 |
| 3062 // Replace home_object with target function. | 3068 // Replace home_object with target function. |
| 3063 __ StoreP(r3, MemOperand(sp, kPointerSize)); | 3069 __ StoreP(r3, MemOperand(sp, kPointerSize)); |
| 3064 | 3070 |
| 3065 // Stack here: | 3071 // Stack here: |
| 3066 // - target function | 3072 // - target function |
| 3067 // - this (receiver) | 3073 // - this (receiver) |
| 3068 EmitCall(expr, CallICState::METHOD); | 3074 EmitCall(expr, CallICState::METHOD); |
| 3069 } | 3075 } |
| 3070 | 3076 |
| (...skipping 2505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5576 return ON_STACK_REPLACEMENT; | 5582 return ON_STACK_REPLACEMENT; |
| 5577 } | 5583 } |
| 5578 | 5584 |
| 5579 DCHECK(interrupt_address == | 5585 DCHECK(interrupt_address == |
| 5580 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5586 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5581 return OSR_AFTER_STACK_CHECK; | 5587 return OSR_AFTER_STACK_CHECK; |
| 5582 } | 5588 } |
| 5583 } // namespace internal | 5589 } // namespace internal |
| 5584 } // namespace v8 | 5590 } // namespace v8 |
| 5585 #endif // V8_TARGET_ARCH_PPC | 5591 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |