OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 2088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2099 | 2099 |
2100 | 2100 |
2101 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2101 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
2102 SetExpressionPosition(prop); | 2102 SetExpressionPosition(prop); |
2103 Literal* key = prop->key()->AsLiteral(); | 2103 Literal* key = prop->key()->AsLiteral(); |
2104 DCHECK(!prop->IsSuperAccess()); | 2104 DCHECK(!prop->IsSuperAccess()); |
2105 | 2105 |
2106 __ mov(LoadDescriptor::NameRegister(), Operand(key->value())); | 2106 __ mov(LoadDescriptor::NameRegister(), Operand(key->value())); |
2107 __ mov(LoadDescriptor::SlotRegister(), | 2107 __ mov(LoadDescriptor::SlotRegister(), |
2108 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2108 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
2109 CallLoadIC(NOT_INSIDE_TYPEOF, language_mode()); | 2109 CallLoadIC(NOT_INSIDE_TYPEOF); |
2110 } | 2110 } |
2111 | 2111 |
2112 | 2112 |
2113 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { | 2113 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { |
2114 // Stack: receiver, home_object. | 2114 // Stack: receiver, home_object. |
2115 SetExpressionPosition(prop); | 2115 SetExpressionPosition(prop); |
2116 Literal* key = prop->key()->AsLiteral(); | 2116 Literal* key = prop->key()->AsLiteral(); |
2117 DCHECK(!key->value()->IsSmi()); | 2117 DCHECK(!key->value()->IsSmi()); |
2118 DCHECK(prop->IsSuperAccess()); | 2118 DCHECK(prop->IsSuperAccess()); |
2119 | 2119 |
2120 __ Push(key->value()); | 2120 __ Push(key->value()); |
2121 __ Push(Smi::FromInt(language_mode())); | |
2122 __ CallRuntime(Runtime::kLoadFromSuper); | 2121 __ CallRuntime(Runtime::kLoadFromSuper); |
2123 } | 2122 } |
2124 | 2123 |
2125 | 2124 |
2126 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2125 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
2127 SetExpressionPosition(prop); | 2126 SetExpressionPosition(prop); |
2128 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code(); | 2127 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
2129 __ mov(LoadDescriptor::SlotRegister(), | 2128 __ mov(LoadDescriptor::SlotRegister(), |
2130 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); | 2129 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
2131 CallIC(ic); | 2130 CallIC(ic); |
2132 } | 2131 } |
2133 | 2132 |
2134 | 2133 |
2135 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 2134 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
2136 // Stack: receiver, home_object, key. | 2135 // Stack: receiver, home_object, key. |
2137 SetExpressionPosition(prop); | 2136 SetExpressionPosition(prop); |
2138 __ Push(Smi::FromInt(language_mode())); | |
2139 __ CallRuntime(Runtime::kLoadKeyedFromSuper); | 2137 __ CallRuntime(Runtime::kLoadKeyedFromSuper); |
2140 } | 2138 } |
2141 | 2139 |
2142 | 2140 |
2143 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, | 2141 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, |
2144 Token::Value op, | 2142 Token::Value op, |
2145 Expression* left_expr, | 2143 Expression* left_expr, |
2146 Expression* right_expr) { | 2144 Expression* right_expr) { |
2147 Label done, smi_case, stub_call; | 2145 Label done, smi_case, stub_call; |
2148 | 2146 |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2651 // Load the function from the receiver. | 2649 // Load the function from the receiver. |
2652 const Register scratch = r1; | 2650 const Register scratch = r1; |
2653 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 2651 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
2654 VisitForStackValue(super_ref->home_object()); | 2652 VisitForStackValue(super_ref->home_object()); |
2655 VisitForAccumulatorValue(super_ref->this_var()); | 2653 VisitForAccumulatorValue(super_ref->this_var()); |
2656 __ Push(r0); | 2654 __ Push(r0); |
2657 __ Push(r0); | 2655 __ Push(r0); |
2658 __ ldr(scratch, MemOperand(sp, kPointerSize * 2)); | 2656 __ ldr(scratch, MemOperand(sp, kPointerSize * 2)); |
2659 __ Push(scratch); | 2657 __ Push(scratch); |
2660 __ Push(key->value()); | 2658 __ Push(key->value()); |
2661 __ Push(Smi::FromInt(language_mode())); | |
2662 | 2659 |
2663 // Stack here: | 2660 // Stack here: |
2664 // - home_object | 2661 // - home_object |
2665 // - this (receiver) | 2662 // - this (receiver) |
2666 // - this (receiver) <-- LoadFromSuper will pop here and below. | 2663 // - this (receiver) <-- LoadFromSuper will pop here and below. |
2667 // - home_object | 2664 // - home_object |
2668 // - key | 2665 // - key |
2669 // - language_mode | |
2670 __ CallRuntime(Runtime::kLoadFromSuper); | 2666 __ CallRuntime(Runtime::kLoadFromSuper); |
2671 | 2667 |
2672 // Replace home_object with target function. | 2668 // Replace home_object with target function. |
2673 __ str(r0, MemOperand(sp, kPointerSize)); | 2669 __ str(r0, MemOperand(sp, kPointerSize)); |
2674 | 2670 |
2675 // Stack here: | 2671 // Stack here: |
2676 // - target function | 2672 // - target function |
2677 // - this (receiver) | 2673 // - this (receiver) |
2678 EmitCall(expr); | 2674 EmitCall(expr); |
2679 } | 2675 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2713 // Load the function from the receiver. | 2709 // Load the function from the receiver. |
2714 const Register scratch = r1; | 2710 const Register scratch = r1; |
2715 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); | 2711 SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference(); |
2716 VisitForStackValue(super_ref->home_object()); | 2712 VisitForStackValue(super_ref->home_object()); |
2717 VisitForAccumulatorValue(super_ref->this_var()); | 2713 VisitForAccumulatorValue(super_ref->this_var()); |
2718 __ Push(r0); | 2714 __ Push(r0); |
2719 __ Push(r0); | 2715 __ Push(r0); |
2720 __ ldr(scratch, MemOperand(sp, kPointerSize * 2)); | 2716 __ ldr(scratch, MemOperand(sp, kPointerSize * 2)); |
2721 __ Push(scratch); | 2717 __ Push(scratch); |
2722 VisitForStackValue(prop->key()); | 2718 VisitForStackValue(prop->key()); |
2723 __ Push(Smi::FromInt(language_mode())); | |
2724 | 2719 |
2725 // Stack here: | 2720 // Stack here: |
2726 // - home_object | 2721 // - home_object |
2727 // - this (receiver) | 2722 // - this (receiver) |
2728 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. | 2723 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. |
2729 // - home_object | 2724 // - home_object |
2730 // - key | 2725 // - key |
2731 // - language_mode | |
2732 __ CallRuntime(Runtime::kLoadKeyedFromSuper); | 2726 __ CallRuntime(Runtime::kLoadKeyedFromSuper); |
2733 | 2727 |
2734 // Replace home_object with target function. | 2728 // Replace home_object with target function. |
2735 __ str(r0, MemOperand(sp, kPointerSize)); | 2729 __ str(r0, MemOperand(sp, kPointerSize)); |
2736 | 2730 |
2737 // Stack here: | 2731 // Stack here: |
2738 // - target function | 2732 // - target function |
2739 // - this (receiver) | 2733 // - this (receiver) |
2740 EmitCall(expr); | 2734 EmitCall(expr); |
2741 } | 2735 } |
(...skipping 1900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4642 DCHECK(interrupt_address == | 4636 DCHECK(interrupt_address == |
4643 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4637 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4644 return OSR_AFTER_STACK_CHECK; | 4638 return OSR_AFTER_STACK_CHECK; |
4645 } | 4639 } |
4646 | 4640 |
4647 | 4641 |
4648 } // namespace internal | 4642 } // namespace internal |
4649 } // namespace v8 | 4643 } // namespace v8 |
4650 | 4644 |
4651 #endif // V8_TARGET_ARCH_ARM | 4645 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |