| 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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // Generators allocate locals, if any, in context slots. | 153 // Generators allocate locals, if any, in context slots. |
| 154 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); | 154 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); |
| 155 | 155 |
| 156 if (locals_count > 0) { | 156 if (locals_count > 0) { |
| 157 if (locals_count >= 128) { | 157 if (locals_count >= 128) { |
| 158 Label ok; | 158 Label ok; |
| 159 DCHECK(jssp.Is(__ StackPointer())); | 159 DCHECK(jssp.Is(__ StackPointer())); |
| 160 __ Sub(x10, jssp, locals_count * kPointerSize); | 160 __ Sub(x10, jssp, locals_count * kPointerSize); |
| 161 __ CompareRoot(x10, Heap::kRealStackLimitRootIndex); | 161 __ CompareRoot(x10, Heap::kRealStackLimitRootIndex); |
| 162 __ B(hs, &ok); | 162 __ B(hs, &ok); |
| 163 __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); | 163 __ InvokeBuiltin(Context::STACK_OVERFLOW_BUILTIN_INDEX, CALL_FUNCTION); |
| 164 __ Bind(&ok); | 164 __ Bind(&ok); |
| 165 } | 165 } |
| 166 __ LoadRoot(x10, Heap::kUndefinedValueRootIndex); | 166 __ LoadRoot(x10, Heap::kUndefinedValueRootIndex); |
| 167 if (FLAG_optimize_for_size) { | 167 if (FLAG_optimize_for_size) { |
| 168 __ PushMultipleTimes(x10 , locals_count); | 168 __ PushMultipleTimes(x10 , locals_count); |
| 169 } else { | 169 } else { |
| 170 const int kMaxPushes = 32; | 170 const int kMaxPushes = 32; |
| 171 if (locals_count >= kMaxPushes) { | 171 if (locals_count >= kMaxPushes) { |
| 172 int loop_iterations = locals_count / kMaxPushes; | 172 int loop_iterations = locals_count / kMaxPushes; |
| 173 __ Mov(x3, loop_iterations); | 173 __ Mov(x3, loop_iterations); |
| (...skipping 1708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1882 __ Drop(1); // literal index | 1882 __ Drop(1); // literal index |
| 1883 __ Pop(x0); | 1883 __ Pop(x0); |
| 1884 result_saved = false; | 1884 result_saved = false; |
| 1885 } | 1885 } |
| 1886 for (; array_index < length; array_index++) { | 1886 for (; array_index < length; array_index++) { |
| 1887 Expression* subexpr = subexprs->at(array_index); | 1887 Expression* subexpr = subexprs->at(array_index); |
| 1888 | 1888 |
| 1889 __ Push(x0); | 1889 __ Push(x0); |
| 1890 if (subexpr->IsSpread()) { | 1890 if (subexpr->IsSpread()) { |
| 1891 VisitForStackValue(subexpr->AsSpread()->expression()); | 1891 VisitForStackValue(subexpr->AsSpread()->expression()); |
| 1892 __ InvokeBuiltin(Builtins::CONCAT_ITERABLE_TO_ARRAY, CALL_FUNCTION); | 1892 __ InvokeBuiltin(Context::CONCAT_ITERABLE_TO_ARRAY_BUILTIN_INDEX, |
| 1893 CALL_FUNCTION); |
| 1893 } else { | 1894 } else { |
| 1894 VisitForStackValue(subexpr); | 1895 VisitForStackValue(subexpr); |
| 1895 __ CallRuntime(Runtime::kAppendElement, 2); | 1896 __ CallRuntime(Runtime::kAppendElement, 2); |
| 1896 } | 1897 } |
| 1897 | 1898 |
| 1898 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); | 1899 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); |
| 1899 } | 1900 } |
| 1900 | 1901 |
| 1901 if (result_saved) { | 1902 if (result_saved) { |
| 1902 __ Drop(1); // literal index | 1903 __ Drop(1); // literal index |
| (...skipping 2846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4749 Label* if_false = NULL; | 4750 Label* if_false = NULL; |
| 4750 Label* fall_through = NULL; | 4751 Label* fall_through = NULL; |
| 4751 context()->PrepareTest(&materialize_true, &materialize_false, | 4752 context()->PrepareTest(&materialize_true, &materialize_false, |
| 4752 &if_true, &if_false, &fall_through); | 4753 &if_true, &if_false, &fall_through); |
| 4753 | 4754 |
| 4754 Token::Value op = expr->op(); | 4755 Token::Value op = expr->op(); |
| 4755 VisitForStackValue(expr->left()); | 4756 VisitForStackValue(expr->left()); |
| 4756 switch (op) { | 4757 switch (op) { |
| 4757 case Token::IN: | 4758 case Token::IN: |
| 4758 VisitForStackValue(expr->right()); | 4759 VisitForStackValue(expr->right()); |
| 4759 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION); | 4760 __ InvokeBuiltin(Context::IN_BUILTIN_INDEX, CALL_FUNCTION); |
| 4760 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 4761 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
| 4761 __ CompareRoot(x0, Heap::kTrueValueRootIndex); | 4762 __ CompareRoot(x0, Heap::kTrueValueRootIndex); |
| 4762 Split(eq, if_true, if_false, fall_through); | 4763 Split(eq, if_true, if_false, fall_through); |
| 4763 break; | 4764 break; |
| 4764 | 4765 |
| 4765 case Token::INSTANCEOF: { | 4766 case Token::INSTANCEOF: { |
| 4766 VisitForAccumulatorValue(expr->right()); | 4767 VisitForAccumulatorValue(expr->right()); |
| 4767 __ Pop(x1); | 4768 __ Pop(x1); |
| 4768 InstanceOfStub stub(isolate()); | 4769 InstanceOfStub stub(isolate()); |
| 4769 __ CallStub(&stub); | 4770 __ CallStub(&stub); |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5366 } | 5367 } |
| 5367 | 5368 |
| 5368 return INTERRUPT; | 5369 return INTERRUPT; |
| 5369 } | 5370 } |
| 5370 | 5371 |
| 5371 | 5372 |
| 5372 } // namespace internal | 5373 } // namespace internal |
| 5373 } // namespace v8 | 5374 } // namespace v8 |
| 5374 | 5375 |
| 5375 #endif // V8_TARGET_ARCH_ARM64 | 5376 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |