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(), SLOPPY).code(); | 2203 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).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, language_mode()); | 2392 CallLoadIC(NOT_CONTEXTUAL); |
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 __ Push(Smi::FromInt(language_mode())); | 2404 __ CallRuntime(Runtime::kLoadFromSuper, 3); |
2405 __ CallRuntime(Runtime::kLoadFromSuper, 4); | |
2406 } | 2405 } |
2407 | 2406 |
2408 | 2407 |
2409 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2408 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
2410 SetSourcePosition(prop->position()); | 2409 SetSourcePosition(prop->position()); |
2411 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code(); | 2410 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
2412 __ mov(LoadDescriptor::SlotRegister(), | 2411 __ mov(LoadDescriptor::SlotRegister(), |
2413 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2412 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
2414 CallIC(ic); | 2413 CallIC(ic); |
2415 } | 2414 } |
2416 | 2415 |
2417 | 2416 |
2418 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 2417 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
2419 // Stack: receiver, home_object, key. | 2418 // Stack: receiver, home_object, key. |
2420 __ Push(Smi::FromInt(language_mode())); | |
2421 SetSourcePosition(prop->position()); | 2419 SetSourcePosition(prop->position()); |
2422 | 2420 |
2423 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4); | 2421 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); |
2424 } | 2422 } |
2425 | 2423 |
2426 | 2424 |
2427 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, | 2425 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, |
2428 Token::Value op, | 2426 Token::Value op, |
2429 Expression* left_expr, | 2427 Expression* left_expr, |
2430 Expression* right_expr) { | 2428 Expression* right_expr) { |
2431 Label done, smi_case, stub_call; | 2429 Label done, smi_case, stub_call; |
2432 | 2430 |
2433 Register scratch1 = r5; | 2431 Register scratch1 = r5; |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2985 Literal* key = prop->key()->AsLiteral(); | 2983 Literal* key = prop->key()->AsLiteral(); |
2986 DCHECK(!key->value()->IsSmi()); | 2984 DCHECK(!key->value()->IsSmi()); |
2987 // Load the function from the receiver. | 2985 // Load the function from the receiver. |
2988 const Register scratch = r4; | 2986 const Register scratch = r4; |
2989 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 2987 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
2990 VisitForAccumulatorValue(super_ref->home_object()); | 2988 VisitForAccumulatorValue(super_ref->home_object()); |
2991 __ mr(scratch, r3); | 2989 __ mr(scratch, r3); |
2992 VisitForAccumulatorValue(super_ref->this_var()); | 2990 VisitForAccumulatorValue(super_ref->this_var()); |
2993 __ Push(scratch, r3, r3, scratch); | 2991 __ Push(scratch, r3, r3, scratch); |
2994 __ Push(key->value()); | 2992 __ Push(key->value()); |
2995 __ Push(Smi::FromInt(language_mode())); | |
2996 | 2993 |
2997 // Stack here: | 2994 // Stack here: |
2998 // - home_object | 2995 // - home_object |
2999 // - this (receiver) | 2996 // - this (receiver) |
3000 // - this (receiver) <-- LoadFromSuper will pop here and below. | 2997 // - this (receiver) <-- LoadFromSuper will pop here and below. |
3001 // - home_object | 2998 // - home_object |
3002 // - key | 2999 // - key |
3003 // - language_mode | 3000 __ CallRuntime(Runtime::kLoadFromSuper, 3); |
3004 __ CallRuntime(Runtime::kLoadFromSuper, 4); | |
3005 | 3001 |
3006 // Replace home_object with target function. | 3002 // Replace home_object with target function. |
3007 __ StoreP(r3, MemOperand(sp, kPointerSize)); | 3003 __ StoreP(r3, MemOperand(sp, kPointerSize)); |
3008 | 3004 |
3009 // Stack here: | 3005 // Stack here: |
3010 // - target function | 3006 // - target function |
3011 // - this (receiver) | 3007 // - this (receiver) |
3012 EmitCall(expr, CallICState::METHOD); | 3008 EmitCall(expr, CallICState::METHOD); |
3013 } | 3009 } |
3014 | 3010 |
(...skipping 29 matching lines...) Expand all Loading... |
3044 | 3040 |
3045 SetSourcePosition(prop->position()); | 3041 SetSourcePosition(prop->position()); |
3046 // Load the function from the receiver. | 3042 // Load the function from the receiver. |
3047 const Register scratch = r4; | 3043 const Register scratch = r4; |
3048 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 3044 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
3049 VisitForAccumulatorValue(super_ref->home_object()); | 3045 VisitForAccumulatorValue(super_ref->home_object()); |
3050 __ mr(scratch, r3); | 3046 __ mr(scratch, r3); |
3051 VisitForAccumulatorValue(super_ref->this_var()); | 3047 VisitForAccumulatorValue(super_ref->this_var()); |
3052 __ Push(scratch, r3, r3, scratch); | 3048 __ Push(scratch, r3, r3, scratch); |
3053 VisitForStackValue(prop->key()); | 3049 VisitForStackValue(prop->key()); |
3054 __ Push(Smi::FromInt(language_mode())); | |
3055 | 3050 |
3056 // Stack here: | 3051 // Stack here: |
3057 // - home_object | 3052 // - home_object |
3058 // - this (receiver) | 3053 // - this (receiver) |
3059 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. | 3054 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. |
3060 // - home_object | 3055 // - home_object |
3061 // - key | 3056 // - key |
3062 // - language_mode | 3057 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); |
3063 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4); | |
3064 | 3058 |
3065 // Replace home_object with target function. | 3059 // Replace home_object with target function. |
3066 __ StoreP(r3, MemOperand(sp, kPointerSize)); | 3060 __ StoreP(r3, MemOperand(sp, kPointerSize)); |
3067 | 3061 |
3068 // Stack here: | 3062 // Stack here: |
3069 // - target function | 3063 // - target function |
3070 // - this (receiver) | 3064 // - this (receiver) |
3071 EmitCall(expr, CallICState::METHOD); | 3065 EmitCall(expr, CallICState::METHOD); |
3072 } | 3066 } |
3073 | 3067 |
(...skipping 2499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5573 return ON_STACK_REPLACEMENT; | 5567 return ON_STACK_REPLACEMENT; |
5574 } | 5568 } |
5575 | 5569 |
5576 DCHECK(interrupt_address == | 5570 DCHECK(interrupt_address == |
5577 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5571 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5578 return OSR_AFTER_STACK_CHECK; | 5572 return OSR_AFTER_STACK_CHECK; |
5579 } | 5573 } |
5580 } // namespace internal | 5574 } // namespace internal |
5581 } // namespace v8 | 5575 } // namespace v8 |
5582 #endif // V8_TARGET_ARCH_PPC | 5576 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |