OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
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 2081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2092 | 2092 |
2093 | 2093 |
2094 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2094 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
2095 SetSourcePosition(prop->position()); | 2095 SetSourcePosition(prop->position()); |
2096 Literal* key = prop->key()->AsLiteral(); | 2096 Literal* key = prop->key()->AsLiteral(); |
2097 DCHECK(!prop->IsSuperAccess()); | 2097 DCHECK(!prop->IsSuperAccess()); |
2098 | 2098 |
2099 __ Mov(LoadDescriptor::NameRegister(), Operand(key->value())); | 2099 __ Mov(LoadDescriptor::NameRegister(), Operand(key->value())); |
2100 __ Mov(LoadDescriptor::SlotRegister(), | 2100 __ Mov(LoadDescriptor::SlotRegister(), |
2101 SmiFromSlot(prop->PropertyFeedbackSlot())); | 2101 SmiFromSlot(prop->PropertyFeedbackSlot())); |
2102 CallLoadIC(NOT_CONTEXTUAL); | 2102 CallLoadIC(NOT_CONTEXTUAL, language_mode()); |
2103 } | 2103 } |
2104 | 2104 |
2105 | 2105 |
2106 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { | 2106 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { |
2107 // Stack: receiver, home_object. | 2107 // Stack: receiver, home_object. |
2108 SetSourcePosition(prop->position()); | 2108 SetSourcePosition(prop->position()); |
2109 Literal* key = prop->key()->AsLiteral(); | 2109 Literal* key = prop->key()->AsLiteral(); |
2110 DCHECK(!key->value()->IsSmi()); | 2110 DCHECK(!key->value()->IsSmi()); |
2111 DCHECK(prop->IsSuperAccess()); | 2111 DCHECK(prop->IsSuperAccess()); |
2112 | 2112 |
2113 __ Push(key->value()); | 2113 __ Push(key->value()); |
2114 __ CallRuntime(Runtime::kLoadFromSuper, 3); | 2114 __ Push(Smi::FromInt(language_mode())); |
| 2115 __ CallRuntime(Runtime::kLoadFromSuper, 4); |
2115 } | 2116 } |
2116 | 2117 |
2117 | 2118 |
2118 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2119 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
2119 SetSourcePosition(prop->position()); | 2120 SetSourcePosition(prop->position()); |
2120 // Call keyed load IC. It has arguments key and receiver in x0 and x1. | 2121 // Call keyed load IC. It has arguments key and receiver in x0 and x1. |
2121 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 2122 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code(); |
2122 __ Mov(LoadDescriptor::SlotRegister(), | 2123 __ Mov(LoadDescriptor::SlotRegister(), |
2123 SmiFromSlot(prop->PropertyFeedbackSlot())); | 2124 SmiFromSlot(prop->PropertyFeedbackSlot())); |
2124 CallIC(ic); | 2125 CallIC(ic); |
2125 } | 2126 } |
2126 | 2127 |
2127 | 2128 |
2128 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 2129 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
2129 // Stack: receiver, home_object, key. | 2130 // Stack: receiver, home_object, key. |
| 2131 __ Push(Smi::FromInt(language_mode())); |
2130 SetSourcePosition(prop->position()); | 2132 SetSourcePosition(prop->position()); |
2131 | 2133 |
2132 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); | 2134 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4); |
2133 } | 2135 } |
2134 | 2136 |
2135 | 2137 |
2136 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, | 2138 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, |
2137 Token::Value op, | 2139 Token::Value op, |
2138 Expression* left_expr, | 2140 Expression* left_expr, |
2139 Expression* right_expr) { | 2141 Expression* right_expr) { |
2140 Label done, both_smis, stub_call; | 2142 Label done, both_smis, stub_call; |
2141 | 2143 |
2142 // Get the arguments. | 2144 // Get the arguments. |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2677 // Load the function from the receiver. | 2679 // Load the function from the receiver. |
2678 const Register scratch = x10; | 2680 const Register scratch = x10; |
2679 SuperPropertyReference* super_ref = | 2681 SuperPropertyReference* super_ref = |
2680 callee->AsProperty()->obj()->AsSuperPropertyReference(); | 2682 callee->AsProperty()->obj()->AsSuperPropertyReference(); |
2681 VisitForStackValue(super_ref->home_object()); | 2683 VisitForStackValue(super_ref->home_object()); |
2682 VisitForAccumulatorValue(super_ref->this_var()); | 2684 VisitForAccumulatorValue(super_ref->this_var()); |
2683 __ Push(x0); | 2685 __ Push(x0); |
2684 __ Peek(scratch, kPointerSize); | 2686 __ Peek(scratch, kPointerSize); |
2685 __ Push(x0, scratch); | 2687 __ Push(x0, scratch); |
2686 __ Push(key->value()); | 2688 __ Push(key->value()); |
| 2689 __ Push(Smi::FromInt(language_mode())); |
2687 | 2690 |
2688 // Stack here: | 2691 // Stack here: |
2689 // - home_object | 2692 // - home_object |
2690 // - this (receiver) | 2693 // - this (receiver) |
2691 // - this (receiver) <-- LoadFromSuper will pop here and below. | 2694 // - this (receiver) <-- LoadFromSuper will pop here and below. |
2692 // - home_object | 2695 // - home_object |
2693 // - key | 2696 // - language_mode |
2694 __ CallRuntime(Runtime::kLoadFromSuper, 3); | 2697 __ CallRuntime(Runtime::kLoadFromSuper, 4); |
2695 | 2698 |
2696 // Replace home_object with target function. | 2699 // Replace home_object with target function. |
2697 __ Poke(x0, kPointerSize); | 2700 __ Poke(x0, kPointerSize); |
2698 | 2701 |
2699 // Stack here: | 2702 // Stack here: |
2700 // - target function | 2703 // - target function |
2701 // - this (receiver) | 2704 // - this (receiver) |
2702 EmitCall(expr, CallICState::METHOD); | 2705 EmitCall(expr, CallICState::METHOD); |
2703 } | 2706 } |
2704 | 2707 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2737 // Load the function from the receiver. | 2740 // Load the function from the receiver. |
2738 const Register scratch = x10; | 2741 const Register scratch = x10; |
2739 SuperPropertyReference* super_ref = | 2742 SuperPropertyReference* super_ref = |
2740 callee->AsProperty()->obj()->AsSuperPropertyReference(); | 2743 callee->AsProperty()->obj()->AsSuperPropertyReference(); |
2741 VisitForStackValue(super_ref->home_object()); | 2744 VisitForStackValue(super_ref->home_object()); |
2742 VisitForAccumulatorValue(super_ref->this_var()); | 2745 VisitForAccumulatorValue(super_ref->this_var()); |
2743 __ Push(x0); | 2746 __ Push(x0); |
2744 __ Peek(scratch, kPointerSize); | 2747 __ Peek(scratch, kPointerSize); |
2745 __ Push(x0, scratch); | 2748 __ Push(x0, scratch); |
2746 VisitForStackValue(prop->key()); | 2749 VisitForStackValue(prop->key()); |
| 2750 __ Push(Smi::FromInt(language_mode())); |
2747 | 2751 |
2748 // Stack here: | 2752 // Stack here: |
2749 // - home_object | 2753 // - home_object |
2750 // - this (receiver) | 2754 // - this (receiver) |
2751 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. | 2755 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. |
2752 // - home_object | 2756 // - home_object |
2753 // - key | 2757 // - key |
2754 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); | 2758 // - language_mode |
| 2759 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4); |
2755 | 2760 |
2756 // Replace home_object with target function. | 2761 // Replace home_object with target function. |
2757 __ Poke(x0, kPointerSize); | 2762 __ Poke(x0, kPointerSize); |
2758 | 2763 |
2759 // Stack here: | 2764 // Stack here: |
2760 // - target function | 2765 // - target function |
2761 // - this (receiver) | 2766 // - this (receiver) |
2762 EmitCall(expr, CallICState::METHOD); | 2767 EmitCall(expr, CallICState::METHOD); |
2763 } | 2768 } |
2764 | 2769 |
(...skipping 2438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5203 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" | 5208 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" |
5204 __ Peek(x3, 1 * kPointerSize); // iter | 5209 __ Peek(x3, 1 * kPointerSize); // iter |
5205 __ Push(load_name, x3, x0); // "next", iter, received | 5210 __ Push(load_name, x3, x0); // "next", iter, received |
5206 | 5211 |
5207 // result = receiver[f](arg); | 5212 // result = receiver[f](arg); |
5208 __ Bind(&l_call); | 5213 __ Bind(&l_call); |
5209 __ Peek(load_receiver, 1 * kPointerSize); | 5214 __ Peek(load_receiver, 1 * kPointerSize); |
5210 __ Peek(load_name, 2 * kPointerSize); | 5215 __ Peek(load_name, 2 * kPointerSize); |
5211 __ Mov(LoadDescriptor::SlotRegister(), | 5216 __ Mov(LoadDescriptor::SlotRegister(), |
5212 SmiFromSlot(expr->KeyedLoadFeedbackSlot())); | 5217 SmiFromSlot(expr->KeyedLoadFeedbackSlot())); |
5213 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 5218 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code(); |
5214 CallIC(ic, TypeFeedbackId::None()); | 5219 CallIC(ic, TypeFeedbackId::None()); |
5215 __ Mov(x1, x0); | 5220 __ Mov(x1, x0); |
5216 __ Poke(x1, 2 * kPointerSize); | 5221 __ Poke(x1, 2 * kPointerSize); |
5217 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); | 5222 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); |
5218 __ CallStub(&stub); | 5223 __ CallStub(&stub); |
5219 | 5224 |
5220 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 5225 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
5221 __ Drop(1); // The function is still on the stack; drop it. | 5226 __ Drop(1); // The function is still on the stack; drop it. |
5222 | 5227 |
5223 // if (!result.done) goto l_try; | 5228 // if (!result.done) goto l_try; |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5597 } | 5602 } |
5598 | 5603 |
5599 return INTERRUPT; | 5604 return INTERRUPT; |
5600 } | 5605 } |
5601 | 5606 |
5602 | 5607 |
5603 } // namespace internal | 5608 } // namespace internal |
5604 } // namespace v8 | 5609 } // namespace v8 |
5605 | 5610 |
5606 #endif // V8_TARGET_ARCH_ARM64 | 5611 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |