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

Unified Diff: runtime/vm/intrinsifier_ia32.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_ia32.cc
diff --git a/runtime/vm/intrinsifier_ia32.cc b/runtime/vm/intrinsifier_ia32.cc
index 6b4b5d281f0ad52fabeb1222f156ce9a27431e5c..db5cd358d687fdeb8137211d7d076fea507bf483 100644
--- a/runtime/vm/intrinsifier_ia32.cc
+++ b/runtime/vm/intrinsifier_ia32.cc
@@ -1739,6 +1739,53 @@ void Intrinsifier::TwoByteString_equality(Assembler* assembler) {
StringEquality(assembler, kTwoByteStringCid);
}
+
+// On stack: user tag (+1), return-address (+0).
+void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) {
+ // EBX: Isolate.
+ Isolate* isolate = Isolate::Current();
+ __ leal(EBX, Address::Absolute(reinterpret_cast<uword>(isolate)));
srdjan 2014/04/14 15:08:27 Couldn't you get the address of current_tag here d
zra 2014/04/14 15:31:29 At least on ARM and MIPS, I don't think it would s
Cutch 2014/04/15 14:36:43 Done on IA32.
+ // EAX: UserTag.
+ __ movl(EAX, Address(ESP, + 1 * kWordSize));
+ // Set Isolate::current_tag_.
+ __ movl(Address(EBX, Isolate::current_tag_offset()), EAX);
+ // EAX: UserTag's tag.
+ __ movl(EAX, FieldAddress(EAX, UserTag::tag_offset()));
+ // Set Isolate::user_tag_.
+ __ movl(Address(EBX, Isolate::user_tag_offset()), EAX);
+ // Set return value.
+ const Immediate& raw_null =
+ Immediate(reinterpret_cast<int32_t>(Object::null()));
+ __ movl(EAX, raw_null);
+ __ ret();
+}
+
+
+void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) {
+ // EBX: Isolate.
+ Isolate* isolate = Isolate::Current();
+ __ leal(EBX, Address::Absolute(reinterpret_cast<uword>(isolate)));
+ // Set return value to Isolate::current_tag_.
+ __ movl(EAX, Address(EBX, Isolate::current_tag_offset()));
+ __ ret();
+}
+
+
+void Intrinsifier::Profiler_clearCurrentTag(Assembler* assembler) {
+ // EBX: Isolate.
+ Isolate* isolate = Isolate::Current();
+ __ leal(EBX, Address::Absolute(reinterpret_cast<uword>(isolate)));
+ // Set return value to Isolate::current_tag_.
+ __ movl(EAX, Address(EBX, Isolate::current_tag_offset()));
+ // Clear Isolate::current_tag_.
+ const Immediate& raw_null =
+ Immediate(reinterpret_cast<int32_t>(UserTag::null()));
+ __ movl(Address(EBX, Isolate::current_tag_offset()), raw_null);
+ // Clear Isolate::user_tag_.
+ __ movl(Address(EBX, Isolate::user_tag_offset()), Immediate(0));
+ __ ret();
+}
+
#undef __
} // namespace dart

Powered by Google App Engine
This is Rietveld 408576698