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

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

Issue 2318673004: dart2js: Inhibit code motion of indexing (Closed)
Patch Set: 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.
Siggi Cherem (dart-lang) 2016/09/07 14:27:01 maybe add a TODO to make this more precise & refer
2627 bool get isMovable => false;
2628
2626 HInstruction getDartReceiver(Compiler compiler) => receiver; 2629 HInstruction getDartReceiver(Compiler compiler) => receiver;
2627 bool onlyThrowsNSM() => true; 2630 bool onlyThrowsNSM() => true;
2628 bool canThrow() => receiver.canBeNull(); 2631 bool canThrow() => receiver.canBeNull();
2629 2632
2630 int typeCode() => HInstruction.INDEX_TYPECODE; 2633 int typeCode() => HInstruction.INDEX_TYPECODE;
2631 bool typeEquals(HInstruction other) => other is HIndex; 2634 bool typeEquals(HInstruction other) => other is HIndex;
2632 bool dataEquals(HIndex other) => true; 2635 bool dataEquals(HIndex other) => true;
2633 } 2636 }
2634 2637
2635 /** 2638 /**
(...skipping 10 matching lines...) Expand all
2646 sideEffects.clearAllDependencies(); 2649 sideEffects.clearAllDependencies();
2647 sideEffects.setChangesIndex(); 2650 sideEffects.setChangesIndex();
2648 } 2651 }
2649 String toString() => 'index assign operator'; 2652 String toString() => 'index assign operator';
2650 accept(HVisitor visitor) => visitor.visitIndexAssign(this); 2653 accept(HVisitor visitor) => visitor.visitIndexAssign(this);
2651 2654
2652 HInstruction get receiver => inputs[0]; 2655 HInstruction get receiver => inputs[0];
2653 HInstruction get index => inputs[1]; 2656 HInstruction get index => inputs[1];
2654 HInstruction get value => inputs[2]; 2657 HInstruction get value => inputs[2];
2655 2658
2659 // Implicit dependency on HBoundsCheck or constraints on index.
2660 bool get isMovable => false;
2661
2656 HInstruction getDartReceiver(Compiler compiler) => receiver; 2662 HInstruction getDartReceiver(Compiler compiler) => receiver;
2657 bool onlyThrowsNSM() => true; 2663 bool onlyThrowsNSM() => true;
2658 bool canThrow() => receiver.canBeNull(); 2664 bool canThrow() => receiver.canBeNull();
2659 } 2665 }
2660 2666
2661 class HIs extends HInstruction { 2667 class HIs extends HInstruction {
2662 /// A check against a raw type: 'o is int', 'o is A'. 2668 /// A check against a raw type: 'o is int', 'o is A'.
2663 static const int RAW_CHECK = 0; 2669 static const int RAW_CHECK = 0;
2664 2670
2665 /// A check against a type with type arguments: 'o is List<int>', 'o is C<T>'. 2671 /// 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 { 3435 class HDynamicType extends HRuntimeType {
3430 HDynamicType(DynamicType dartType, TypeMask instructionType) 3436 HDynamicType(DynamicType dartType, TypeMask instructionType)
3431 : super(const <HInstruction>[], dartType, instructionType); 3437 : super(const <HInstruction>[], dartType, instructionType);
3432 3438
3433 accept(HVisitor visitor) => visitor.visitDynamicType(this); 3439 accept(HVisitor visitor) => visitor.visitDynamicType(this);
3434 3440
3435 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; 3441 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE;
3436 3442
3437 bool typeEquals(HInstruction other) => other is HDynamicType; 3443 bool typeEquals(HInstruction other) => other is HDynamicType;
3438 } 3444 }
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