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

Unified Diff: runtime/vm/intrinsifier_x64.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
« no previous file with comments | « runtime/vm/intrinsifier_mips.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier_x64.cc
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc
index b329fb1ba8e35398a9766af5668781a723cdab37..0f0d0655065d48df66a09e00cd8bc778db89c3ef 100644
--- a/runtime/vm/intrinsifier_x64.cc
+++ b/runtime/vm/intrinsifier_x64.cc
@@ -1647,6 +1647,56 @@ void Intrinsifier::TwoByteString_equality(Assembler* assembler) {
StringEquality(assembler, kTwoByteStringCid);
}
+
+// On stack: user tag (+1), return-address (+0).
+void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) {
+ // RBX: Isolate.
+ Isolate* isolate = Isolate::Current();
+ const Immediate& isolate_address =
+ Immediate(reinterpret_cast<int64_t>(isolate));
+ __ movq(RBX, isolate_address);
+ // RAX: UserTag.
+ __ movq(RAX, Address(RSP, + 1 * kWordSize));
+ // Set Isolate::current_tag_.
+ __ movq(Address(RBX, Isolate::current_tag_offset()), RAX);
+ // RAX: UserTag's tag.
+ __ movq(RAX, FieldAddress(RAX, UserTag::tag_offset()));
+ // Set Isolate::user_tag_.
+ __ movq(Address(RBX, Isolate::user_tag_offset()), RAX);
+ // Set return value.
+ __ LoadObject(RAX, Object::null_object(), PP);
+ __ ret();
+}
+
+
+void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) {
+ // RBX: Isolate.
+ Isolate* isolate = Isolate::Current();
+ const Immediate& isolate_address =
+ Immediate(reinterpret_cast<int64_t>(isolate));
+ __ movq(RBX, isolate_address);
+ // Set return value to Isolate::current_tag_.
+ __ movq(RAX, Address(RBX, Isolate::current_tag_offset()));
+ __ ret();
+}
+
+
+void Intrinsifier::Profiler_clearCurrentTag(Assembler* assembler) {
+ // RBX: Isolate.
+ Isolate* isolate = Isolate::Current();
+ const Immediate& isolate_address =
+ Immediate(reinterpret_cast<int64_t>(isolate));
+ __ movq(RBX, isolate_address);
+ // Set return value to Isolate::current_tag_.
+ __ movq(RAX, Address(RBX, Isolate::current_tag_offset()));
+ // Clear Isolate::current_tag_.
+ __ LoadObject(RCX, Object::null_object(), PP);
+ __ movq(Address(RBX, Isolate::current_tag_offset()), RCX);
+ // Clear Isolate::user_tag_.
+ __ movq(Address(RBX, Isolate::user_tag_offset()), Immediate(0));
+ __ ret();
+}
+
#undef __
} // namespace dart
« no previous file with comments | « runtime/vm/intrinsifier_mips.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698