Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: runtime/vm/stub_code_x64.cc

Issue 1358773002: Load the native call wrapper via Thread. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | runtime/vm/thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | runtime/vm/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698