Index: src/compiler/effect-control-linearizer.cc |
diff --git a/src/compiler/effect-control-linearizer.cc b/src/compiler/effect-control-linearizer.cc |
index e3d0498087f9c20c44bd6a2d6b0d71f34e3f1966..a9b6013d34182f739bc00b32c70adac230b42772 100644 |
--- a/src/compiler/effect-control-linearizer.cc |
+++ b/src/compiler/effect-control-linearizer.cc |
@@ -433,24 +433,18 @@ EffectControlLinearizer::LowerChangeUint32ToTagged(Node* node, Node* effect, |
EffectControlLinearizer::ValueEffectControl |
EffectControlLinearizer::AllocateHeapNumberWithValue(Node* value, Node* effect, |
Node* control) { |
- // The AllocateHeapNumberStub does not use the context, so we can safely pass |
- // in Smi zero here. |
- Callable callable = CodeFactory::AllocateHeapNumber(jsgraph()->isolate()); |
- Node* target = jsgraph()->HeapConstant(callable.code()); |
- Node* context = jsgraph()->NoContextConstant(); |
- if (!allocate_heap_number_operator_.is_set()) { |
- CallDescriptor* descriptor = Linkage::GetStubCallDescriptor( |
- jsgraph()->isolate(), jsgraph()->zone(), callable.descriptor(), 0, |
- CallDescriptor::kNoFlags, Operator::kNoThrow); |
- allocate_heap_number_operator_.set(common()->Call(descriptor)); |
- } |
- Node* heap_number = graph()->NewNode(allocate_heap_number_operator_.get(), |
- target, context, effect, control); |
- Node* store = graph()->NewNode( |
- machine()->Store(StoreRepresentation(MachineRepresentation::kFloat64, |
- kNoWriteBarrier)), |
- heap_number, HeapNumberValueIndexConstant(), value, heap_number, control); |
- return ValueEffectControl(heap_number, store, control); |
+ effect = graph()->NewNode(common()->BeginRegion(), effect); |
+ Node* result = effect = |
+ graph()->NewNode(simplified()->Allocate(NOT_TENURED), |
+ jsgraph()->Constant(HeapNumber::kSize), effect, control); |
+ effect = graph()->NewNode(simplified()->StoreField(AccessBuilder::ForMap()), |
+ result, jsgraph()->HeapNumberMapConstant(), effect, |
+ control); |
+ effect = graph()->NewNode( |
+ simplified()->StoreField(AccessBuilder::ForHeapNumberValue()), result, |
+ value, effect, control); |
+ result = effect = graph()->NewNode(common()->FinishRegion(), result, effect); |
+ return ValueEffectControl(result, effect, control); |
} |
Node* EffectControlLinearizer::ChangeInt32ToSmi(Node* value) { |
@@ -475,10 +469,6 @@ Node* EffectControlLinearizer::ChangeUint32ToFloat64(Node* value) { |
return graph()->NewNode(machine()->ChangeUint32ToFloat64(), value); |
} |
-Node* EffectControlLinearizer::HeapNumberValueIndexConstant() { |
- return jsgraph()->IntPtrConstant(HeapNumber::kValueOffset - kHeapObjectTag); |
-} |
- |
Node* EffectControlLinearizer::SmiMaxValueConstant() { |
return jsgraph()->Int32Constant(Smi::kMaxValue); |
} |