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 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2683 INVOKE_RUNTIME(DRT_BadTypeError, native_args); | 2683 INVOKE_RUNTIME(DRT_BadTypeError, native_args); |
2684 UNREACHABLE(); | 2684 UNREACHABLE(); |
2685 } | 2685 } |
2686 SP -= 3; | 2686 SP -= 3; |
2687 DISPATCH(); | 2687 DISPATCH(); |
2688 } | 2688 } |
2689 | 2689 |
2690 { | 2690 { |
2691 BYTECODE(AssertAssignable, A_D); // Stack: instance, type args, type, name | 2691 BYTECODE(AssertAssignable, A_D); // Stack: instance, type args, type, name |
2692 RawObject** args = SP - 3; | 2692 RawObject** args = SP - 3; |
2693 if (args[0] != null_value) { | 2693 const bool may_be_smi = (rA == 1); |
| 2694 const bool is_smi = |
| 2695 ((reinterpret_cast<intptr_t>(args[0]) & kSmiTagMask) == kSmiTag); |
| 2696 const bool smi_ok = is_smi && may_be_smi; |
| 2697 if (!smi_ok && (args[0] != null_value)) { |
2694 RawSubtypeTestCache* cache = | 2698 RawSubtypeTestCache* cache = |
2695 static_cast<RawSubtypeTestCache*>(LOAD_CONSTANT(rD)); | 2699 static_cast<RawSubtypeTestCache*>(LOAD_CONSTANT(rD)); |
2696 if (cache != null_value) { | 2700 if (cache != null_value) { |
2697 RawInstance* instance = static_cast<RawInstance*>(args[0]); | 2701 RawInstance* instance = static_cast<RawInstance*>(args[0]); |
2698 RawTypeArguments* instantiator_type_arguments = | 2702 RawTypeArguments* instantiator_type_arguments = |
2699 static_cast<RawTypeArguments*>(args[1]); | 2703 static_cast<RawTypeArguments*>(args[1]); |
2700 | 2704 |
2701 const intptr_t cid = SimulatorHelpers::GetClassId(instance); | 2705 const intptr_t cid = SimulatorHelpers::GetClassId(instance); |
2702 | 2706 |
2703 RawTypeArguments* instance_type_arguments = | 2707 RawTypeArguments* instance_type_arguments = |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3489 pc_ = pc; | 3493 pc_ = pc; |
3490 special_[kExceptionSpecialIndex] = raw_exception; | 3494 special_[kExceptionSpecialIndex] = raw_exception; |
3491 special_[kStacktraceSpecialIndex] = raw_stacktrace; | 3495 special_[kStacktraceSpecialIndex] = raw_stacktrace; |
3492 buf->Longjmp(); | 3496 buf->Longjmp(); |
3493 UNREACHABLE(); | 3497 UNREACHABLE(); |
3494 } | 3498 } |
3495 | 3499 |
3496 } // namespace dart | 3500 } // namespace dart |
3497 | 3501 |
3498 #endif // defined TARGET_ARCH_DBC | 3502 #endif // defined TARGET_ARCH_DBC |
OLD | NEW |