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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 __ movq(Address(RSP, thread_offset), THR); // Set thread in NativeArgs. | 178 __ movq(Address(RSP, thread_offset), THR); // Set thread in NativeArgs. |
179 __ movq(Address(RSP, argc_tag_offset), R10); // Set argc in NativeArguments. | 179 __ movq(Address(RSP, argc_tag_offset), R10); // Set argc in NativeArguments. |
180 __ movq(Address(RSP, argv_offset), RAX); // Set argv in NativeArguments. | 180 __ movq(Address(RSP, argv_offset), RAX); // Set argv in NativeArguments. |
181 __ leaq(RAX, Address(RBP, 2 * kWordSize)); // Compute return value addr. | 181 __ leaq(RAX, Address(RBP, 2 * kWordSize)); // Compute return value addr. |
182 __ movq(Address(RSP, retval_offset), RAX); // Set retval in NativeArguments. | 182 __ movq(Address(RSP, retval_offset), RAX); // Set retval in NativeArguments. |
183 | 183 |
184 // Pass the pointer to the NativeArguments. | 184 // Pass the pointer to the NativeArguments. |
185 __ movq(CallingConventions::kArg1Reg, RSP); | 185 __ movq(CallingConventions::kArg1Reg, RSP); |
186 // Pass pointer to function entrypoint. | 186 // Pass pointer to function entrypoint. |
187 __ movq(CallingConventions::kArg2Reg, RBX); | 187 __ movq(CallingConventions::kArg2Reg, RBX); |
188 __ LoadExternalLabel( | 188 |
189 RAX, &NativeEntry::NativeCallWrapperLabel(), kNotPatchable); | 189 __ movq(RAX, Address(THR, Thread::native_call_wrapper_entry_point_offset())); |
190 __ CallCFunction(RAX); | 190 __ CallCFunction(RAX); |
191 | 191 |
192 // Mark that the isolate is executing Dart code. | 192 // Mark that the isolate is executing Dart code. |
193 __ movq(Address(R12, Isolate::vm_tag_offset()), | 193 __ movq(Address(R12, Isolate::vm_tag_offset()), |
194 Immediate(VMTag::kDartTagId)); | 194 Immediate(VMTag::kDartTagId)); |
195 | 195 |
196 // Reset exit frame information in Isolate structure. | 196 // Reset exit frame information in Isolate structure. |
197 __ movq(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0)); | 197 __ movq(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0)); |
198 | 198 |
199 __ LeaveStubFrame(); | 199 __ LeaveStubFrame(); |
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2157 // Result: | 2157 // Result: |
2158 // RCX: entry point. | 2158 // RCX: entry point. |
2159 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2159 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
2160 EmitMegamorphicLookup(assembler, RDI, RBX, RCX); | 2160 EmitMegamorphicLookup(assembler, RDI, RBX, RCX); |
2161 __ ret(); | 2161 __ ret(); |
2162 } | 2162 } |
2163 | 2163 |
2164 } // namespace dart | 2164 } // namespace dart |
2165 | 2165 |
2166 #endif // defined TARGET_ARCH_X64 | 2166 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |