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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 : jsgraph_(jsgraph), | 68 : jsgraph_(jsgraph), |
69 count_(jsgraph->graph()->NodeCount()), | 69 count_(jsgraph->graph()->NodeCount()), |
70 info_(zone->NewArray<NodeInfo>(count_)), | 70 info_(zone->NewArray<NodeInfo>(count_)), |
71 nodes_(zone), | 71 nodes_(zone), |
72 replacements_(zone), | 72 replacements_(zone), |
73 phase_(PROPAGATE), | 73 phase_(PROPAGATE), |
74 changer_(changer), | 74 changer_(changer), |
75 queue_(zone) { | 75 queue_(zone) { |
76 memset(info_, 0, sizeof(NodeInfo) * count_); | 76 memset(info_, 0, sizeof(NodeInfo) * count_); |
77 | 77 |
78 Factory* f = jsgraph->isolate()->factory(); | |
79 safe_int_additive_range_ = | 78 safe_int_additive_range_ = |
80 Type::Range(f->NewNumber(-std::pow(2.0, 52.0)), | 79 Type::Range(-std::pow(2.0, 52.0), std::pow(2.0, 52.0), zone); |
81 f->NewNumber(std::pow(2.0, 52.0)), zone); | |
82 } | 80 } |
83 | 81 |
84 void Run(SimplifiedLowering* lowering) { | 82 void Run(SimplifiedLowering* lowering) { |
85 // Run propagation phase to a fixpoint. | 83 // Run propagation phase to a fixpoint. |
86 TRACE(("--{Propagation phase}--\n")); | 84 TRACE(("--{Propagation phase}--\n")); |
87 phase_ = PROPAGATE; | 85 phase_ = PROPAGATE; |
88 Enqueue(jsgraph_->graph()->end()); | 86 Enqueue(jsgraph_->graph()->end()); |
89 // Process nodes from the queue until it is empty. | 87 // Process nodes from the queue until it is empty. |
90 while (!queue_.empty()) { | 88 while (!queue_.empty()) { |
91 Node* node = queue_.front(); | 89 Node* node = queue_.front(); |
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1515 | 1513 |
1516 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { | 1514 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { |
1517 node->set_op(machine()->IntLessThanOrEqual()); | 1515 node->set_op(machine()->IntLessThanOrEqual()); |
1518 node->ReplaceInput(0, StringComparison(node, true)); | 1516 node->ReplaceInput(0, StringComparison(node, true)); |
1519 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); | 1517 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); |
1520 } | 1518 } |
1521 | 1519 |
1522 } // namespace compiler | 1520 } // namespace compiler |
1523 } // namespace internal | 1521 } // namespace internal |
1524 } // namespace v8 | 1522 } // namespace v8 |
OLD | NEW |