| 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/js-graph.h" | 5 #include "src/compiler/js-graph.h" |
| 6 #include "src/compiler/node-properties-inl.h" | 6 #include "src/compiler/node-properties-inl.h" |
| 7 #include "src/compiler/typer.h" | 7 #include "src/compiler/typer.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 return NullConstant(); | 127 return NullConstant(); |
| 128 } else if (value->IsTheHole()) { | 128 } else if (value->IsTheHole()) { |
| 129 return TheHoleConstant(); | 129 return TheHoleConstant(); |
| 130 } else { | 130 } else { |
| 131 return HeapConstant(value); | 131 return HeapConstant(value); |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 | 134 |
| 135 | 135 |
| 136 Node* JSGraph::Constant(double value) { | 136 Node* JSGraph::Constant(double value) { |
| 137 if (BitCast<int64_t>(value) == BitCast<int64_t>(0.0)) return ZeroConstant(); | 137 if (bit_cast<int64_t>(value) == bit_cast<int64_t>(0.0)) return ZeroConstant(); |
| 138 if (BitCast<int64_t>(value) == BitCast<int64_t>(1.0)) return OneConstant(); | 138 if (bit_cast<int64_t>(value) == bit_cast<int64_t>(1.0)) return OneConstant(); |
| 139 return NumberConstant(value); | 139 return NumberConstant(value); |
| 140 } | 140 } |
| 141 | 141 |
| 142 | 142 |
| 143 Node* JSGraph::Constant(int32_t value) { | 143 Node* JSGraph::Constant(int32_t value) { |
| 144 if (value == 0) return ZeroConstant(); | 144 if (value == 0) return ZeroConstant(); |
| 145 if (value == 1) return OneConstant(); | 145 if (value == 1) return OneConstant(); |
| 146 return NumberConstant(value); | 146 return NumberConstant(value); |
| 147 } | 147 } |
| 148 | 148 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 177 Node* JSGraph::ExternalConstant(ExternalReference reference) { | 177 Node* JSGraph::ExternalConstant(ExternalReference reference) { |
| 178 Node** loc = cache_.FindExternalConstant(reference); | 178 Node** loc = cache_.FindExternalConstant(reference); |
| 179 if (*loc == NULL) { | 179 if (*loc == NULL) { |
| 180 *loc = NewNode(common()->ExternalConstant(reference)); | 180 *loc = NewNode(common()->ExternalConstant(reference)); |
| 181 } | 181 } |
| 182 return *loc; | 182 return *loc; |
| 183 } | 183 } |
| 184 } // namespace compiler | 184 } // namespace compiler |
| 185 } // namespace internal | 185 } // namespace internal |
| 186 } // namespace v8 | 186 } // namespace v8 |
| OLD | NEW |