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

Unified Diff: runtime/vm/intrinsifier_x64.cc

Issue 1248113003: VM: Fix more places with isolate embedded into unoptimized code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: minor cleanup in stub_code* Created 5 years, 5 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_x64.cc
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc
index 6ed3726853c744f4ab6f0884d3f5bfb5aae3f7c4..ee104c683a39a692034788732cfa79f0ad157372 100644
--- a/runtime/vm/intrinsifier_x64.cc
+++ b/runtime/vm/intrinsifier_x64.cc
@@ -1977,10 +1977,7 @@ void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) {
// 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);
+ __ LoadIsolate(RBX);
// RAX: Current user tag.
__ movq(RAX, Address(RBX, Isolate::current_tag_offset()));
// R10: UserTag.
@@ -1996,26 +1993,15 @@ void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) {
void Intrinsifier::UserTag_defaultTag(Assembler* assembler) {
- // RBX: Address of default tag.
- Isolate* isolate = Isolate::Current();
- const Immediate& default_tag_addr =
- Immediate(reinterpret_cast<int64_t>(isolate) +
- Isolate::default_tag_offset());
- __ movq(RBX, default_tag_addr);
- // Set return value.
- __ movq(RAX, Address(RBX, 0));
+ __ LoadIsolate(RAX);
+ __ movq(RAX, Address(RAX, Isolate::default_tag_offset()));
__ 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()));
+ __ LoadIsolate(RAX);
+ __ movq(RAX, Address(RAX, Isolate::current_tag_offset()));
__ ret();
}

Powered by Google App Engine
This is Rietveld 408576698