Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: runtime/vm/simulator_dbc.cc

Issue 1926453002: Fixes assert assignable check for DBC (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after
1627 NativeArguments args(thread, 2, SP + 1, SP - 1); 1627 NativeArguments args(thread, 2, SP + 1, SP - 1);
1628 INVOKE_RUNTIME(DRT_AllocateArray, args); 1628 INVOKE_RUNTIME(DRT_AllocateArray, args);
1629 SP -= 1; 1629 SP -= 1;
1630 DISPATCH(); 1630 DISPATCH();
1631 } 1631 }
1632 1632
1633 { 1633 {
1634 BYTECODE(AssertAssignable, A_D); // Stack: instance, type args, type, name 1634 BYTECODE(AssertAssignable, A_D); // Stack: instance, type args, type, name
1635 RawObject** args = SP - 3; 1635 RawObject** args = SP - 3;
1636 if (args[0] != null_value) { 1636 if (args[0] != null_value) {
1637 const AbstractType& dst_type =
1638 AbstractType::Handle(static_cast<RawAbstractType*>(args[2]));
1639 if (dst_type.IsMalformedOrMalbounded()) {
1640 SP[1] = args[0]; // instance.
1641 SP[2] = args[3]; // name.
1642 SP[3] = args[2]; // type.
1643 Exit(thread, FP, SP + 4, pc);
1644 NativeArguments args(thread, 3, SP + 1, SP - 3);
1645 INVOKE_RUNTIME(DRT_BadTypeError, args);
1646 UNREACHABLE();
1647 }
1648
1637 RawSubtypeTestCache* cache = 1649 RawSubtypeTestCache* cache =
1638 static_cast<RawSubtypeTestCache*>(LOAD_CONSTANT(rD)); 1650 static_cast<RawSubtypeTestCache*>(LOAD_CONSTANT(rD));
1639 if (cache != null_value) { 1651 if (cache != null_value) {
1640 RawInstance* instance = static_cast<RawInstance*>(args[0]); 1652 RawInstance* instance = static_cast<RawInstance*>(args[0]);
1641 RawTypeArguments* instantiator_type_arguments = 1653 RawTypeArguments* instantiator_type_arguments =
1642 static_cast<RawTypeArguments*>(args[1]); 1654 static_cast<RawTypeArguments*>(args[1]);
1643 1655
1644 const intptr_t cid = SimulatorHelpers::GetClassId(instance); 1656 const intptr_t cid = SimulatorHelpers::GetClassId(instance);
1645 1657
1646 RawTypeArguments* instance_type_arguments = 1658 RawTypeArguments* instance_type_arguments =
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1893 special_[kExceptionSpecialIndex] = raw_exception; 1905 special_[kExceptionSpecialIndex] = raw_exception;
1894 special_[kStacktraceSpecialIndex] = raw_stacktrace; 1906 special_[kStacktraceSpecialIndex] = raw_stacktrace;
1895 buf->Longjmp(); 1907 buf->Longjmp();
1896 UNREACHABLE(); 1908 UNREACHABLE();
1897 } 1909 }
1898 1910
1899 } // namespace dart 1911 } // namespace dart
1900 1912
1901 1913
1902 #endif // defined TARGET_ARCH_DBC 1914 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698