| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 const int smi_shift_size = machine()->Is32() ? SmiTagging<4>::SmiShiftSize() | 66 const int smi_shift_size = machine()->Is32() ? SmiTagging<4>::SmiShiftSize() |
| 67 : SmiTagging<8>::SmiShiftSize(); | 67 : SmiTagging<8>::SmiShiftSize(); |
| 68 return jsgraph()->IntPtrConstant(smi_shift_size + kSmiTagSize); | 68 return jsgraph()->IntPtrConstant(smi_shift_size + kSmiTagSize); |
| 69 } | 69 } |
| 70 | 70 |
| 71 | 71 |
| 72 Node* ChangeLowering::AllocateHeapNumberWithValue(Node* value, Node* control) { | 72 Node* ChangeLowering::AllocateHeapNumberWithValue(Node* value, Node* control) { |
| 73 // The AllocateHeapNumberStub does not use the context, so we can safely pass | 73 // The AllocateHeapNumberStub does not use the context, so we can safely pass |
| 74 // in Smi zero here. | 74 // in Smi zero here. |
| 75 Callable callable = CodeFactory::AllocateHeapNumber(isolate()); | 75 Callable callable = CodeFactory::AllocateHeapNumber(isolate()); |
| 76 CallDescriptor* descriptor = linkage()->GetStubCallDescriptor( | 76 CallDescriptor* descriptor = Linkage::GetStubCallDescriptor( |
| 77 callable.descriptor(), 0, CallDescriptor::kNoFlags); | 77 isolate(), jsgraph()->zone(), callable.descriptor(), 0, |
| 78 CallDescriptor::kNoFlags); |
| 78 Node* target = jsgraph()->HeapConstant(callable.code()); | 79 Node* target = jsgraph()->HeapConstant(callable.code()); |
| 79 Node* context = jsgraph()->NoContextConstant(); | 80 Node* context = jsgraph()->NoContextConstant(); |
| 80 Node* effect = graph()->NewNode(common()->ValueEffect(1), value); | 81 Node* effect = graph()->NewNode(common()->ValueEffect(1), value); |
| 81 Node* heap_number = graph()->NewNode(common()->Call(descriptor), target, | 82 Node* heap_number = graph()->NewNode(common()->Call(descriptor), target, |
| 82 context, effect, control); | 83 context, effect, control); |
| 83 Node* store = graph()->NewNode( | 84 Node* store = graph()->NewNode( |
| 84 machine()->Store(StoreRepresentation(kMachFloat64, kNoWriteBarrier)), | 85 machine()->Store(StoreRepresentation(kMachFloat64, kNoWriteBarrier)), |
| 85 heap_number, HeapNumberValueIndexConstant(), value, heap_number, control); | 86 heap_number, HeapNumberValueIndexConstant(), value, heap_number, control); |
| 86 return graph()->NewNode(common()->Finish(1), heap_number, store); | 87 return graph()->NewNode(common()->Finish(1), heap_number, store); |
| 87 } | 88 } |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 } | 281 } |
| 281 | 282 |
| 282 | 283 |
| 283 MachineOperatorBuilder* ChangeLowering::machine() const { | 284 MachineOperatorBuilder* ChangeLowering::machine() const { |
| 284 return jsgraph()->machine(); | 285 return jsgraph()->machine(); |
| 285 } | 286 } |
| 286 | 287 |
| 287 } // namespace compiler | 288 } // namespace compiler |
| 288 } // namespace internal | 289 } // namespace internal |
| 289 } // namespace v8 | 290 } // namespace v8 |
| OLD | NEW |