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

Unified Diff: runtime/vm/intrinsifier_mips.cc

Issue 237063004: Intrinsify UserTag operations on all architectures (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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/intrinsifier_mips.cc
diff --git a/runtime/vm/intrinsifier_mips.cc b/runtime/vm/intrinsifier_mips.cc
index 14b3105fa82c74e8c6332fd6ee4c90c770af9133..5f369517823b5b7023fa66365b1212aa33c37cde 100644
--- a/runtime/vm/intrinsifier_mips.cc
+++ b/runtime/vm/intrinsifier_mips.cc
@@ -1778,6 +1778,51 @@ void Intrinsifier::TwoByteString_equality(Assembler* assembler) {
StringEquality(assembler, kTwoByteStringCid);
}
+// On stack: user tag (+0).
+void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) {
+ // V1: Isolate.
zra 2014/04/14 15:31:29 (optional) Maybe use T0 or T1 instead of V1 for co
Cutch 2014/04/15 14:36:43 Done here and elsewhere.
+ Isolate* isolate = Isolate::Current();
+ __ LoadImmediate(V1, reinterpret_cast<uword>(isolate));
+ // V0: UserTag.
+ __ lw(V0, Address(SP, + 0 * kWordSize));
+ // Set Isolate::current_tag_.
+ __ sw(V0, Address(V1, Isolate::current_tag_offset()));
+ // V0: UserTag's tag.
+ __ lw(V0, FieldAddress(V0, UserTag::tag_offset()));
+ // Set Isolate::user_tag_.
+ __ sw(V0, Address(V1, Isolate::user_tag_offset()));
+ // Set return value.
+ __ Ret();
+ __ delay_slot()->LoadImmediate(V0, reinterpret_cast<int32_t>(Object::null()));
+}
+
+
+void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) {
+ // V1: Isolate.
+ Isolate* isolate = Isolate::Current();
+ __ LoadImmediate(V0, reinterpret_cast<uword>(isolate));
+ // Set return value.
+ __ Ret();
+ __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset()));
+}
+
+
+void Intrinsifier::Profiler_clearCurrentTag(Assembler* assembler) {
+ // V1: Isolate.
+ Isolate* isolate = Isolate::Current();
+ __ LoadImmediate(V1, reinterpret_cast<uword>(isolate));
+ // Set return value to Isolate::current_tag_.
+ __ lw(V0, Address(V1, Isolate::current_tag_offset()));
+ // Clear Isolate::current_tag_.
+ const int32_t raw_null = reinterpret_cast<int32_t>(UserTag::null());
+ __ LoadImmediate(T0, raw_null);
+ __ sw(T0, Address(V1, Isolate::current_tag_offset()));
+ // Clear Isolate::user_tag_.
+ __ mov(T0, ZR);
zra 2014/04/14 15:31:29 Remove.
Cutch 2014/04/15 14:36:43 Done.
+ __ sw(T0, Address(V1, Isolate::user_tag_offset()));
zra 2014/04/14 15:31:29 __ sw(ZR, ...);
+ __ Ret();
zra 2014/04/14 15:31:29 You can also use the delay slot here.
Cutch 2014/04/15 14:36:43 Done.
+}
+
} // namespace dart
#endif // defined TARGET_ARCH_MIPS

Powered by Google App Engine
This is Rietveld 408576698