| 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 2073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2084 | 2084 |
| 2085 | 2085 |
| 2086 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2086 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
| 2087 SetSourcePosition(prop->position()); | 2087 SetSourcePosition(prop->position()); |
| 2088 Literal* key = prop->key()->AsLiteral(); | 2088 Literal* key = prop->key()->AsLiteral(); |
| 2089 DCHECK(!prop->IsSuperAccess()); | 2089 DCHECK(!prop->IsSuperAccess()); |
| 2090 | 2090 |
| 2091 __ Mov(LoadDescriptor::NameRegister(), Operand(key->value())); | 2091 __ Mov(LoadDescriptor::NameRegister(), Operand(key->value())); |
| 2092 __ Mov(LoadDescriptor::SlotRegister(), | 2092 __ Mov(LoadDescriptor::SlotRegister(), |
| 2093 SmiFromSlot(prop->PropertyFeedbackSlot())); | 2093 SmiFromSlot(prop->PropertyFeedbackSlot())); |
| 2094 CallLoadIC(NOT_CONTEXTUAL); | 2094 CallLoadIC(NOT_CONTEXTUAL, language_mode()); |
| 2095 } | 2095 } |
| 2096 | 2096 |
| 2097 | 2097 |
| 2098 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { | 2098 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { |
| 2099 // Stack: receiver, home_object. | 2099 // Stack: receiver, home_object. |
| 2100 SetSourcePosition(prop->position()); | 2100 SetSourcePosition(prop->position()); |
| 2101 Literal* key = prop->key()->AsLiteral(); | 2101 Literal* key = prop->key()->AsLiteral(); |
| 2102 DCHECK(!key->value()->IsSmi()); | 2102 DCHECK(!key->value()->IsSmi()); |
| 2103 DCHECK(prop->IsSuperAccess()); | 2103 DCHECK(prop->IsSuperAccess()); |
| 2104 | 2104 |
| 2105 __ Push(key->value()); | 2105 __ Push(key->value()); |
| 2106 __ CallRuntime(Runtime::kLoadFromSuper, 3); | 2106 __ Push(Smi::FromInt(language_mode())); |
| 2107 __ CallRuntime(Runtime::kLoadFromSuper, 4); |
| 2107 } | 2108 } |
| 2108 | 2109 |
| 2109 | 2110 |
| 2110 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2111 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
| 2111 SetSourcePosition(prop->position()); | 2112 SetSourcePosition(prop->position()); |
| 2112 // Call keyed load IC. It has arguments key and receiver in x0 and x1. | 2113 // Call keyed load IC. It has arguments key and receiver in x0 and x1. |
| 2113 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 2114 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code(); |
| 2114 __ Mov(LoadDescriptor::SlotRegister(), | 2115 __ Mov(LoadDescriptor::SlotRegister(), |
| 2115 SmiFromSlot(prop->PropertyFeedbackSlot())); | 2116 SmiFromSlot(prop->PropertyFeedbackSlot())); |
| 2116 CallIC(ic); | 2117 CallIC(ic); |
| 2117 } | 2118 } |
| 2118 | 2119 |
| 2119 | 2120 |
| 2120 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 2121 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
| 2121 // Stack: receiver, home_object, key. | 2122 // Stack: receiver, home_object, key. |
| 2123 __ Push(Smi::FromInt(language_mode())); |
| 2122 SetSourcePosition(prop->position()); | 2124 SetSourcePosition(prop->position()); |
| 2123 | 2125 |
| 2124 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); | 2126 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4); |
| 2125 } | 2127 } |
| 2126 | 2128 |
| 2127 | 2129 |
| 2128 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, | 2130 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, |
| 2129 Token::Value op, | 2131 Token::Value op, |
| 2130 Expression* left_expr, | 2132 Expression* left_expr, |
| 2131 Expression* right_expr) { | 2133 Expression* right_expr) { |
| 2132 Label done, both_smis, stub_call; | 2134 Label done, both_smis, stub_call; |
| 2133 | 2135 |
| 2134 // Get the arguments. | 2136 // Get the arguments. |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2676 // Load the function from the receiver. | 2678 // Load the function from the receiver. |
| 2677 const Register scratch = x10; | 2679 const Register scratch = x10; |
| 2678 SuperPropertyReference* super_ref = | 2680 SuperPropertyReference* super_ref = |
| 2679 callee->AsProperty()->obj()->AsSuperPropertyReference(); | 2681 callee->AsProperty()->obj()->AsSuperPropertyReference(); |
| 2680 VisitForStackValue(super_ref->home_object()); | 2682 VisitForStackValue(super_ref->home_object()); |
| 2681 VisitForAccumulatorValue(super_ref->this_var()); | 2683 VisitForAccumulatorValue(super_ref->this_var()); |
| 2682 __ Push(x0); | 2684 __ Push(x0); |
| 2683 __ Peek(scratch, kPointerSize); | 2685 __ Peek(scratch, kPointerSize); |
| 2684 __ Push(x0, scratch); | 2686 __ Push(x0, scratch); |
| 2685 __ Push(key->value()); | 2687 __ Push(key->value()); |
| 2688 __ Push(Smi::FromInt(language_mode())); |
| 2686 | 2689 |
| 2687 // Stack here: | 2690 // Stack here: |
| 2688 // - home_object | 2691 // - home_object |
| 2689 // - this (receiver) | 2692 // - this (receiver) |
| 2690 // - this (receiver) <-- LoadFromSuper will pop here and below. | 2693 // - this (receiver) <-- LoadFromSuper will pop here and below. |
| 2691 // - home_object | 2694 // - home_object |
| 2692 // - key | 2695 // - language_mode |
| 2693 __ CallRuntime(Runtime::kLoadFromSuper, 3); | 2696 __ CallRuntime(Runtime::kLoadFromSuper, 4); |
| 2694 | 2697 |
| 2695 // Replace home_object with target function. | 2698 // Replace home_object with target function. |
| 2696 __ Poke(x0, kPointerSize); | 2699 __ Poke(x0, kPointerSize); |
| 2697 | 2700 |
| 2698 // Stack here: | 2701 // Stack here: |
| 2699 // - target function | 2702 // - target function |
| 2700 // - this (receiver) | 2703 // - this (receiver) |
| 2701 EmitCall(expr, CallICState::METHOD); | 2704 EmitCall(expr, CallICState::METHOD); |
| 2702 } | 2705 } |
| 2703 | 2706 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2736 // Load the function from the receiver. | 2739 // Load the function from the receiver. |
| 2737 const Register scratch = x10; | 2740 const Register scratch = x10; |
| 2738 SuperPropertyReference* super_ref = | 2741 SuperPropertyReference* super_ref = |
| 2739 callee->AsProperty()->obj()->AsSuperPropertyReference(); | 2742 callee->AsProperty()->obj()->AsSuperPropertyReference(); |
| 2740 VisitForStackValue(super_ref->home_object()); | 2743 VisitForStackValue(super_ref->home_object()); |
| 2741 VisitForAccumulatorValue(super_ref->this_var()); | 2744 VisitForAccumulatorValue(super_ref->this_var()); |
| 2742 __ Push(x0); | 2745 __ Push(x0); |
| 2743 __ Peek(scratch, kPointerSize); | 2746 __ Peek(scratch, kPointerSize); |
| 2744 __ Push(x0, scratch); | 2747 __ Push(x0, scratch); |
| 2745 VisitForStackValue(prop->key()); | 2748 VisitForStackValue(prop->key()); |
| 2749 __ Push(Smi::FromInt(language_mode())); |
| 2746 | 2750 |
| 2747 // Stack here: | 2751 // Stack here: |
| 2748 // - home_object | 2752 // - home_object |
| 2749 // - this (receiver) | 2753 // - this (receiver) |
| 2750 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. | 2754 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. |
| 2751 // - home_object | 2755 // - home_object |
| 2752 // - key | 2756 // - key |
| 2753 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); | 2757 // - language_mode |
| 2758 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4); |
| 2754 | 2759 |
| 2755 // Replace home_object with target function. | 2760 // Replace home_object with target function. |
| 2756 __ Poke(x0, kPointerSize); | 2761 __ Poke(x0, kPointerSize); |
| 2757 | 2762 |
| 2758 // Stack here: | 2763 // Stack here: |
| 2759 // - target function | 2764 // - target function |
| 2760 // - this (receiver) | 2765 // - this (receiver) |
| 2761 EmitCall(expr, CallICState::METHOD); | 2766 EmitCall(expr, CallICState::METHOD); |
| 2762 } | 2767 } |
| 2763 | 2768 |
| (...skipping 2410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5174 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" | 5179 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" |
| 5175 __ Peek(x3, 1 * kPointerSize); // iter | 5180 __ Peek(x3, 1 * kPointerSize); // iter |
| 5176 __ Push(load_name, x3, x0); // "next", iter, received | 5181 __ Push(load_name, x3, x0); // "next", iter, received |
| 5177 | 5182 |
| 5178 // result = receiver[f](arg); | 5183 // result = receiver[f](arg); |
| 5179 __ Bind(&l_call); | 5184 __ Bind(&l_call); |
| 5180 __ Peek(load_receiver, 1 * kPointerSize); | 5185 __ Peek(load_receiver, 1 * kPointerSize); |
| 5181 __ Peek(load_name, 2 * kPointerSize); | 5186 __ Peek(load_name, 2 * kPointerSize); |
| 5182 __ Mov(LoadDescriptor::SlotRegister(), | 5187 __ Mov(LoadDescriptor::SlotRegister(), |
| 5183 SmiFromSlot(expr->KeyedLoadFeedbackSlot())); | 5188 SmiFromSlot(expr->KeyedLoadFeedbackSlot())); |
| 5184 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 5189 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code(); |
| 5185 CallIC(ic, TypeFeedbackId::None()); | 5190 CallIC(ic, TypeFeedbackId::None()); |
| 5186 __ Mov(x1, x0); | 5191 __ Mov(x1, x0); |
| 5187 __ Poke(x1, 2 * kPointerSize); | 5192 __ Poke(x1, 2 * kPointerSize); |
| 5188 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); | 5193 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); |
| 5189 __ CallStub(&stub); | 5194 __ CallStub(&stub); |
| 5190 | 5195 |
| 5191 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 5196 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 5192 __ Drop(1); // The function is still on the stack; drop it. | 5197 __ Drop(1); // The function is still on the stack; drop it. |
| 5193 | 5198 |
| 5194 // if (!result.done) goto l_try; | 5199 // if (!result.done) goto l_try; |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5568 } | 5573 } |
| 5569 | 5574 |
| 5570 return INTERRUPT; | 5575 return INTERRUPT; |
| 5571 } | 5576 } |
| 5572 | 5577 |
| 5573 | 5578 |
| 5574 } // namespace internal | 5579 } // namespace internal |
| 5575 } // namespace v8 | 5580 } // namespace v8 |
| 5576 | 5581 |
| 5577 #endif // V8_TARGET_ARCH_ARM64 | 5582 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |