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

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

Issue 227433004: Add runtime and native entry tags (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | runtime/vm/tags.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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // Check that we are always entering from Dart code. 63 // Check that we are always entering from Dart code.
64 __ movq(RAX, Immediate(VMTag::kScriptTagId)); 64 __ movq(RAX, Immediate(VMTag::kScriptTagId));
65 __ cmpq(RAX, Address(CTX, Isolate::vm_tag_offset())); 65 __ cmpq(RAX, Address(CTX, Isolate::vm_tag_offset()));
66 __ j(EQUAL, &ok, Assembler::kNearJump); 66 __ j(EQUAL, &ok, Assembler::kNearJump);
67 __ Stop("Not coming from Dart code."); 67 __ Stop("Not coming from Dart code.");
68 __ Bind(&ok); 68 __ Bind(&ok);
69 } 69 }
70 #endif 70 #endif
71 71
72 // Mark that the isolate is executing VM code. 72 // Mark that the isolate is executing VM code.
73 __ movq(Address(CTX, Isolate::vm_tag_offset()), Immediate(VMTag::kVMTagId)); 73 __ movq(Address(CTX, Isolate::vm_tag_offset()), RBX);
74 74
75 // Reserve space for arguments and align frame before entering C++ world. 75 // Reserve space for arguments and align frame before entering C++ world.
76 __ subq(RSP, Immediate(sizeof(NativeArguments))); 76 __ subq(RSP, Immediate(sizeof(NativeArguments)));
77 if (OS::ActivationFrameAlignment() > 1) { 77 if (OS::ActivationFrameAlignment() > 1) {
78 __ andq(RSP, Immediate(~(OS::ActivationFrameAlignment() - 1))); 78 __ andq(RSP, Immediate(~(OS::ActivationFrameAlignment() - 1)));
79 } 79 }
80 80
81 // Pass NativeArguments structure by value and call runtime. 81 // Pass NativeArguments structure by value and call runtime.
82 __ movq(Address(RSP, isolate_offset), CTX); // Set isolate in NativeArgs. 82 __ movq(Address(RSP, isolate_offset), CTX); // Set isolate in NativeArgs.
83 // There are no runtime calls to closures, so we do not need to set the tag 83 // There are no runtime calls to closures, so we do not need to set the tag
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 // Check that we are always entering from Dart code. 168 // Check that we are always entering from Dart code.
169 __ movq(R8, Immediate(VMTag::kScriptTagId)); 169 __ movq(R8, Immediate(VMTag::kScriptTagId));
170 __ cmpq(R8, Address(CTX, Isolate::vm_tag_offset())); 170 __ cmpq(R8, Address(CTX, Isolate::vm_tag_offset()));
171 __ j(EQUAL, &ok, Assembler::kNearJump); 171 __ j(EQUAL, &ok, Assembler::kNearJump);
172 __ Stop("Not coming from Dart code."); 172 __ Stop("Not coming from Dart code.");
173 __ Bind(&ok); 173 __ Bind(&ok);
174 } 174 }
175 #endif 175 #endif
176 176
177 // Mark that the isolate is executing Native code. 177 // Mark that the isolate is executing Native code.
178 __ movq(Address(CTX, Isolate::vm_tag_offset()), 178 __ movq(Address(CTX, Isolate::vm_tag_offset()), RBX);
179 Immediate(VMTag::kRuntimeNativeTagId));
180 179
181 // Reserve space for the native arguments structure passed on the stack (the 180 // Reserve space for the native arguments structure passed on the stack (the
182 // outgoing pointer parameter to the native arguments structure is passed in 181 // outgoing pointer parameter to the native arguments structure is passed in
183 // RDI) and align frame before entering the C++ world. 182 // RDI) and align frame before entering the C++ world.
184 __ subq(RSP, Immediate(sizeof(NativeArguments))); 183 __ subq(RSP, Immediate(sizeof(NativeArguments)));
185 if (OS::ActivationFrameAlignment() > 1) { 184 if (OS::ActivationFrameAlignment() > 1) {
186 __ andq(RSP, Immediate(~(OS::ActivationFrameAlignment() - 1))); 185 __ andq(RSP, Immediate(~(OS::ActivationFrameAlignment() - 1)));
187 } 186 }
188 187
189 // Pass NativeArguments structure by value and call native function. 188 // Pass NativeArguments structure by value and call native function.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 // Check that we are always entering from Dart code. 264 // Check that we are always entering from Dart code.
266 __ movq(R8, Immediate(VMTag::kScriptTagId)); 265 __ movq(R8, Immediate(VMTag::kScriptTagId));
267 __ cmpq(R8, Address(CTX, Isolate::vm_tag_offset())); 266 __ cmpq(R8, Address(CTX, Isolate::vm_tag_offset()));
268 __ j(EQUAL, &ok, Assembler::kNearJump); 267 __ j(EQUAL, &ok, Assembler::kNearJump);
269 __ Stop("Not coming from Dart code."); 268 __ Stop("Not coming from Dart code.");
270 __ Bind(&ok); 269 __ Bind(&ok);
271 } 270 }
272 #endif 271 #endif
273 272
274 // Mark that the isolate is executing Native code. 273 // Mark that the isolate is executing Native code.
275 __ movq(Address(CTX, Isolate::vm_tag_offset()), 274 __ movq(Address(CTX, Isolate::vm_tag_offset()), RBX);
276 Immediate(VMTag::kRuntimeNativeTagId));
277 275
278 // Reserve space for the native arguments structure passed on the stack (the 276 // Reserve space for the native arguments structure passed on the stack (the
279 // outgoing pointer parameter to the native arguments structure is passed in 277 // outgoing pointer parameter to the native arguments structure is passed in
280 // RDI) and align frame before entering the C++ world. 278 // RDI) and align frame before entering the C++ world.
281 __ subq(RSP, Immediate(sizeof(NativeArguments))); 279 __ subq(RSP, Immediate(sizeof(NativeArguments)));
282 if (OS::ActivationFrameAlignment() > 1) { 280 if (OS::ActivationFrameAlignment() > 1) {
283 __ andq(RSP, Immediate(~(OS::ActivationFrameAlignment() - 1))); 281 __ andq(RSP, Immediate(~(OS::ActivationFrameAlignment() - 1)));
284 } 282 }
285 283
286 // Pass NativeArguments structure by value and call native function. 284 // Pass NativeArguments structure by value and call native function.
(...skipping 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after
1843 1841
1844 __ movq(left, Address(RSP, 2 * kWordSize)); 1842 __ movq(left, Address(RSP, 2 * kWordSize));
1845 __ movq(right, Address(RSP, 1 * kWordSize)); 1843 __ movq(right, Address(RSP, 1 * kWordSize));
1846 GenerateIdenticalWithNumberCheckStub(assembler, left, right); 1844 GenerateIdenticalWithNumberCheckStub(assembler, left, right);
1847 __ ret(); 1845 __ ret();
1848 } 1846 }
1849 1847
1850 } // namespace dart 1848 } // namespace dart
1851 1849
1852 #endif // defined TARGET_ARCH_X64 1850 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | runtime/vm/tags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698