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