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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart

Issue 1512303002: dart2js cps: Add instruction for bounds checks. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library dart2js.ir_tracer; 5 library dart2js.ir_tracer;
6 6
7 import 'dart:async' show EventSink; 7 import 'dart:async' show EventSink;
8 import 'cps_ir_nodes.dart' as cps_ir; 8 import 'cps_ir_nodes.dart' as cps_ir;
9 import '../tracer.dart'; 9 import '../tracer.dart';
10 10
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 String object = formatReference(node.object); 382 String object = formatReference(node.object);
383 String index = formatReference(node.index); 383 String index = formatReference(node.index);
384 String value = formatReference(node.value); 384 String value = formatReference(node.value);
385 return 'SetIndex $object $index $value'; 385 return 'SetIndex $object $index $value';
386 } 386 }
387 387
388 visitRefinement(cps_ir.Refinement node) { 388 visitRefinement(cps_ir.Refinement node) {
389 String value = formatReference(node.value); 389 String value = formatReference(node.value);
390 return 'Refinement $value ${node.refineType}'; 390 return 'Refinement $value ${node.refineType}';
391 } 391 }
392
393 visitBoundsCheck(cps_ir.BoundsCheck node) {
394 String object = formatReference(node.object);
395 String index = node.index == null
396 ? 'no-index'
397 : formatReference(node.index);
398 String length = node.length == null
399 ? 'no-length'
400 : formatReference(node.length);
401 return 'BoundsCheck $object $index $length ${node.checkString}';
402 }
392 } 403 }
393 404
394 /** 405 /**
395 * Invents (and remembers) names for Continuations, Parameters, etc. 406 * Invents (and remembers) names for Continuations, Parameters, etc.
396 * The names must match the conventions used by IR Hydra, e.g. 407 * The names must match the conventions used by IR Hydra, e.g.
397 * Continuations and Functions must have names of form B### since they 408 * Continuations and Functions must have names of form B### since they
398 * are visualized as basic blocks. 409 * are visualized as basic blocks.
399 */ 410 */
400 class Names { 411 class Names {
401 final Map<Object, String> names = {}; 412 final Map<Object, String> names = {};
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 unexpectedNode(node); 675 unexpectedNode(node);
665 } 676 }
666 677
667 visitYield(cps_ir.Yield node) { 678 visitYield(cps_ir.Yield node) {
668 unexpectedNode(node); 679 unexpectedNode(node);
669 } 680 }
670 681
671 visitRefinement(cps_ir.Refinement node) { 682 visitRefinement(cps_ir.Refinement node) {
672 unexpectedNode(node); 683 unexpectedNode(node);
673 } 684 }
685
686 visitBoundsCheck(cps_ir.BoundsCheck node) {
687 unexpectedNode(node);
688 }
674 } 689 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698