| 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 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2665 | 2665 |
| 2666 InstanceOfOk: | 2666 InstanceOfOk: |
| 2667 SP -= 3; | 2667 SP -= 3; |
| 2668 if (rA) { // Negate result. | 2668 if (rA) { // Negate result. |
| 2669 SP[0] = (SP[0] == true_value) ? false_value : true_value; | 2669 SP[0] = (SP[0] == true_value) ? false_value : true_value; |
| 2670 } | 2670 } |
| 2671 DISPATCH(); | 2671 DISPATCH(); |
| 2672 } | 2672 } |
| 2673 | 2673 |
| 2674 { | 2674 { |
| 2675 BYTECODE(BadTypeError, 0); // Stack: instance, type args, type, name |
| 2676 RawObject** args = SP - 3; |
| 2677 if (args[0] != null_value) { |
| 2678 SP[1] = args[0]; // instance. |
| 2679 SP[2] = args[3]; // name. |
| 2680 SP[3] = args[2]; // type. |
| 2681 Exit(thread, FP, SP + 4, pc); |
| 2682 NativeArguments native_args(thread, 3, SP + 1, SP - 3); |
| 2683 INVOKE_RUNTIME(DRT_BadTypeError, native_args); |
| 2684 UNREACHABLE(); |
| 2685 } |
| 2686 SP -= 3; |
| 2687 DISPATCH(); |
| 2688 } |
| 2689 |
| 2690 { |
| 2675 BYTECODE(AssertAssignable, A_D); // Stack: instance, type args, type, name | 2691 BYTECODE(AssertAssignable, A_D); // Stack: instance, type args, type, name |
| 2676 RawObject** args = SP - 3; | 2692 RawObject** args = SP - 3; |
| 2677 if (args[0] != null_value) { | 2693 if (args[0] != null_value) { |
| 2678 const AbstractType& dst_type = | |
| 2679 AbstractType::Handle(static_cast<RawAbstractType*>(args[2])); | |
| 2680 if (dst_type.IsMalformedOrMalbounded()) { | |
| 2681 SP[1] = args[0]; // instance. | |
| 2682 SP[2] = args[3]; // name. | |
| 2683 SP[3] = args[2]; // type. | |
| 2684 Exit(thread, FP, SP + 4, pc); | |
| 2685 NativeArguments native_args(thread, 3, SP + 1, SP - 3); | |
| 2686 INVOKE_RUNTIME(DRT_BadTypeError, native_args); | |
| 2687 UNREACHABLE(); | |
| 2688 } | |
| 2689 | |
| 2690 RawSubtypeTestCache* cache = | 2694 RawSubtypeTestCache* cache = |
| 2691 static_cast<RawSubtypeTestCache*>(LOAD_CONSTANT(rD)); | 2695 static_cast<RawSubtypeTestCache*>(LOAD_CONSTANT(rD)); |
| 2692 if (cache != null_value) { | 2696 if (cache != null_value) { |
| 2693 RawInstance* instance = static_cast<RawInstance*>(args[0]); | 2697 RawInstance* instance = static_cast<RawInstance*>(args[0]); |
| 2694 RawTypeArguments* instantiator_type_arguments = | 2698 RawTypeArguments* instantiator_type_arguments = |
| 2695 static_cast<RawTypeArguments*>(args[1]); | 2699 static_cast<RawTypeArguments*>(args[1]); |
| 2696 | 2700 |
| 2697 const intptr_t cid = SimulatorHelpers::GetClassId(instance); | 2701 const intptr_t cid = SimulatorHelpers::GetClassId(instance); |
| 2698 | 2702 |
| 2699 RawTypeArguments* instance_type_arguments = | 2703 RawTypeArguments* instance_type_arguments = |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3485 pc_ = pc; | 3489 pc_ = pc; |
| 3486 special_[kExceptionSpecialIndex] = raw_exception; | 3490 special_[kExceptionSpecialIndex] = raw_exception; |
| 3487 special_[kStacktraceSpecialIndex] = raw_stacktrace; | 3491 special_[kStacktraceSpecialIndex] = raw_stacktrace; |
| 3488 buf->Longjmp(); | 3492 buf->Longjmp(); |
| 3489 UNREACHABLE(); | 3493 UNREACHABLE(); |
| 3490 } | 3494 } |
| 3491 | 3495 |
| 3492 } // namespace dart | 3496 } // namespace dart |
| 3493 | 3497 |
| 3494 #endif // defined TARGET_ARCH_DBC | 3498 #endif // defined TARGET_ARCH_DBC |
| OLD | NEW |