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

Side by Side Diff: pkg/compiler/lib/src/ssa/nodes.dart

Issue 2318673004: dart2js: Inhibit code motion of indexing (Closed)
Patch Set: Add TODO Created 4 years, 3 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 import '../closure.dart'; 5 import '../closure.dart';
6 import '../common.dart'; 6 import '../common.dart';
7 import '../compiler.dart' show Compiler; 7 import '../compiler.dart' show Compiler;
8 import '../constants/constant_system.dart'; 8 import '../constants/constant_system.dart';
9 import '../constants/values.dart'; 9 import '../constants/values.dart';
10 import '../dart_types.dart'; 10 import '../dart_types.dart';
(...skipping 2605 matching lines...) Expand 10 before | Expand all | Expand 10 after
2616 sideEffects.setDependsOnIndexStore(); 2616 sideEffects.setDependsOnIndexStore();
2617 setUseGvn(); 2617 setUseGvn();
2618 } 2618 }
2619 2619
2620 String toString() => 'index operator'; 2620 String toString() => 'index operator';
2621 accept(HVisitor visitor) => visitor.visitIndex(this); 2621 accept(HVisitor visitor) => visitor.visitIndex(this);
2622 2622
2623 HInstruction get receiver => inputs[0]; 2623 HInstruction get receiver => inputs[0];
2624 HInstruction get index => inputs[1]; 2624 HInstruction get index => inputs[1];
2625 2625
2626 // Implicit dependency on HBoundsCheck or constraints on index.
2627 // TODO(27272): Make HIndex dependent on bounds checking.
2628 bool get isMovable => false;
2629
2626 HInstruction getDartReceiver(Compiler compiler) => receiver; 2630 HInstruction getDartReceiver(Compiler compiler) => receiver;
2627 bool onlyThrowsNSM() => true; 2631 bool onlyThrowsNSM() => true;
2628 bool canThrow() => receiver.canBeNull(); 2632 bool canThrow() => receiver.canBeNull();
2629 2633
2630 int typeCode() => HInstruction.INDEX_TYPECODE; 2634 int typeCode() => HInstruction.INDEX_TYPECODE;
2631 bool typeEquals(HInstruction other) => other is HIndex; 2635 bool typeEquals(HInstruction other) => other is HIndex;
2632 bool dataEquals(HIndex other) => true; 2636 bool dataEquals(HIndex other) => true;
2633 } 2637 }
2634 2638
2635 /** 2639 /**
(...skipping 10 matching lines...) Expand all
2646 sideEffects.clearAllDependencies(); 2650 sideEffects.clearAllDependencies();
2647 sideEffects.setChangesIndex(); 2651 sideEffects.setChangesIndex();
2648 } 2652 }
2649 String toString() => 'index assign operator'; 2653 String toString() => 'index assign operator';
2650 accept(HVisitor visitor) => visitor.visitIndexAssign(this); 2654 accept(HVisitor visitor) => visitor.visitIndexAssign(this);
2651 2655
2652 HInstruction get receiver => inputs[0]; 2656 HInstruction get receiver => inputs[0];
2653 HInstruction get index => inputs[1]; 2657 HInstruction get index => inputs[1];
2654 HInstruction get value => inputs[2]; 2658 HInstruction get value => inputs[2];
2655 2659
2660 // Implicit dependency on HBoundsCheck or constraints on index.
2661 // TODO(27272): Make HIndex dependent on bounds checking.
2662 bool get isMovable => false;
2663
2656 HInstruction getDartReceiver(Compiler compiler) => receiver; 2664 HInstruction getDartReceiver(Compiler compiler) => receiver;
2657 bool onlyThrowsNSM() => true; 2665 bool onlyThrowsNSM() => true;
2658 bool canThrow() => receiver.canBeNull(); 2666 bool canThrow() => receiver.canBeNull();
2659 } 2667 }
2660 2668
2661 class HIs extends HInstruction { 2669 class HIs extends HInstruction {
2662 /// A check against a raw type: 'o is int', 'o is A'. 2670 /// A check against a raw type: 'o is int', 'o is A'.
2663 static const int RAW_CHECK = 0; 2671 static const int RAW_CHECK = 0;
2664 2672
2665 /// A check against a type with type arguments: 'o is List<int>', 'o is C<T>'. 2673 /// A check against a type with type arguments: 'o is List<int>', 'o is C<T>'.
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
3429 class HDynamicType extends HRuntimeType { 3437 class HDynamicType extends HRuntimeType {
3430 HDynamicType(DynamicType dartType, TypeMask instructionType) 3438 HDynamicType(DynamicType dartType, TypeMask instructionType)
3431 : super(const <HInstruction>[], dartType, instructionType); 3439 : super(const <HInstruction>[], dartType, instructionType);
3432 3440
3433 accept(HVisitor visitor) => visitor.visitDynamicType(this); 3441 accept(HVisitor visitor) => visitor.visitDynamicType(this);
3434 3442
3435 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; 3443 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE;
3436 3444
3437 bool typeEquals(HInstruction other) => other is HDynamicType; 3445 bool typeEquals(HInstruction other) => other is HDynamicType;
3438 } 3446 }
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