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

Side by Side Diff: runtime/vm/stub_code_mips.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_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('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_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 { Label ok; 66 { Label ok;
67 // Check that we are always entering from Dart code. 67 // Check that we are always entering from Dart code.
68 __ lw(T0, Address(A0, Isolate::vm_tag_offset())); 68 __ lw(T0, Address(A0, Isolate::vm_tag_offset()));
69 __ BranchEqual(T0, VMTag::kScriptTagId, &ok); 69 __ BranchEqual(T0, VMTag::kScriptTagId, &ok);
70 __ Stop("Not coming from Dart code."); 70 __ Stop("Not coming from Dart code.");
71 __ Bind(&ok); 71 __ Bind(&ok);
72 } 72 }
73 #endif 73 #endif
74 74
75 // Mark that the isolate is executing VM code. 75 // Mark that the isolate is executing VM code.
76 __ LoadImmediate(T0, VMTag::kVMTagId); 76 __ sw(S5, Address(A0, Isolate::vm_tag_offset()));
77 __ sw(T0, Address(A0, Isolate::vm_tag_offset()));
78 77
79 // Reserve space for arguments and align frame before entering C++ world. 78 // Reserve space for arguments and align frame before entering C++ world.
80 // NativeArguments are passed in registers. 79 // NativeArguments are passed in registers.
81 ASSERT(sizeof(NativeArguments) == 4 * kWordSize); 80 ASSERT(sizeof(NativeArguments) == 4 * kWordSize);
82 __ ReserveAlignedFrameSpace(4 * kWordSize); // Reserve space for arguments. 81 __ ReserveAlignedFrameSpace(4 * kWordSize); // Reserve space for arguments.
83 82
84 // Pass NativeArguments structure by value and call runtime. 83 // Pass NativeArguments structure by value and call runtime.
85 // Registers A0, A1, A2, and A3 are used. 84 // Registers A0, A1, A2, and A3 are used.
86 85
87 ASSERT(isolate_offset == 0 * kWordSize); 86 ASSERT(isolate_offset == 0 * kWordSize);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 { Label ok; 192 { Label ok;
194 // Check that we are always entering from Dart code. 193 // Check that we are always entering from Dart code.
195 __ lw(T0, Address(A0, Isolate::vm_tag_offset())); 194 __ lw(T0, Address(A0, Isolate::vm_tag_offset()));
196 __ BranchEqual(T0, VMTag::kScriptTagId, &ok); 195 __ BranchEqual(T0, VMTag::kScriptTagId, &ok);
197 __ Stop("Not coming from Dart code."); 196 __ Stop("Not coming from Dart code.");
198 __ Bind(&ok); 197 __ Bind(&ok);
199 } 198 }
200 #endif 199 #endif
201 200
202 // Mark that the isolate is executing Native code. 201 // Mark that the isolate is executing Native code.
203 __ LoadImmediate(T0, VMTag::kRuntimeNativeTagId); 202 __ sw(T5, Address(A0, Isolate::vm_tag_offset()));
204 __ sw(T0, Address(A0, Isolate::vm_tag_offset()));
205 203
206 // Initialize NativeArguments structure and call native function. 204 // Initialize NativeArguments structure and call native function.
207 // Registers A0, A1, A2, and A3 are used. 205 // Registers A0, A1, A2, and A3 are used.
208 206
209 ASSERT(isolate_offset == 0 * kWordSize); 207 ASSERT(isolate_offset == 0 * kWordSize);
210 // Set isolate in NativeArgs: A0 already contains CTX. 208 // Set isolate in NativeArgs: A0 already contains CTX.
211 209
212 // There are no native calls to closures, so we do not need to set the tag 210 // There are no native calls to closures, so we do not need to set the tag
213 // bits kClosureFunctionBit and kInstanceFunctionBit in argc_tag_. 211 // bits kClosureFunctionBit and kInstanceFunctionBit in argc_tag_.
214 ASSERT(argc_tag_offset == 1 * kWordSize); 212 ASSERT(argc_tag_offset == 1 * kWordSize);
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 { Label ok; 325 { Label ok;
328 // Check that we are always entering from Dart code. 326 // Check that we are always entering from Dart code.
329 __ lw(T0, Address(A0, Isolate::vm_tag_offset())); 327 __ lw(T0, Address(A0, Isolate::vm_tag_offset()));
330 __ BranchEqual(T0, VMTag::kScriptTagId, &ok); 328 __ BranchEqual(T0, VMTag::kScriptTagId, &ok);
331 __ Stop("Not coming from Dart code."); 329 __ Stop("Not coming from Dart code.");
332 __ Bind(&ok); 330 __ Bind(&ok);
333 } 331 }
334 #endif 332 #endif
335 333
336 // Mark that the isolate is executing Native code. 334 // Mark that the isolate is executing Native code.
337 __ LoadImmediate(T0, VMTag::kRuntimeNativeTagId); 335 __ sw(T5, Address(A0, Isolate::vm_tag_offset()));
338 __ sw(T0, Address(A0, Isolate::vm_tag_offset()));
339 336
340 // Initialize NativeArguments structure and call native function. 337 // Initialize NativeArguments structure and call native function.
341 // Registers A0, A1, A2, and A3 are used. 338 // Registers A0, A1, A2, and A3 are used.
342 339
343 ASSERT(isolate_offset == 0 * kWordSize); 340 ASSERT(isolate_offset == 0 * kWordSize);
344 // Set isolate in NativeArgs: A0 already contains CTX. 341 // Set isolate in NativeArgs: A0 already contains CTX.
345 342
346 // There are no native calls to closures, so we do not need to set the tag 343 // There are no native calls to closures, so we do not need to set the tag
347 // bits kClosureFunctionBit and kInstanceFunctionBit in argc_tag_. 344 // bits kClosureFunctionBit and kInstanceFunctionBit in argc_tag_.
348 ASSERT(argc_tag_offset == 1 * kWordSize); 345 ASSERT(argc_tag_offset == 1 * kWordSize);
(...skipping 1751 matching lines...) Expand 10 before | Expand all | Expand 10 after
2100 const Register right = T0; 2097 const Register right = T0;
2101 __ lw(left, Address(SP, 1 * kWordSize)); 2098 __ lw(left, Address(SP, 1 * kWordSize));
2102 __ lw(right, Address(SP, 0 * kWordSize)); 2099 __ lw(right, Address(SP, 0 * kWordSize));
2103 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); 2100 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2);
2104 __ Ret(); 2101 __ Ret();
2105 } 2102 }
2106 2103
2107 } // namespace dart 2104 } // namespace dart
2108 2105
2109 #endif // defined TARGET_ARCH_MIPS 2106 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698