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/change-lowering.h" | 5 #include "src/compiler/change-lowering.h" |
6 | 6 |
7 #include "src/compiler/common-node-cache.h" | 7 #include "src/compiler/common-node-cache.h" |
8 #include "src/compiler/graph.h" | 8 #include "src/compiler/graph.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 16 matching lines...) Expand all Loading... |
27 Node* ChangeLoweringBase::ExternalConstant(ExternalReference reference) { | 27 Node* ChangeLoweringBase::ExternalConstant(ExternalReference reference) { |
28 Node** loc = cache()->FindExternalConstant(reference); | 28 Node** loc = cache()->FindExternalConstant(reference); |
29 if (*loc == NULL) { | 29 if (*loc == NULL) { |
30 *loc = graph()->NewNode(common()->ExternalConstant(reference)); | 30 *loc = graph()->NewNode(common()->ExternalConstant(reference)); |
31 } | 31 } |
32 return *loc; | 32 return *loc; |
33 } | 33 } |
34 | 34 |
35 | 35 |
36 Node* ChangeLoweringBase::HeapConstant(PrintableUnique<HeapObject> value) { | 36 Node* ChangeLoweringBase::HeapConstant(PrintableUnique<HeapObject> value) { |
37 Node** loc = cache()->FindHeapConstant(value); | 37 // TODO(bmeurer): Use common node cache. |
38 if (*loc == NULL) { | 38 return graph()->NewNode(common()->HeapConstant(value)); |
39 *loc = graph()->NewNode(common()->HeapConstant(value)); | |
40 } | |
41 return *loc; | |
42 } | 39 } |
43 | 40 |
44 | 41 |
45 Node* ChangeLoweringBase::ImmovableHeapConstant(Handle<HeapObject> value) { | 42 Node* ChangeLoweringBase::ImmovableHeapConstant(Handle<HeapObject> value) { |
46 return HeapConstant( | 43 return HeapConstant( |
47 PrintableUnique<HeapObject>::CreateImmovable(graph()->zone(), value)); | 44 PrintableUnique<HeapObject>::CreateImmovable(graph()->zone(), value)); |
48 } | 45 } |
49 | 46 |
50 | 47 |
51 Node* ChangeLoweringBase::Int32Constant(int32_t value) { | 48 Node* ChangeLoweringBase::Int32Constant(int32_t value) { |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 return Replace(phi); | 251 return Replace(phi); |
255 } | 252 } |
256 | 253 |
257 | 254 |
258 template class ChangeLowering<4>; | 255 template class ChangeLowering<4>; |
259 template class ChangeLowering<8>; | 256 template class ChangeLowering<8>; |
260 | 257 |
261 } // namespace compiler | 258 } // namespace compiler |
262 } // namespace internal | 259 } // namespace internal |
263 } // namespace v8 | 260 } // namespace v8 |
OLD | NEW |