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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1720 // You can't call a builtin without a valid frame. | 1720 // You can't call a builtin without a valid frame. |
1721 DCHECK(flag == JUMP_FUNCTION || has_frame()); | 1721 DCHECK(flag == JUMP_FUNCTION || has_frame()); |
1722 | 1722 |
1723 // Fake a parameter count to avoid emitting code to do the check. | 1723 // Fake a parameter count to avoid emitting code to do the check. |
1724 ParameterCount expected(0); | 1724 ParameterCount expected(0); |
1725 LoadNativeContextSlot(native_context_index, x1); | 1725 LoadNativeContextSlot(native_context_index, x1); |
1726 InvokeFunctionCode(x1, no_reg, expected, expected, flag, call_wrapper); | 1726 InvokeFunctionCode(x1, no_reg, expected, expected, flag, call_wrapper); |
1727 } | 1727 } |
1728 | 1728 |
1729 | 1729 |
1730 void MacroAssembler::TailCallExternalReference(const ExternalReference& ext, | 1730 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) { |
1731 int num_arguments) { | 1731 const Runtime::Function* function = Runtime::FunctionForId(fid); |
1732 // TODO(1236192): Most runtime routines don't need the number of | 1732 DCHECK_EQ(1, function->result_size); |
1733 // arguments passed in because it is constant. At some point we | 1733 if (function->nargs >= 0) { |
1734 // should remove this need and make the runtime routine entry code | 1734 // TODO(1236192): Most runtime routines don't need the number of |
1735 // smarter. | 1735 // arguments passed in because it is constant. At some point we |
1736 Mov(x0, num_arguments); | 1736 // should remove this need and make the runtime routine entry code |
1737 JumpToExternalReference(ext); | 1737 // smarter. |
| 1738 Mov(x0, function->nargs); |
| 1739 } |
| 1740 JumpToExternalReference(ExternalReference(fid, isolate())); |
1738 } | 1741 } |
1739 | 1742 |
1740 | 1743 |
1741 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid, | |
1742 int num_arguments) { | |
1743 TailCallExternalReference(ExternalReference(fid, isolate()), num_arguments); | |
1744 } | |
1745 | |
1746 | |
1747 void MacroAssembler::InitializeNewString(Register string, | 1744 void MacroAssembler::InitializeNewString(Register string, |
1748 Register length, | 1745 Register length, |
1749 Heap::RootListIndex map_index, | 1746 Heap::RootListIndex map_index, |
1750 Register scratch1, | 1747 Register scratch1, |
1751 Register scratch2) { | 1748 Register scratch2) { |
1752 DCHECK(!AreAliased(string, length, scratch1, scratch2)); | 1749 DCHECK(!AreAliased(string, length, scratch1, scratch2)); |
1753 LoadRoot(scratch2, map_index); | 1750 LoadRoot(scratch2, map_index); |
1754 SmiTag(scratch1, length); | 1751 SmiTag(scratch1, length); |
1755 Str(scratch2, FieldMemOperand(string, HeapObject::kMapOffset)); | 1752 Str(scratch2, FieldMemOperand(string, HeapObject::kMapOffset)); |
1756 | 1753 |
(...skipping 3111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4868 } | 4865 } |
4869 | 4866 |
4870 | 4867 |
4871 #undef __ | 4868 #undef __ |
4872 | 4869 |
4873 | 4870 |
4874 } // namespace internal | 4871 } // namespace internal |
4875 } // namespace v8 | 4872 } // namespace v8 |
4876 | 4873 |
4877 #endif // V8_TARGET_ARCH_ARM64 | 4874 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |