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 { |
11 namespace compiler { | 11 namespace compiler { |
12 | 12 |
13 Node* JSGraph::ImmovableHeapConstant(Handle<Object> object) { | 13 Node* JSGraph::ImmovableHeapConstant(Handle<Object> object) { |
14 PrintableUnique<Object> unique = | 14 PrintableUnique<Object> unique = |
15 PrintableUnique<Object>::CreateImmovable(zone(), object); | 15 PrintableUnique<Object>::CreateImmovable(zone(), object); |
16 return NewNode(common()->HeapConstant(unique)); | 16 return NewNode(common()->HeapConstant(unique)); |
17 } | 17 } |
18 | 18 |
19 | 19 |
20 Node* JSGraph::NewNode(Operator* op) { | 20 Node* JSGraph::NewNode(Operator* op) { |
21 Node* node = graph()->NewNode(op); | 21 Node* node = graph()->NewNode(op); |
22 typer_->Init(node); | 22 typer_->Init(node); |
23 return node; | 23 return node; |
24 } | 24 } |
25 | 25 |
26 | 26 |
| 27 Node* JSGraph::CEntryStubConstant() { |
| 28 if (!c_entry_stub_constant_.is_set()) { |
| 29 c_entry_stub_constant_.set( |
| 30 ImmovableHeapConstant(CEntryStub(isolate(), 1).GetCode())); |
| 31 } |
| 32 return c_entry_stub_constant_.get(); |
| 33 } |
| 34 |
| 35 |
27 Node* JSGraph::UndefinedConstant() { | 36 Node* JSGraph::UndefinedConstant() { |
28 if (!undefined_constant_.is_set()) { | 37 if (!undefined_constant_.is_set()) { |
29 undefined_constant_.set( | 38 undefined_constant_.set( |
30 ImmovableHeapConstant(factory()->undefined_value())); | 39 ImmovableHeapConstant(factory()->undefined_value())); |
31 } | 40 } |
32 return undefined_constant_.get(); | 41 return undefined_constant_.get(); |
33 } | 42 } |
34 | 43 |
35 | 44 |
36 Node* JSGraph::TheHoleConstant() { | 45 Node* JSGraph::TheHoleConstant() { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 Node* JSGraph::ExternalConstant(ExternalReference reference) { | 174 Node* JSGraph::ExternalConstant(ExternalReference reference) { |
166 Node** loc = cache_.FindExternalConstant(reference); | 175 Node** loc = cache_.FindExternalConstant(reference); |
167 if (*loc == NULL) { | 176 if (*loc == NULL) { |
168 *loc = NewNode(common()->ExternalConstant(reference)); | 177 *loc = NewNode(common()->ExternalConstant(reference)); |
169 } | 178 } |
170 return *loc; | 179 return *loc; |
171 } | 180 } |
172 } // namespace compiler | 181 } // namespace compiler |
173 } // namespace internal | 182 } // namespace internal |
174 } // namespace v8 | 183 } // namespace v8 |
OLD | NEW |