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

Side by Side Diff: runtime/vm/intrinsifier_mips.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/intrinsifier.h" 8 #include "vm/intrinsifier.h"
9 9
10 #include "vm/assembler.h" 10 #include "vm/assembler.h"
(...skipping 2119 matching lines...) Expand 10 before | Expand all | Expand 10 after
2130 // Tail-call the function. 2130 // Tail-call the function.
2131 __ lw(T3, FieldAddress(T0, Function::instructions_offset())); 2131 __ lw(T3, FieldAddress(T0, Function::instructions_offset()));
2132 __ AddImmediate(T3, Instructions::HeaderSize() - kHeapObjectTag); 2132 __ AddImmediate(T3, Instructions::HeaderSize() - kHeapObjectTag);
2133 __ jr(T3); 2133 __ jr(T3);
2134 } 2134 }
2135 2135
2136 2136
2137 // On stack: user tag (+0). 2137 // On stack: user tag (+0).
2138 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { 2138 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) {
2139 // T1: Isolate. 2139 // T1: Isolate.
2140 Isolate* isolate = Isolate::Current(); 2140 __ LoadIsolate(T1);
2141 __ LoadImmediate(T1, reinterpret_cast<uword>(isolate));
2142 // V0: Current user tag. 2141 // V0: Current user tag.
2143 __ lw(V0, Address(T1, Isolate::current_tag_offset())); 2142 __ lw(V0, Address(T1, Isolate::current_tag_offset()));
2144 // T2: UserTag. 2143 // T2: UserTag.
2145 __ lw(T2, Address(SP, + 0 * kWordSize)); 2144 __ lw(T2, Address(SP, + 0 * kWordSize));
2146 // Set Isolate::current_tag_. 2145 // Set Isolate::current_tag_.
2147 __ sw(T2, Address(T1, Isolate::current_tag_offset())); 2146 __ sw(T2, Address(T1, Isolate::current_tag_offset()));
2148 // T2: UserTag's tag. 2147 // T2: UserTag's tag.
2149 __ lw(T2, FieldAddress(T2, UserTag::tag_offset())); 2148 __ lw(T2, FieldAddress(T2, UserTag::tag_offset()));
2150 // Set Isolate::user_tag_. 2149 // Set Isolate::user_tag_.
2151 __ sw(T2, Address(T1, Isolate::user_tag_offset())); 2150 __ sw(T2, Address(T1, Isolate::user_tag_offset()));
2152 __ Ret(); 2151 __ Ret();
2153 __ delay_slot()->sw(T2, Address(T1, Isolate::user_tag_offset())); 2152 __ delay_slot()->sw(T2, Address(T1, Isolate::user_tag_offset()));
2154 } 2153 }
2155 2154
2156 2155
2157 void Intrinsifier::UserTag_defaultTag(Assembler* assembler) { 2156 void Intrinsifier::UserTag_defaultTag(Assembler* assembler) {
2158 Isolate* isolate = Isolate::Current(); 2157 __ LoadIsolate(V0);
2159 // V0: Address of default tag.
2160 __ LoadImmediate(V0,
2161 reinterpret_cast<uword>(isolate) + Isolate::default_tag_offset());
2162 __ Ret(); 2158 __ Ret();
2163 __ delay_slot()->lw(V0, Address(V0, 0)); 2159 __ delay_slot()->lw(V0, Address(V0, Isolate::default_tag_offset()));
2164 } 2160 }
2165 2161
2166 2162
2167 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { 2163 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) {
2168 // V0: Isolate. 2164 __ LoadIsolate(V0);
2169 Isolate* isolate = Isolate::Current();
2170 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate));
2171 // Set return value.
2172 __ Ret(); 2165 __ Ret();
2173 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); 2166 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset()));
2174 } 2167 }
2175 2168
2176 } // namespace dart 2169 } // namespace dart
2177 2170
2178 #endif // defined TARGET_ARCH_MIPS 2171 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698