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

Side by Side Diff: runtime/vm/stub_code_ia32.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
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_IA32) 6 #if defined(TARGET_ARCH_IA32)
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 __ movl(EAX, Address(CTX, Isolate::vm_tag_offset())); 64 __ movl(EAX, Address(CTX, Isolate::vm_tag_offset()));
65 __ cmpl(EAX, Immediate(VMTag::kScriptTagId)); 65 __ cmpl(EAX, Immediate(VMTag::kScriptTagId));
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 __ movl(Address(CTX, Isolate::vm_tag_offset()), Immediate(VMTag::kVMTagId)); 73 __ movl(Address(CTX, Isolate::vm_tag_offset()), ECX);
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 __ AddImmediate(ESP, Immediate(-sizeof(NativeArguments))); 76 __ AddImmediate(ESP, Immediate(-sizeof(NativeArguments)));
77 if (OS::ActivationFrameAlignment() > 1) { 77 if (OS::ActivationFrameAlignment() > 1) {
78 __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1))); 78 __ andl(ESP, 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 __ movl(Address(ESP, isolate_offset), CTX); // Set isolate in NativeArgs. 82 __ movl(Address(ESP, 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 // Check that we are always entering from Dart code. 171 // Check that we are always entering from Dart code.
172 __ movl(EDI, Address(CTX, Isolate::vm_tag_offset())); 172 __ movl(EDI, Address(CTX, Isolate::vm_tag_offset()));
173 __ cmpl(EDI, Immediate(VMTag::kScriptTagId)); 173 __ cmpl(EDI, Immediate(VMTag::kScriptTagId));
174 __ j(EQUAL, &ok, Assembler::kNearJump); 174 __ j(EQUAL, &ok, Assembler::kNearJump);
175 __ Stop("Not coming from Dart code."); 175 __ Stop("Not coming from Dart code.");
176 __ Bind(&ok); 176 __ Bind(&ok);
177 } 177 }
178 #endif 178 #endif
179 179
180 // Mark that the isolate is executing Native code. 180 // Mark that the isolate is executing Native code.
181 __ movl(Address(CTX, Isolate::vm_tag_offset()), 181 __ movl(Address(CTX, Isolate::vm_tag_offset()), ECX);
182 Immediate(VMTag::kRuntimeNativeTagId));
183 182
184 // Reserve space for the native arguments structure, the outgoing parameters 183 // Reserve space for the native arguments structure, the outgoing parameters
185 // (pointer to the native arguments structure, the C function entry point) 184 // (pointer to the native arguments structure, the C function entry point)
186 // and align frame before entering the C++ world. 185 // and align frame before entering the C++ world.
187 __ AddImmediate(ESP, Immediate(-sizeof(NativeArguments) - (2 * kWordSize))); 186 __ AddImmediate(ESP, Immediate(-sizeof(NativeArguments) - (2 * kWordSize)));
188 if (OS::ActivationFrameAlignment() > 1) { 187 if (OS::ActivationFrameAlignment() > 1) {
189 __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1))); 188 __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1)));
190 } 189 }
191 190
192 // Pass NativeArguments structure by value and call native function. 191 // Pass NativeArguments structure by value and call native function.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 // Check that we are always entering from Dart code. 270 // Check that we are always entering from Dart code.
272 __ movl(EDI, Address(CTX, Isolate::vm_tag_offset())); 271 __ movl(EDI, Address(CTX, Isolate::vm_tag_offset()));
273 __ cmpl(EDI, Immediate(VMTag::kScriptTagId)); 272 __ cmpl(EDI, Immediate(VMTag::kScriptTagId));
274 __ j(EQUAL, &ok, Assembler::kNearJump); 273 __ j(EQUAL, &ok, Assembler::kNearJump);
275 __ Stop("Not coming from Dart code."); 274 __ Stop("Not coming from Dart code.");
276 __ Bind(&ok); 275 __ Bind(&ok);
277 } 276 }
278 #endif 277 #endif
279 278
280 // Mark that the isolate is executing Native code. 279 // Mark that the isolate is executing Native code.
281 __ movl(Address(CTX, Isolate::vm_tag_offset()), 280 __ movl(Address(CTX, Isolate::vm_tag_offset()), ECX);
282 Immediate(VMTag::kRuntimeNativeTagId));
283 281
284 // Reserve space for the native arguments structure, the outgoing parameter 282 // Reserve space for the native arguments structure, the outgoing parameter
285 // (pointer to the native arguments structure) and align frame before 283 // (pointer to the native arguments structure) and align frame before
286 // entering the C++ world. 284 // entering the C++ world.
287 __ AddImmediate(ESP, Immediate(-sizeof(NativeArguments) - kWordSize)); 285 __ AddImmediate(ESP, Immediate(-sizeof(NativeArguments) - kWordSize));
288 if (OS::ActivationFrameAlignment() > 1) { 286 if (OS::ActivationFrameAlignment() > 1) {
289 __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1))); 287 __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1)));
290 } 288 }
291 289
292 // Pass NativeArguments structure by value and call native function. 290 // Pass NativeArguments structure by value and call native function.
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1940 const Register temp = ECX; 1938 const Register temp = ECX;
1941 __ movl(left, Address(ESP, 2 * kWordSize)); 1939 __ movl(left, Address(ESP, 2 * kWordSize));
1942 __ movl(right, Address(ESP, 1 * kWordSize)); 1940 __ movl(right, Address(ESP, 1 * kWordSize));
1943 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 1941 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
1944 __ ret(); 1942 __ ret();
1945 } 1943 }
1946 1944
1947 } // namespace dart 1945 } // namespace dart
1948 1946
1949 #endif // defined TARGET_ARCH_IA32 1947 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698