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

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

Issue 2406383002: DBC: Pull BadTypeError out of AssertAssignable (Closed)
Patch Set: Add comment Created 4 years, 2 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 | « runtime/vm/constants_dbc.h ('k') | runtime/vm/simulator_dbc.cc » ('j') | 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 "vm/globals.h" // Needed here to get TARGET_ARCH_DBC. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC.
6 #if defined(TARGET_ARCH_DBC) 6 #if defined(TARGET_ARCH_DBC)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 if (!dst_type.IsVoidType() && dst_type.IsInstantiated()) { 223 if (!dst_type.IsVoidType() && dst_type.IsInstantiated()) {
224 test_cache = SubtypeTestCache::New(); 224 test_cache = SubtypeTestCache::New();
225 } 225 }
226 226
227 if (is_optimizing()) { 227 if (is_optimizing()) {
228 __ Push(locs->in(0).reg()); 228 __ Push(locs->in(0).reg());
229 __ Push(locs->in(1).reg()); 229 __ Push(locs->in(1).reg());
230 } 230 }
231 __ PushConstant(dst_type); 231 __ PushConstant(dst_type);
232 __ PushConstant(dst_name); 232 __ PushConstant(dst_name);
233 __ AssertAssignable(__ AddConstant(test_cache)); 233
234 if (dst_type.IsMalformedOrMalbounded()) {
235 __ BadTypeError();
236 } else {
237 __ AssertAssignable(__ AddConstant(test_cache));
238 }
239
234 if (is_optimizing()) { 240 if (is_optimizing()) {
235 // Register allocator does not think that our first input (also used as 241 // Register allocator does not think that our first input (also used as
236 // output) needs to be kept alive across the call because that is how code 242 // output) needs to be kept alive across the call because that is how code
237 // is written on other platforms (where registers are always spilled across 243 // is written on other platforms (where registers are always spilled across
238 // the call): inputs are consumed by operation and output is produced so 244 // the call): inputs are consumed by operation and output is produced so
239 // neither are alive at the safepoint. 245 // neither are alive at the safepoint.
240 // We have to mark the slot alive manually to ensure that GC 246 // We have to mark the slot alive manually to ensure that GC
241 // visits it. 247 // visits it.
242 locs->SetStackBit(locs->out(0).reg()); 248 locs->SetStackBit(locs->out(0).reg());
243 } 249 }
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { 544 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) {
539 UNIMPLEMENTED(); 545 UNIMPLEMENTED();
540 } 546 }
541 547
542 548
543 #undef __ 549 #undef __
544 550
545 } // namespace dart 551 } // namespace dart
546 552
547 #endif // defined TARGET_ARCH_DBC 553 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « runtime/vm/constants_dbc.h ('k') | runtime/vm/simulator_dbc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698