OLD | NEW |
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" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2142 __ lw(left, Address(SP, 1 * kWordSize)); | 2142 __ lw(left, Address(SP, 1 * kWordSize)); |
2143 __ lw(right, Address(SP, 0 * kWordSize)); | 2143 __ lw(right, Address(SP, 0 * kWordSize)); |
2144 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); | 2144 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); |
2145 __ Ret(); | 2145 __ Ret(); |
2146 } | 2146 } |
2147 | 2147 |
2148 | 2148 |
2149 // Called from megamorphic calls. | 2149 // Called from megamorphic calls. |
2150 // T0: receiver | 2150 // T0: receiver |
2151 // S5: MegamorphicCache (preserved) | 2151 // S5: MegamorphicCache (preserved) |
2152 // Result: | 2152 // Passed to target: |
| 2153 // CODE_REG: target Code object |
2153 // S4: arguments descriptor | 2154 // S4: arguments descriptor |
2154 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2155 void StubCode::GenerateMegamorphicCallStub(Assembler* assembler) { |
2155 __ NoMonomorphicCheckedEntry(); | 2156 __ NoMonomorphicCheckedEntry(); |
2156 | 2157 |
2157 __ LoadTaggedClassIdMayBeSmi(T0, T0); | 2158 __ LoadTaggedClassIdMayBeSmi(T0, T0); |
2158 // T0: class ID of the receiver (smi). | 2159 // T0: class ID of the receiver (smi). |
2159 __ lw(S4, FieldAddress(S5, MegamorphicCache::arguments_descriptor_offset())); | 2160 __ lw(S4, FieldAddress(S5, MegamorphicCache::arguments_descriptor_offset())); |
2160 __ lw(T2, FieldAddress(S5, MegamorphicCache::buckets_offset())); | 2161 __ lw(T2, FieldAddress(S5, MegamorphicCache::buckets_offset())); |
2161 __ lw(T1, FieldAddress(S5, MegamorphicCache::mask_offset())); | 2162 __ lw(T1, FieldAddress(S5, MegamorphicCache::mask_offset())); |
2162 // T2: cache buckets array. | 2163 // T2: cache buckets array. |
2163 // T1: mask. | 2164 // T1: mask. |
2164 __ LoadImmediate(TMP, MegamorphicCache::kSpreadFactor); | 2165 __ LoadImmediate(TMP, MegamorphicCache::kSpreadFactor); |
(...skipping 29 matching lines...) Expand all Loading... |
2194 | 2195 |
2195 __ lw(T1, FieldAddress(T0, Function::entry_point_offset())); | 2196 __ lw(T1, FieldAddress(T0, Function::entry_point_offset())); |
2196 __ lw(CODE_REG, FieldAddress(T0, Function::code_offset())); | 2197 __ lw(CODE_REG, FieldAddress(T0, Function::code_offset())); |
2197 __ jr(T1); | 2198 __ jr(T1); |
2198 } | 2199 } |
2199 | 2200 |
2200 | 2201 |
2201 // Called from switchable IC calls. | 2202 // Called from switchable IC calls. |
2202 // T0: receiver | 2203 // T0: receiver |
2203 // S5: ICData (preserved) | 2204 // S5: ICData (preserved) |
2204 // Result: | 2205 // Passed to target: |
2205 // CODE_REG: target Code object | 2206 // CODE_REG: target Code object |
2206 // S4: arguments descriptor | 2207 // S4: arguments descriptor |
2207 void StubCode::GenerateICLookupThroughFunctionStub(Assembler* assembler) { | 2208 void StubCode::GenerateICCallThroughFunctionStub(Assembler* assembler) { |
2208 __ NoMonomorphicCheckedEntry(); | 2209 __ NoMonomorphicCheckedEntry(); |
2209 | 2210 |
2210 Label loop, found, miss; | 2211 Label loop, found, miss; |
2211 __ lw(T6, FieldAddress(S5, ICData::ic_data_offset())); | 2212 __ lw(T6, FieldAddress(S5, ICData::ic_data_offset())); |
2212 __ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset())); | 2213 __ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset())); |
2213 __ AddImmediate(T6, T6, Array::data_offset() - kHeapObjectTag); | 2214 __ AddImmediate(T6, T6, Array::data_offset() - kHeapObjectTag); |
2214 // T6: first IC entry. | 2215 // T6: first IC entry. |
2215 __ LoadTaggedClassIdMayBeSmi(T1, T0); | 2216 __ LoadTaggedClassIdMayBeSmi(T1, T0); |
2216 // T1: receiver cid as Smi | 2217 // T1: receiver cid as Smi |
2217 | 2218 |
(...skipping 15 matching lines...) Expand all Loading... |
2233 __ jr(T1); | 2234 __ jr(T1); |
2234 | 2235 |
2235 __ Bind(&miss); | 2236 __ Bind(&miss); |
2236 __ LoadIsolate(T2); | 2237 __ LoadIsolate(T2); |
2237 __ lw(CODE_REG, Address(T2, Isolate::ic_miss_code_offset())); | 2238 __ lw(CODE_REG, Address(T2, Isolate::ic_miss_code_offset())); |
2238 __ lw(T1, FieldAddress(CODE_REG, Code::entry_point_offset())); | 2239 __ lw(T1, FieldAddress(CODE_REG, Code::entry_point_offset())); |
2239 __ jr(T1); | 2240 __ jr(T1); |
2240 } | 2241 } |
2241 | 2242 |
2242 | 2243 |
2243 void StubCode::GenerateICLookupThroughCodeStub(Assembler* assembler) { | 2244 void StubCode::GenerateICCallThroughCodeStub(Assembler* assembler) { |
2244 __ NoMonomorphicCheckedEntry(); | 2245 __ NoMonomorphicCheckedEntry(); |
2245 | 2246 |
2246 Label loop, found, miss; | 2247 Label loop, found, miss; |
2247 __ lw(T6, FieldAddress(S5, ICData::ic_data_offset())); | 2248 __ lw(T6, FieldAddress(S5, ICData::ic_data_offset())); |
2248 __ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset())); | 2249 __ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset())); |
2249 __ AddImmediate(T6, T6, Array::data_offset() - kHeapObjectTag); | 2250 __ AddImmediate(T6, T6, Array::data_offset() - kHeapObjectTag); |
2250 // T6: first IC entry. | 2251 // T6: first IC entry. |
2251 __ LoadTaggedClassIdMayBeSmi(T1, T0); | 2252 __ LoadTaggedClassIdMayBeSmi(T1, T0); |
2252 // T1: receiver cid as Smi | 2253 // T1: receiver cid as Smi |
2253 | 2254 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2297 } | 2298 } |
2298 | 2299 |
2299 | 2300 |
2300 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { | 2301 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { |
2301 __ break_(0); | 2302 __ break_(0); |
2302 } | 2303 } |
2303 | 2304 |
2304 } // namespace dart | 2305 } // namespace dart |
2305 | 2306 |
2306 #endif // defined TARGET_ARCH_MIPS | 2307 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |