| 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 } | 272 } |
| 273 | 273 |
| 274 static bool ObjectRuntimeType(Thread* thread, | 274 static bool ObjectRuntimeType(Thread* thread, |
| 275 RawObject** FP, | 275 RawObject** FP, |
| 276 RawObject** result) { | 276 RawObject** result) { |
| 277 RawObject** args = FrameArguments(FP, 1); | 277 RawObject** args = FrameArguments(FP, 1); |
| 278 const intptr_t cid = GetClassId(args[0]); | 278 const intptr_t cid = GetClassId(args[0]); |
| 279 if (cid == kClosureCid) { | 279 if (cid == kClosureCid) { |
| 280 return false; | 280 return false; |
| 281 } | 281 } |
| 282 if (cid < kNumPredefinedCids) { |
| 283 if (cid == kDoubleCid) { |
| 284 *result = thread->isolate()->object_store()->double_type(); |
| 285 return true; |
| 286 } else if (RawObject::IsStringClassId(cid)) { |
| 287 *result = thread->isolate()->object_store()->string_type(); |
| 288 return true; |
| 289 } else if (RawObject::IsIntegerClassId(cid)) { |
| 290 *result = thread->isolate()->object_store()->int_type(); |
| 291 return true; |
| 292 } |
| 293 } |
| 282 RawClass* cls = thread->isolate()->class_table()->At(cid); | 294 RawClass* cls = thread->isolate()->class_table()->At(cid); |
| 283 if (cls->ptr()->num_type_arguments_ != 0) { | 295 if (cls->ptr()->num_type_arguments_ != 0) { |
| 284 return false; | 296 return false; |
| 285 } | 297 } |
| 286 RawType* typ = cls->ptr()->canonical_type_; | 298 RawType* typ = cls->ptr()->canonical_type_; |
| 287 if (typ == Object::null()) { | 299 if (typ == Object::null()) { |
| 288 return false; | 300 return false; |
| 289 } | 301 } |
| 290 *result = static_cast<RawObject*>(typ); | 302 *result = static_cast<RawObject*>(typ); |
| 291 return true; | 303 return true; |
| (...skipping 3446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3738 pc_ = pc; | 3750 pc_ = pc; |
| 3739 special_[kExceptionSpecialIndex] = raw_exception; | 3751 special_[kExceptionSpecialIndex] = raw_exception; |
| 3740 special_[kStacktraceSpecialIndex] = raw_stacktrace; | 3752 special_[kStacktraceSpecialIndex] = raw_stacktrace; |
| 3741 buf->Longjmp(); | 3753 buf->Longjmp(); |
| 3742 UNREACHABLE(); | 3754 UNREACHABLE(); |
| 3743 } | 3755 } |
| 3744 | 3756 |
| 3745 } // namespace dart | 3757 } // namespace dart |
| 3746 | 3758 |
| 3747 #endif // defined TARGET_ARCH_DBC | 3759 #endif // defined TARGET_ARCH_DBC |
| OLD | NEW |