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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2065 | 2065 |
2066 | 2066 |
2067 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2067 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
2068 SetExpressionPosition(prop); | 2068 SetExpressionPosition(prop); |
2069 Literal* key = prop->key()->AsLiteral(); | 2069 Literal* key = prop->key()->AsLiteral(); |
2070 DCHECK(!prop->IsSuperAccess()); | 2070 DCHECK(!prop->IsSuperAccess()); |
2071 | 2071 |
2072 __ mov(LoadDescriptor::NameRegister(), Operand(key->value())); | 2072 __ mov(LoadDescriptor::NameRegister(), Operand(key->value())); |
2073 __ mov(LoadDescriptor::SlotRegister(), | 2073 __ mov(LoadDescriptor::SlotRegister(), |
2074 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2074 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
2075 CallLoadIC(NOT_INSIDE_TYPEOF, language_mode()); | 2075 CallLoadIC(NOT_INSIDE_TYPEOF); |
2076 } | 2076 } |
2077 | 2077 |
2078 | 2078 |
2079 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { | 2079 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { |
2080 // Stack: receiver, home_object. | 2080 // Stack: receiver, home_object. |
2081 SetExpressionPosition(prop); | 2081 SetExpressionPosition(prop); |
2082 Literal* key = prop->key()->AsLiteral(); | 2082 Literal* key = prop->key()->AsLiteral(); |
2083 DCHECK(!key->value()->IsSmi()); | 2083 DCHECK(!key->value()->IsSmi()); |
2084 DCHECK(prop->IsSuperAccess()); | 2084 DCHECK(prop->IsSuperAccess()); |
2085 | 2085 |
2086 __ Push(key->value()); | 2086 __ Push(key->value()); |
2087 __ Push(Smi::FromInt(language_mode())); | |
2088 __ CallRuntime(Runtime::kLoadFromSuper); | 2087 __ CallRuntime(Runtime::kLoadFromSuper); |
2089 } | 2088 } |
2090 | 2089 |
2091 | 2090 |
2092 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2091 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
2093 SetExpressionPosition(prop); | 2092 SetExpressionPosition(prop); |
2094 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code(); | 2093 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
2095 __ mov(LoadDescriptor::SlotRegister(), | 2094 __ mov(LoadDescriptor::SlotRegister(), |
2096 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2095 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
2097 CallIC(ic); | 2096 CallIC(ic); |
2098 } | 2097 } |
2099 | 2098 |
2100 | 2099 |
2101 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 2100 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
2102 // Stack: receiver, home_object, key. | 2101 // Stack: receiver, home_object, key. |
2103 SetExpressionPosition(prop); | 2102 SetExpressionPosition(prop); |
2104 __ Push(Smi::FromInt(language_mode())); | |
2105 __ CallRuntime(Runtime::kLoadKeyedFromSuper); | 2103 __ CallRuntime(Runtime::kLoadKeyedFromSuper); |
2106 } | 2104 } |
2107 | 2105 |
2108 | 2106 |
2109 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, | 2107 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, |
2110 Token::Value op, | 2108 Token::Value op, |
2111 Expression* left_expr, | 2109 Expression* left_expr, |
2112 Expression* right_expr) { | 2110 Expression* right_expr) { |
2113 Label done, smi_case, stub_call; | 2111 Label done, smi_case, stub_call; |
2114 | 2112 |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2643 Literal* key = prop->key()->AsLiteral(); | 2641 Literal* key = prop->key()->AsLiteral(); |
2644 DCHECK(!key->value()->IsSmi()); | 2642 DCHECK(!key->value()->IsSmi()); |
2645 // Load the function from the receiver. | 2643 // Load the function from the receiver. |
2646 const Register scratch = r4; | 2644 const Register scratch = r4; |
2647 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 2645 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
2648 VisitForAccumulatorValue(super_ref->home_object()); | 2646 VisitForAccumulatorValue(super_ref->home_object()); |
2649 __ mr(scratch, r3); | 2647 __ mr(scratch, r3); |
2650 VisitForAccumulatorValue(super_ref->this_var()); | 2648 VisitForAccumulatorValue(super_ref->this_var()); |
2651 __ Push(scratch, r3, r3, scratch); | 2649 __ Push(scratch, r3, r3, scratch); |
2652 __ Push(key->value()); | 2650 __ Push(key->value()); |
2653 __ Push(Smi::FromInt(language_mode())); | |
2654 | 2651 |
2655 // Stack here: | 2652 // Stack here: |
2656 // - home_object | 2653 // - home_object |
2657 // - this (receiver) | 2654 // - this (receiver) |
2658 // - this (receiver) <-- LoadFromSuper will pop here and below. | 2655 // - this (receiver) <-- LoadFromSuper will pop here and below. |
2659 // - home_object | 2656 // - home_object |
2660 // - key | 2657 // - key |
2661 // - language_mode | |
2662 __ CallRuntime(Runtime::kLoadFromSuper); | 2658 __ CallRuntime(Runtime::kLoadFromSuper); |
2663 | 2659 |
2664 // Replace home_object with target function. | 2660 // Replace home_object with target function. |
2665 __ StoreP(r3, MemOperand(sp, kPointerSize)); | 2661 __ StoreP(r3, MemOperand(sp, kPointerSize)); |
2666 | 2662 |
2667 // Stack here: | 2663 // Stack here: |
2668 // - target function | 2664 // - target function |
2669 // - this (receiver) | 2665 // - this (receiver) |
2670 EmitCall(expr); | 2666 EmitCall(expr); |
2671 } | 2667 } |
(...skipping 30 matching lines...) Expand all Loading... |
2702 | 2698 |
2703 SetExpressionPosition(prop); | 2699 SetExpressionPosition(prop); |
2704 // Load the function from the receiver. | 2700 // Load the function from the receiver. |
2705 const Register scratch = r4; | 2701 const Register scratch = r4; |
2706 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 2702 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
2707 VisitForAccumulatorValue(super_ref->home_object()); | 2703 VisitForAccumulatorValue(super_ref->home_object()); |
2708 __ mr(scratch, r3); | 2704 __ mr(scratch, r3); |
2709 VisitForAccumulatorValue(super_ref->this_var()); | 2705 VisitForAccumulatorValue(super_ref->this_var()); |
2710 __ Push(scratch, r3, r3, scratch); | 2706 __ Push(scratch, r3, r3, scratch); |
2711 VisitForStackValue(prop->key()); | 2707 VisitForStackValue(prop->key()); |
2712 __ Push(Smi::FromInt(language_mode())); | |
2713 | 2708 |
2714 // Stack here: | 2709 // Stack here: |
2715 // - home_object | 2710 // - home_object |
2716 // - this (receiver) | 2711 // - this (receiver) |
2717 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. | 2712 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. |
2718 // - home_object | 2713 // - home_object |
2719 // - key | 2714 // - key |
2720 // - language_mode | |
2721 __ CallRuntime(Runtime::kLoadKeyedFromSuper); | 2715 __ CallRuntime(Runtime::kLoadKeyedFromSuper); |
2722 | 2716 |
2723 // Replace home_object with target function. | 2717 // Replace home_object with target function. |
2724 __ StoreP(r3, MemOperand(sp, kPointerSize)); | 2718 __ StoreP(r3, MemOperand(sp, kPointerSize)); |
2725 | 2719 |
2726 // Stack here: | 2720 // Stack here: |
2727 // - target function | 2721 // - target function |
2728 // - this (receiver) | 2722 // - this (receiver) |
2729 EmitCall(expr); | 2723 EmitCall(expr); |
2730 } | 2724 } |
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4563 return ON_STACK_REPLACEMENT; | 4557 return ON_STACK_REPLACEMENT; |
4564 } | 4558 } |
4565 | 4559 |
4566 DCHECK(interrupt_address == | 4560 DCHECK(interrupt_address == |
4567 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4561 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4568 return OSR_AFTER_STACK_CHECK; | 4562 return OSR_AFTER_STACK_CHECK; |
4569 } | 4563 } |
4570 } // namespace internal | 4564 } // namespace internal |
4571 } // namespace v8 | 4565 } // namespace v8 |
4572 #endif // V8_TARGET_ARCH_PPC | 4566 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |