| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 } | 187 } |
| 188 | 188 |
| 189 // Pass NativeArguments structure by value and call native function. | 189 // Pass NativeArguments structure by value and call native function. |
| 190 __ movq(Address(RSP, isolate_offset), CTX); // Set isolate in NativeArgs. | 190 __ movq(Address(RSP, isolate_offset), CTX); // Set isolate in NativeArgs. |
| 191 __ movq(Address(RSP, argc_tag_offset), R10); // Set argc in NativeArguments. | 191 __ movq(Address(RSP, argc_tag_offset), R10); // Set argc in NativeArguments. |
| 192 __ movq(Address(RSP, argv_offset), RAX); // Set argv in NativeArguments. | 192 __ movq(Address(RSP, argv_offset), RAX); // Set argv in NativeArguments. |
| 193 __ leaq(RAX, Address(RBP, 2 * kWordSize)); // Compute return value addr. | 193 __ leaq(RAX, Address(RBP, 2 * kWordSize)); // Compute return value addr. |
| 194 __ movq(Address(RSP, retval_offset), RAX); // Set retval in NativeArguments. | 194 __ movq(Address(RSP, retval_offset), RAX); // Set retval in NativeArguments. |
| 195 __ movq(RDI, RSP); // Pass the pointer to the NativeArguments. | 195 __ movq(RDI, RSP); // Pass the pointer to the NativeArguments. |
| 196 | 196 |
| 197 // Call native function (setsup scope if not leaf function). | |
| 198 Label leaf_call; | |
| 199 Label done; | |
| 200 __ testq(R10, Immediate(NativeArguments::AutoSetupScopeMask())); | |
| 201 __ j(ZERO, &leaf_call); | |
| 202 __ movq(RSI, RBX); // Pass pointer to function entrypoint. | 197 __ movq(RSI, RBX); // Pass pointer to function entrypoint. |
| 203 __ call(&NativeEntry::NativeCallWrapperLabel()); | 198 __ call(&NativeEntry::NativeCallWrapperLabel()); |
| 204 __ jmp(&done); | |
| 205 __ Bind(&leaf_call); | |
| 206 __ call(RBX); | |
| 207 __ Bind(&done); | |
| 208 | 199 |
| 209 // Mark that the isolate is executing Dart code. | 200 // Mark that the isolate is executing Dart code. |
| 210 __ movq(Address(CTX, Isolate::vm_tag_offset()), | 201 __ movq(Address(CTX, Isolate::vm_tag_offset()), |
| 211 Immediate(VMTag::kScriptTagId)); | 202 Immediate(VMTag::kScriptTagId)); |
| 212 | 203 |
| 213 // Reset exit frame information in Isolate structure. | 204 // Reset exit frame information in Isolate structure. |
| 214 __ movq(Address(CTX, Isolate::top_exit_frame_info_offset()), Immediate(0)); | 205 __ movq(Address(CTX, Isolate::top_exit_frame_info_offset()), Immediate(0)); |
| 215 | 206 |
| 216 // Load Context pointer from Isolate structure into R8. | 207 // Load Context pointer from Isolate structure into R8. |
| 217 __ movq(R8, Address(CTX, Isolate::top_context_offset())); | 208 __ movq(R8, Address(CTX, Isolate::top_context_offset())); |
| (...skipping 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1812 | 1803 |
| 1813 __ movq(left, Address(RSP, 2 * kWordSize)); | 1804 __ movq(left, Address(RSP, 2 * kWordSize)); |
| 1814 __ movq(right, Address(RSP, 1 * kWordSize)); | 1805 __ movq(right, Address(RSP, 1 * kWordSize)); |
| 1815 GenerateIdenticalWithNumberCheckStub(assembler, left, right); | 1806 GenerateIdenticalWithNumberCheckStub(assembler, left, right); |
| 1816 __ ret(); | 1807 __ ret(); |
| 1817 } | 1808 } |
| 1818 | 1809 |
| 1819 } // namespace dart | 1810 } // namespace dart |
| 1820 | 1811 |
| 1821 #endif // defined TARGET_ARCH_X64 | 1812 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |