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/code-stubs.h" | 5 #include "src/code-stubs.h" |
6 #include "src/compiler/js-graph.h" | 6 #include "src/compiler/js-graph.h" |
7 #include "src/compiler/node-properties-inl.h" | 7 #include "src/compiler/node-properties-inl.h" |
8 #include "src/compiler/typer.h" | 8 #include "src/compiler/typer.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 193 |
194 Node* JSGraph::ExternalConstant(ExternalReference reference) { | 194 Node* JSGraph::ExternalConstant(ExternalReference reference) { |
195 Node** loc = cache_.FindExternalConstant(reference); | 195 Node** loc = cache_.FindExternalConstant(reference); |
196 if (*loc == NULL) { | 196 if (*loc == NULL) { |
197 *loc = graph()->NewNode(common()->ExternalConstant(reference)); | 197 *loc = graph()->NewNode(common()->ExternalConstant(reference)); |
198 } | 198 } |
199 return *loc; | 199 return *loc; |
200 } | 200 } |
201 | 201 |
202 | 202 |
| 203 Type* JSGraph::ZeroOneRangeType() { |
| 204 if (!zero_one_range_type_.is_set()) { |
| 205 zero_one_range_type_.set( |
| 206 Type::Range(factory()->NewNumber(0), factory()->NewNumber(1), zone())); |
| 207 } |
| 208 return zero_one_range_type_.get(); |
| 209 } |
| 210 |
| 211 |
203 void JSGraph::GetCachedNodes(NodeVector* nodes) { | 212 void JSGraph::GetCachedNodes(NodeVector* nodes) { |
204 cache_.GetCachedNodes(nodes); | 213 cache_.GetCachedNodes(nodes); |
205 SetOncePointer<Node>* ptrs[] = { | 214 SetOncePointer<Node>* ptrs[] = { |
206 &c_entry_stub_constant_, &undefined_constant_, &the_hole_constant_, | 215 &c_entry_stub_constant_, &undefined_constant_, &the_hole_constant_, |
207 &true_constant_, &false_constant_, &null_constant_, | 216 &true_constant_, &false_constant_, &null_constant_, |
208 &zero_constant_, &one_constant_, &nan_constant_}; | 217 &zero_constant_, &one_constant_, &nan_constant_}; |
209 for (size_t i = 0; i < arraysize(ptrs); i++) { | 218 for (size_t i = 0; i < arraysize(ptrs); i++) { |
210 if (ptrs[i]->is_set()) nodes->push_back(ptrs[i]->get()); | 219 if (ptrs[i]->is_set()) nodes->push_back(ptrs[i]->get()); |
211 } | 220 } |
212 } | 221 } |
213 | 222 |
214 } // namespace compiler | 223 } // namespace compiler |
215 } // namespace internal | 224 } // namespace internal |
216 } // namespace v8 | 225 } // namespace v8 |
OLD | NEW |