| 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/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
| 9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
| 10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 return jsgraph()->IntPtrConstant(kSmiShiftSize + kSmiTagSize); | 59 return jsgraph()->IntPtrConstant(kSmiShiftSize + kSmiTagSize); |
| 60 } | 60 } |
| 61 | 61 |
| 62 | 62 |
| 63 Node* ChangeLowering::AllocateHeapNumberWithValue(Node* value, Node* control) { | 63 Node* ChangeLowering::AllocateHeapNumberWithValue(Node* value, Node* control) { |
| 64 // The AllocateHeapNumberStub does not use the context, so we can safely pass | 64 // The AllocateHeapNumberStub does not use the context, so we can safely pass |
| 65 // in Smi zero here. | 65 // in Smi zero here. |
| 66 Callable callable = CodeFactory::AllocateHeapNumber(isolate()); | 66 Callable callable = CodeFactory::AllocateHeapNumber(isolate()); |
| 67 Node* target = jsgraph()->HeapConstant(callable.code()); | 67 Node* target = jsgraph()->HeapConstant(callable.code()); |
| 68 Node* context = jsgraph()->NoContextConstant(); | 68 Node* context = jsgraph()->NoContextConstant(); |
| 69 Node* effect = graph()->NewNode(common()->ValueEffect(1), value); | 69 Node* effect = graph()->NewNode(common()->BeginRegion(), graph()->start()); |
| 70 if (!allocate_heap_number_operator_.is_set()) { | 70 if (!allocate_heap_number_operator_.is_set()) { |
| 71 CallDescriptor* descriptor = Linkage::GetStubCallDescriptor( | 71 CallDescriptor* descriptor = Linkage::GetStubCallDescriptor( |
| 72 isolate(), jsgraph()->zone(), callable.descriptor(), 0, | 72 isolate(), jsgraph()->zone(), callable.descriptor(), 0, |
| 73 CallDescriptor::kNoFlags, Operator::kNoThrow); | 73 CallDescriptor::kNoFlags, Operator::kNoThrow); |
| 74 allocate_heap_number_operator_.set(common()->Call(descriptor)); | 74 allocate_heap_number_operator_.set(common()->Call(descriptor)); |
| 75 } | 75 } |
| 76 Node* heap_number = graph()->NewNode(allocate_heap_number_operator_.get(), | 76 Node* heap_number = graph()->NewNode(allocate_heap_number_operator_.get(), |
| 77 target, context, effect, control); | 77 target, context, effect, control); |
| 78 Node* store = graph()->NewNode( | 78 Node* store = graph()->NewNode( |
| 79 machine()->Store(StoreRepresentation(kMachFloat64, kNoWriteBarrier)), | 79 machine()->Store(StoreRepresentation(kMachFloat64, kNoWriteBarrier)), |
| 80 heap_number, HeapNumberValueIndexConstant(), value, heap_number, control); | 80 heap_number, HeapNumberValueIndexConstant(), value, heap_number, control); |
| 81 return graph()->NewNode(common()->Finish(1), heap_number, store); | 81 return graph()->NewNode(common()->FinishRegion(), heap_number, store); |
| 82 } | 82 } |
| 83 | 83 |
| 84 | 84 |
| 85 Node* ChangeLowering::ChangeInt32ToFloat64(Node* value) { | 85 Node* ChangeLowering::ChangeInt32ToFloat64(Node* value) { |
| 86 return graph()->NewNode(machine()->ChangeInt32ToFloat64(), value); | 86 return graph()->NewNode(machine()->ChangeInt32ToFloat64(), value); |
| 87 } | 87 } |
| 88 | 88 |
| 89 | 89 |
| 90 Node* ChangeLowering::ChangeInt32ToSmi(Node* value) { | 90 Node* ChangeLowering::ChangeInt32ToSmi(Node* value) { |
| 91 if (machine()->Is64()) { | 91 if (machine()->Is64()) { |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 } | 347 } |
| 348 | 348 |
| 349 | 349 |
| 350 MachineOperatorBuilder* ChangeLowering::machine() const { | 350 MachineOperatorBuilder* ChangeLowering::machine() const { |
| 351 return jsgraph()->machine(); | 351 return jsgraph()->machine(); |
| 352 } | 352 } |
| 353 | 353 |
| 354 } // namespace compiler | 354 } // namespace compiler |
| 355 } // namespace internal | 355 } // namespace internal |
| 356 } // namespace v8 | 356 } // namespace v8 |
| OLD | NEW |