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

Unified Diff: runtime/vm/stub_code_arm64.cc

Issue 1156593002: Cache current thread in a reserved register and use it in LoadIsolate (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Added more comments. Created 5 years, 7 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/stub_code_arm64.cc
diff --git a/runtime/vm/stub_code_arm64.cc b/runtime/vm/stub_code_arm64.cc
index f4c0842f094e43739e0ab3a23a3356b4fa27ca03..13f37702f77bc82dd309fc0b9cc87d9c32150c87 100644
--- a/runtime/vm/stub_code_arm64.cc
+++ b/runtime/vm/stub_code_arm64.cc
@@ -770,7 +770,7 @@ void StubCode::GeneratePatchableAllocateArrayStub(Assembler* assembler,
// R0 : entrypoint of the Dart function to call.
// R1 : arguments descriptor array.
// R2 : arguments array.
-// R3 : new context containing the current isolate pointer.
+// R3 : current thread.
void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
__ Comment("InvokeDartCodeStub");
@@ -799,6 +799,10 @@ void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
// set up.
__ LoadPoolPointer(PP);
+ // Set up THR, which caches the current thread in Dart code.
+ if (THR != R3) {
+ __ mov(THR, R3);
+ }
// Load Isolate pointer into temporary register R5.
__ LoadIsolate(R5, PP);
@@ -1983,6 +1987,8 @@ void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) {
__ mov(FP, R2); // Frame_pointer.
__ mov(R0, R3); // Exception object.
__ mov(R1, R4); // StackTrace object.
+ // TODO(koda): Pass thread instead of isolate.
+ __ LoadFromOffset(THR, R5, Isolate::mutator_thread_offset(), kNoPP);
// Set the tag.
__ LoadImmediate(R2, VMTag::kDartTagId, kNoPP);
__ StoreToOffset(R2, R5, Isolate::vm_tag_offset(), kNoPP);

Powered by Google App Engine
This is Rietveld 408576698