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

Side by Side Diff: runtime/vm/constant_propagator.h

Issue 943273004: Fold BIT_NOT and NEGATE during constant propagation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add tests. Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/constant_propagator.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) 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 #ifndef VM_CONSTANT_PROPAGATOR_H_ 5 #ifndef VM_CONSTANT_PROPAGATOR_H_
6 #define VM_CONSTANT_PROPAGATOR_H_ 6 #define VM_CONSTANT_PROPAGATOR_H_
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 #include "vm/flow_graph.h" 9 #include "vm/flow_graph.h"
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 return value.raw() == unknown_.raw(); 53 return value.raw() == unknown_.raw();
54 } 54 }
55 bool IsNonConstant(const Object& value) { 55 bool IsNonConstant(const Object& value) {
56 return value.raw() == non_constant_.raw(); 56 return value.raw() == non_constant_.raw();
57 } 57 }
58 bool IsConstant(const Object& value) { 58 bool IsConstant(const Object& value) {
59 return !IsNonConstant(value) && !IsUnknown(value); 59 return !IsNonConstant(value) && !IsUnknown(value);
60 } 60 }
61 61
62 void VisitBinaryIntegerOp(BinaryIntegerOpInstr* binary_op); 62 void VisitBinaryIntegerOp(BinaryIntegerOpInstr* binary_op);
63 void VisitUnaryIntegerOp(UnaryIntegerOpInstr* unary_op);
63 64
64 virtual void VisitBlocks() { UNREACHABLE(); } 65 virtual void VisitBlocks() { UNREACHABLE(); }
65 66
66 #define DECLARE_VISIT(type) virtual void Visit##type(type##Instr* instr); 67 #define DECLARE_VISIT(type) virtual void Visit##type(type##Instr* instr);
67 FOR_EACH_INSTRUCTION(DECLARE_VISIT) 68 FOR_EACH_INSTRUCTION(DECLARE_VISIT)
68 #undef DECLARE_VISIT 69 #undef DECLARE_VISIT
69 70
70 Isolate* isolate() const { return graph_->isolate(); } 71 Isolate* isolate() const { return graph_->isolate(); }
71 72
72 FlowGraph* graph_; 73 FlowGraph* graph_;
(...skipping 10 matching lines...) Expand all
83 84
84 // Worklists of blocks and definitions. 85 // Worklists of blocks and definitions.
85 GrowableArray<BlockEntryInstr*> block_worklist_; 86 GrowableArray<BlockEntryInstr*> block_worklist_;
86 DefinitionWorklist definition_worklist_; 87 DefinitionWorklist definition_worklist_;
87 }; 88 };
88 89
89 90
90 } // namespace dart 91 } // namespace dart
91 92
92 #endif // VM_CONSTANT_PROPAGATOR_H_ 93 #endif // VM_CONSTANT_PROPAGATOR_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/constant_propagator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698