Chromium Code Reviews| Index: runtime/vm/intrinsifier_x64.cc |
| diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc |
| index b329fb1ba8e35398a9766af5668781a723cdab37..ccfcdcd04113615ec64b57fe266567d991bbf519 100644 |
| --- a/runtime/vm/intrinsifier_x64.cc |
| +++ b/runtime/vm/intrinsifier_x64.cc |
| @@ -1647,6 +1647,59 @@ 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. |
| + const Immediate& raw_null = |
| + Immediate(reinterpret_cast<int64_t>(Object::null())); |
|
zra
2014/04/14 15:31:29
__ LoadObject(RAX, Object::null_object(), PP);
Cutch
2014/04/15 14:36:43
Done.
|
| + __ movq(RAX, raw_null); |
| + __ 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_. |
| + const Immediate& raw_null = |
| + Immediate(reinterpret_cast<int64_t>(UserTag::null())); |
|
zra
2014/04/14 15:31:29
Use LoadObject here, too.
Cutch
2014/04/15 14:36:43
Done.
|
| + __ movq(Address(RBX, Isolate::current_tag_offset()), raw_null); |
| + // Clear Isolate::user_tag_. |
| + __ movq(Address(RBX, Isolate::user_tag_offset()), Immediate(0)); |
| + __ ret(); |
| +} |
| + |
| #undef __ |
| } // namespace dart |