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 "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
10 #include "codegen.h" | 10 #include "codegen.h" |
(...skipping 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1608 | 1608 |
1609 | 1609 |
1610 void MacroAssembler::CallRuntime(const Runtime::Function* f, | 1610 void MacroAssembler::CallRuntime(const Runtime::Function* f, |
1611 int num_arguments, | 1611 int num_arguments, |
1612 SaveFPRegsMode save_doubles) { | 1612 SaveFPRegsMode save_doubles) { |
1613 // All arguments must be on the stack before this function is called. | 1613 // All arguments must be on the stack before this function is called. |
1614 // x0 holds the return value after the call. | 1614 // x0 holds the return value after the call. |
1615 | 1615 |
1616 // Check that the number of arguments matches what the function expects. | 1616 // Check that the number of arguments matches what the function expects. |
1617 // If f->nargs is -1, the function can accept a variable number of arguments. | 1617 // If f->nargs is -1, the function can accept a variable number of arguments. |
1618 if (f->nargs >= 0 && f->nargs != num_arguments) { | 1618 CHECK(f->nargs < 0 || f->nargs == num_arguments); |
1619 // Illegal operation: drop the stack arguments and return undefined. | |
1620 if (num_arguments > 0) { | |
1621 Drop(num_arguments); | |
1622 } | |
1623 LoadRoot(x0, Heap::kUndefinedValueRootIndex); | |
1624 return; | |
1625 } | |
1626 | 1619 |
1627 // Place the necessary arguments. | 1620 // Place the necessary arguments. |
1628 Mov(x0, num_arguments); | 1621 Mov(x0, num_arguments); |
1629 Mov(x1, ExternalReference(f, isolate())); | 1622 Mov(x1, ExternalReference(f, isolate())); |
1630 | 1623 |
1631 CEntryStub stub(isolate(), 1, save_doubles); | 1624 CEntryStub stub(isolate(), 1, save_doubles); |
1632 CallStub(&stub); | 1625 CallStub(&stub); |
1633 } | 1626 } |
1634 | 1627 |
1635 | 1628 |
(...skipping 3579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5215 } | 5208 } |
5216 } | 5209 } |
5217 | 5210 |
5218 | 5211 |
5219 #undef __ | 5212 #undef __ |
5220 | 5213 |
5221 | 5214 |
5222 } } // namespace v8::internal | 5215 } } // namespace v8::internal |
5223 | 5216 |
5224 #endif // V8_TARGET_ARCH_ARM64 | 5217 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |