OLD | NEW |
---|---|
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/simplified-lowering.h" | 5 #include "src/compiler/simplified-lowering.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 bool queued : 1; // Bookkeeping for the traversal. | 65 bool queued : 1; // Bookkeeping for the traversal. |
66 bool visited : 1; // Bookkeeping for the traversal. | 66 bool visited : 1; // Bookkeeping for the traversal. |
67 MachineTypeUnion output : 15; // Output type of the node. | 67 MachineTypeUnion output : 15; // Output type of the node. |
68 }; | 68 }; |
69 | 69 |
70 RepresentationSelector(JSGraph* jsgraph, Zone* zone, | 70 RepresentationSelector(JSGraph* jsgraph, Zone* zone, |
71 RepresentationChanger* changer, | 71 RepresentationChanger* changer, |
72 SourcePositionTable* source_positions) | 72 SourcePositionTable* source_positions) |
73 : jsgraph_(jsgraph), | 73 : jsgraph_(jsgraph), |
74 count_(jsgraph->graph()->NodeCount()), | 74 count_(jsgraph->graph()->NodeCount()), |
75 info_(zone->NewArray<NodeInfo>(count_)), | 75 info_(zone->NewArray<NodeInfo>(static_cast<int>(count_))), |
Sven Panne
2015/06/12 11:19:36
AFAICT, we don't need the static_cast here. By des
| |
76 nodes_(zone), | 76 nodes_(zone), |
77 replacements_(zone), | 77 replacements_(zone), |
78 phase_(PROPAGATE), | 78 phase_(PROPAGATE), |
79 changer_(changer), | 79 changer_(changer), |
80 queue_(zone), | 80 queue_(zone), |
81 source_positions_(source_positions) { | 81 source_positions_(source_positions) { |
82 memset(info_, 0, sizeof(NodeInfo) * count_); | 82 memset(info_, 0, sizeof(NodeInfo) * count_); |
83 | 83 |
84 safe_int_additive_range_ = | 84 safe_int_additive_range_ = |
85 Type::Range(-std::pow(2.0, 52.0), std::pow(2.0, 52.0), zone); | 85 Type::Range(-std::pow(2.0, 52.0), std::pow(2.0, 52.0), zone); |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1078 | 1078 |
1079 void PrintInfo(MachineTypeUnion info) { | 1079 void PrintInfo(MachineTypeUnion info) { |
1080 if (FLAG_trace_representation) { | 1080 if (FLAG_trace_representation) { |
1081 OFStream os(stdout); | 1081 OFStream os(stdout); |
1082 os << static_cast<MachineType>(info); | 1082 os << static_cast<MachineType>(info); |
1083 } | 1083 } |
1084 } | 1084 } |
1085 | 1085 |
1086 private: | 1086 private: |
1087 JSGraph* jsgraph_; | 1087 JSGraph* jsgraph_; |
1088 int count_; // number of nodes in the graph | 1088 size_t const count_; // number of nodes in the graph |
1089 NodeInfo* info_; // node id -> usage information | 1089 NodeInfo* info_; // node id -> usage information |
1090 NodeVector nodes_; // collected nodes | 1090 NodeVector nodes_; // collected nodes |
1091 NodeVector replacements_; // replacements to be done after lowering | 1091 NodeVector replacements_; // replacements to be done after lowering |
1092 Phase phase_; // current phase of algorithm | 1092 Phase phase_; // current phase of algorithm |
1093 RepresentationChanger* changer_; // for inserting representation changes | 1093 RepresentationChanger* changer_; // for inserting representation changes |
1094 ZoneQueue<Node*> queue_; // queue for traversing the graph | 1094 ZoneQueue<Node*> queue_; // queue for traversing the graph |
1095 // TODO(danno): RepresentationSelector shouldn't know anything about the | 1095 // TODO(danno): RepresentationSelector shouldn't know anything about the |
1096 // source positions table, but must for now since there currently is no other | 1096 // source positions table, but must for now since there currently is no other |
1097 // way to pass down source position information to nodes created during | 1097 // way to pass down source position information to nodes created during |
1098 // lowering. Once this phase becomes a vanilla reducer, it should get source | 1098 // lowering. Once this phase becomes a vanilla reducer, it should get source |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1592 | 1592 |
1593 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { | 1593 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { |
1594 node->set_op(machine()->IntLessThanOrEqual()); | 1594 node->set_op(machine()->IntLessThanOrEqual()); |
1595 node->ReplaceInput(0, StringComparison(node, true)); | 1595 node->ReplaceInput(0, StringComparison(node, true)); |
1596 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); | 1596 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); |
1597 } | 1597 } |
1598 | 1598 |
1599 } // namespace compiler | 1599 } // namespace compiler |
1600 } // namespace internal | 1600 } // namespace internal |
1601 } // namespace v8 | 1601 } // namespace v8 |
OLD | NEW |