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

Unified Diff: runtime/vm/stub_code_mips.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: Address review 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_mips.cc
diff --git a/runtime/vm/stub_code_mips.cc b/runtime/vm/stub_code_mips.cc
index 6fbc8fae48a89f34397322ee42e92afbf8035b2f..06a4db97c67780b75afe8d4ee2b17a85e2dea400 100644
--- a/runtime/vm/stub_code_mips.cc
+++ b/runtime/vm/stub_code_mips.cc
@@ -815,6 +815,7 @@ void StubCode::GeneratePatchableAllocateArrayStub(Assembler* assembler,
// A0 : entrypoint of the Dart function to call.
// A1 : arguments descriptor array.
// A2 : arguments array.
+// A3 : current thread.
void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
// Save frame pointer coming in.
__ Comment("InvokeDartCodeStub");
@@ -849,6 +850,10 @@ void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
// set up.
__ LoadPoolPointer();
+ // Set up THR, which caches the current thread in Dart code.
+ if (THR != A3) {
+ __ mov(THR, A3);
+ }
__ LoadIsolate(T2);
// Save the current VMTag on the stack.
@@ -2098,6 +2103,8 @@ void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) {
__ lw(V1, Address(SP, 4 * kWordSize)); // StackTrace object.
__ mov(FP, A2); // Frame_pointer.
__ lw(A3, Address(SP, 5 * kWordSize)); // Isolate.
+ // TODO(koda): Pass thread instead of isolate.
+ __ lw(THR, Address(A3, Isolate::mutator_thread_offset()));
// Set tag.
__ LoadImmediate(A2, VMTag::kDartTagId);
__ sw(A2, Address(A3, Isolate::vm_tag_offset()));

Powered by Google App Engine
This is Rietveld 408576698