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