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.h" | 7 #include "src/compiler/node-properties.h" |
8 #include "src/compiler/typer.h" | 8 #include "src/compiler/typer.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 namespace compiler { | 12 namespace compiler { |
13 | 13 |
14 #define CACHED(name, expr) \ | 14 #define CACHED(name, expr) \ |
15 cached_nodes_[name] ? cached_nodes_[name] : (cached_nodes_[name] = (expr)) | 15 cached_nodes_[name] ? cached_nodes_[name] : (cached_nodes_[name] = (expr)) |
16 | 16 |
17 Node* JSGraph::AllocateInNewSpaceStubConstant() { | 17 Node* JSGraph::AllocateInNewSpaceStubConstant() { |
18 return CACHED(kAllocateInNewSpaceStubConstant, | 18 return CACHED(kAllocateInNewSpaceStubConstant, |
19 HeapConstant(isolate()->builtins()->AllocateInNewSpace())); | 19 HeapConstant(isolate()->builtins()->AllocateInNewSpace())); |
20 } | 20 } |
21 | 21 |
22 Node* JSGraph::AllocateInOldSpaceStubConstant() { | 22 Node* JSGraph::AllocateInOldSpaceStubConstant() { |
23 return CACHED(kAllocateInOldSpaceStubConstant, | 23 return CACHED(kAllocateInOldSpaceStubConstant, |
24 HeapConstant(isolate()->builtins()->AllocateInOldSpace())); | 24 HeapConstant(isolate()->builtins()->AllocateInOldSpace())); |
25 } | 25 } |
26 | 26 |
| 27 Node* JSGraph::ToNumberBuiltinConstant() { |
| 28 return CACHED(kToNumberBuiltinConstant, |
| 29 HeapConstant(isolate()->builtins()->ToNumber())); |
| 30 } |
| 31 |
27 Node* JSGraph::CEntryStubConstant(int result_size) { | 32 Node* JSGraph::CEntryStubConstant(int result_size) { |
28 if (result_size == 1) { | 33 if (result_size == 1) { |
29 return CACHED(kCEntryStubConstant, | 34 return CACHED(kCEntryStubConstant, |
30 HeapConstant(CEntryStub(isolate(), 1).GetCode())); | 35 HeapConstant(CEntryStub(isolate(), 1).GetCode())); |
31 } | 36 } |
32 return HeapConstant(CEntryStub(isolate(), result_size).GetCode()); | 37 return HeapConstant(CEntryStub(isolate(), result_size).GetCode()); |
33 } | 38 } |
34 | 39 |
35 | 40 |
36 Node* JSGraph::EmptyFixedArrayConstant() { | 41 Node* JSGraph::EmptyFixedArrayConstant() { |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 for (size_t i = 0; i < arraysize(cached_nodes_); i++) { | 244 for (size_t i = 0; i < arraysize(cached_nodes_); i++) { |
240 if (Node* node = cached_nodes_[i]) { | 245 if (Node* node = cached_nodes_[i]) { |
241 if (!node->IsDead()) nodes->push_back(node); | 246 if (!node->IsDead()) nodes->push_back(node); |
242 } | 247 } |
243 } | 248 } |
244 } | 249 } |
245 | 250 |
246 } // namespace compiler | 251 } // namespace compiler |
247 } // namespace internal | 252 } // namespace internal |
248 } // namespace v8 | 253 } // namespace v8 |
OLD | NEW |