Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 <setjmp.h> // NOLINT | 5 #include <setjmp.h> // NOLINT |
| 6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 | 7 |
| 8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
| 9 #if defined(TARGET_ARCH_DBC) | 9 #if defined(TARGET_ARCH_DBC) |
| 10 | 10 |
| (...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2187 BYTECODE(IfNeStrict, A_D); | 2187 BYTECODE(IfNeStrict, A_D); |
| 2188 RawObject* lhs = FP[rA]; | 2188 RawObject* lhs = FP[rA]; |
| 2189 RawObject* rhs = FP[rD]; | 2189 RawObject* rhs = FP[rD]; |
| 2190 if (lhs == rhs) { | 2190 if (lhs == rhs) { |
| 2191 pc++; | 2191 pc++; |
| 2192 } | 2192 } |
| 2193 DISPATCH(); | 2193 DISPATCH(); |
| 2194 } | 2194 } |
| 2195 | 2195 |
| 2196 { | 2196 { |
| 2197 BYTECODE(IfLe, A_D); | |
| 2198 const intptr_t lhs = reinterpret_cast<intptr_t>(FP[rA]); | |
| 2199 const intptr_t rhs = reinterpret_cast<intptr_t>(FP[rD]); | |
| 2200 if (lhs > rhs) { | |
| 2201 pc++; | |
| 2202 } | |
| 2203 DISPATCH(); | |
| 2204 } | |
| 2205 | |
| 2206 { | |
| 2207 BYTECODE(IfLt, A_D); | |
| 2208 const intptr_t lhs = reinterpret_cast<intptr_t>(FP[rA]); | |
| 2209 const intptr_t rhs = reinterpret_cast<intptr_t>(FP[rD]); | |
| 2210 if (lhs >= rhs) { | |
| 2211 pc++; | |
| 2212 } | |
| 2213 DISPATCH(); | |
| 2214 } | |
| 2215 | |
| 2216 { | |
| 2217 BYTECODE(IfGe, A_D); | |
| 2218 const intptr_t lhs = reinterpret_cast<intptr_t>(FP[rA]); | |
| 2219 const intptr_t rhs = reinterpret_cast<intptr_t>(FP[rD]); | |
| 2220 if (lhs < rhs) { | |
| 2221 pc++; | |
| 2222 } | |
| 2223 DISPATCH(); | |
| 2224 } | |
| 2225 | |
| 2226 { | |
| 2227 BYTECODE(IfGt, A_D); | |
| 2228 const intptr_t lhs = reinterpret_cast<intptr_t>(FP[rA]); | |
| 2229 const intptr_t rhs = reinterpret_cast<intptr_t>(FP[rD]); | |
| 2230 if (lhs <= rhs) { | |
| 2231 pc++; | |
| 2232 } | |
| 2233 DISPATCH(); | |
| 2234 } | |
| 2235 | |
| 2236 { | |
| 2197 BYTECODE(IfEqStrictNum, A_D); | 2237 BYTECODE(IfEqStrictNum, A_D); |
| 2198 RawObject* lhs = FP[rA]; | 2238 RawObject* lhs = FP[rA]; |
| 2199 RawObject* rhs = FP[rD]; | 2239 RawObject* rhs = FP[rD]; |
| 2200 if (!SimulatorHelpers::IsStrictEqualWithNumberCheck(lhs, rhs)) { | 2240 if (!SimulatorHelpers::IsStrictEqualWithNumberCheck(lhs, rhs)) { |
| 2201 pc++; | 2241 pc++; |
| 2202 } | 2242 } |
| 2203 DISPATCH(); | 2243 DISPATCH(); |
| 2204 } | 2244 } |
| 2205 | 2245 |
| 2206 { | 2246 { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2270 RawSmi* index = static_cast<RawSmi*>(FP[rB]); | 2310 RawSmi* index = static_cast<RawSmi*>(FP[rB]); |
| 2271 RawObject* value = FP[rC]; | 2311 RawObject* value = FP[rC]; |
| 2272 ASSERT(array->GetClassId() == kArrayCid); | 2312 ASSERT(array->GetClassId() == kArrayCid); |
| 2273 ASSERT(!index->IsHeapObject()); | 2313 ASSERT(!index->IsHeapObject()); |
| 2274 ASSERT(SimulatorHelpers::CheckIndex(index, array->ptr()->length_)); | 2314 ASSERT(SimulatorHelpers::CheckIndex(index, array->ptr()->length_)); |
| 2275 array->StorePointer(array->ptr()->data() + Smi::Value(index), value); | 2315 array->StorePointer(array->ptr()->data() + Smi::Value(index), value); |
| 2276 DISPATCH(); | 2316 DISPATCH(); |
| 2277 } | 2317 } |
| 2278 | 2318 |
| 2279 { | 2319 { |
| 2320 BYTECODE(LoadIndexed, A_B_C); | |
| 2321 RawArray* array = static_cast<RawArray*>(FP[rB]); | |
|
Vyacheslav Egorov (Google)
2016/06/30 15:55:26
Consider using RAW_CAST instead of assertions belo
zra
2016/06/30 17:32:31
Done here, and some others that I saw.
| |
| 2322 RawSmi* index = static_cast<RawSmi*>(FP[rC]); | |
| 2323 ASSERT(array->GetClassId() == kArrayCid); | |
| 2324 ASSERT(!index->IsHeapObject()); | |
| 2325 ASSERT(SimulatorHelpers::CheckIndex(index, array->ptr()->length_)); | |
| 2326 FP[rA] = *(array->ptr()->data() + Smi::Value(index)); | |
|
Vyacheslav Egorov (Google)
2016/06/30 15:55:26
I suggest array->ptr()->data[Smi::Value(index)] he
zra
2016/06/30 17:32:31
Done.
| |
| 2327 DISPATCH(); | |
| 2328 } | |
| 2329 | |
| 2330 { | |
| 2280 BYTECODE(Deopt, A_D); | 2331 BYTECODE(Deopt, A_D); |
| 2281 const bool is_lazy = rD == 0; | 2332 const bool is_lazy = rD == 0; |
| 2282 | 2333 |
| 2283 // Preserve result of the previous call. | 2334 // Preserve result of the previous call. |
| 2284 // TODO(vegorov) we could have actually included result into the | 2335 // TODO(vegorov) we could have actually included result into the |
| 2285 // deoptimization environment because it is passed through the stack. | 2336 // deoptimization environment because it is passed through the stack. |
| 2286 // If we do then we could remove special result handling from this code. | 2337 // If we do then we could remove special result handling from this code. |
| 2287 RawObject* result = SP[0]; | 2338 RawObject* result = SP[0]; |
| 2288 | 2339 |
| 2289 // When not preserving the result, we still need to preserve SP[0] as it | 2340 // When not preserving the result, we still need to preserve SP[0] as it |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2454 special_[kExceptionSpecialIndex] = raw_exception; | 2505 special_[kExceptionSpecialIndex] = raw_exception; |
| 2455 special_[kStacktraceSpecialIndex] = raw_stacktrace; | 2506 special_[kStacktraceSpecialIndex] = raw_stacktrace; |
| 2456 buf->Longjmp(); | 2507 buf->Longjmp(); |
| 2457 UNREACHABLE(); | 2508 UNREACHABLE(); |
| 2458 } | 2509 } |
| 2459 | 2510 |
| 2460 } // namespace dart | 2511 } // namespace dart |
| 2461 | 2512 |
| 2462 | 2513 |
| 2463 #endif // defined TARGET_ARCH_DBC | 2514 #endif // defined TARGET_ARCH_DBC |
| OLD | NEW |