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/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/compiler/diamond.h" | 8 #include "src/compiler/diamond.h" |
9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 } | 68 } |
69 | 69 |
70 | 70 |
71 Node* ChangeLowering::AllocateHeapNumberWithValue(Node* value, Node* control) { | 71 Node* ChangeLowering::AllocateHeapNumberWithValue(Node* value, Node* control) { |
72 // The AllocateHeapNumberStub does not use the context, so we can safely pass | 72 // The AllocateHeapNumberStub does not use the context, so we can safely pass |
73 // in Smi zero here. | 73 // in Smi zero here. |
74 Callable callable = CodeFactory::AllocateHeapNumber(isolate()); | 74 Callable callable = CodeFactory::AllocateHeapNumber(isolate()); |
75 CallDescriptor* descriptor = linkage()->GetStubCallDescriptor( | 75 CallDescriptor* descriptor = linkage()->GetStubCallDescriptor( |
76 callable.descriptor(), 0, CallDescriptor::kNoFlags); | 76 callable.descriptor(), 0, CallDescriptor::kNoFlags); |
77 Node* target = jsgraph()->HeapConstant(callable.code()); | 77 Node* target = jsgraph()->HeapConstant(callable.code()); |
78 Node* context = jsgraph()->ZeroConstant(); | 78 Node* context = jsgraph()->NoContextConstant(); |
79 Node* effect = graph()->NewNode(common()->ValueEffect(1), value); | 79 Node* effect = graph()->NewNode(common()->ValueEffect(1), value); |
80 Node* heap_number = graph()->NewNode(common()->Call(descriptor), target, | 80 Node* heap_number = graph()->NewNode(common()->Call(descriptor), target, |
81 context, effect, control); | 81 context, effect, control); |
82 Node* store = graph()->NewNode( | 82 Node* store = graph()->NewNode( |
83 machine()->Store(StoreRepresentation(kMachFloat64, kNoWriteBarrier)), | 83 machine()->Store(StoreRepresentation(kMachFloat64, kNoWriteBarrier)), |
84 heap_number, HeapNumberValueIndexConstant(), value, heap_number, control); | 84 heap_number, HeapNumberValueIndexConstant(), value, heap_number, control); |
85 return graph()->NewNode(common()->Finish(1), heap_number, store); | 85 return graph()->NewNode(common()->Finish(1), heap_number, store); |
86 } | 86 } |
87 | 87 |
88 | 88 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 } | 274 } |
275 | 275 |
276 | 276 |
277 MachineOperatorBuilder* ChangeLowering::machine() const { | 277 MachineOperatorBuilder* ChangeLowering::machine() const { |
278 return jsgraph()->machine(); | 278 return jsgraph()->machine(); |
279 } | 279 } |
280 | 280 |
281 } // namespace compiler | 281 } // namespace compiler |
282 } // namespace internal | 282 } // namespace internal |
283 } // namespace v8 | 283 } // namespace v8 |
OLD | NEW |