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 Unique<Object> unique = Unique<Object>::CreateImmovable(object); | 14 Unique<Object> unique = Unique<Object>::CreateImmovable(object); |
15 return NewNode(common()->HeapConstant(unique)); | 15 return NewNode(common()->HeapConstant(unique)); |
16 } | 16 } |
17 | 17 |
18 | 18 |
19 Node* JSGraph::NewNode(Operator* op) { | 19 Node* JSGraph::NewNode(const Operator* op) { |
20 Node* node = graph()->NewNode(op); | 20 Node* node = graph()->NewNode(op); |
21 typer_->Init(node); | 21 typer_->Init(node); |
22 return node; | 22 return node; |
23 } | 23 } |
24 | 24 |
25 | 25 |
26 Node* JSGraph::CEntryStubConstant() { | 26 Node* JSGraph::CEntryStubConstant() { |
27 if (!c_entry_stub_constant_.is_set()) { | 27 if (!c_entry_stub_constant_.is_set()) { |
28 c_entry_stub_constant_.set( | 28 c_entry_stub_constant_.set( |
29 ImmovableHeapConstant(CEntryStub(isolate(), 1).GetCode())); | 29 ImmovableHeapConstant(CEntryStub(isolate(), 1).GetCode())); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |