Index: src/compiler/js-create-lowering.cc |
diff --git a/src/compiler/js-create-lowering.cc b/src/compiler/js-create-lowering.cc |
index 746296935e8774cdcfddc4ad46a11a610967cf0e..7e589ea5899198490898081078ff6b1045123ff9 100644 |
--- a/src/compiler/js-create-lowering.cc |
+++ b/src/compiler/js-create-lowering.cc |
@@ -953,9 +953,21 @@ Node* JSCreateLowering::AllocateFastLiteral( |
site_context->ExitScope(current_site, boilerplate_object); |
} else if (property_details.representation().IsDouble()) { |
// Allocate a mutable HeapNumber box and store the value into it. |
- value = effect = AllocateMutableHeapNumber( |
- Handle<HeapNumber>::cast(boilerplate_value)->value(), |
+ effect = graph()->NewNode(common()->BeginRegion(), effect); |
+ value = effect = graph()->NewNode( |
+ simplified()->Allocate(NOT_TENURED), |
+ jsgraph()->Constant(HeapNumber::kSize), effect, control); |
+ effect = graph()->NewNode( |
+ simplified()->StoreField(AccessBuilder::ForMap()), value, |
+ jsgraph()->HeapConstant(factory()->mutable_heap_number_map()), |
effect, control); |
+ effect = graph()->NewNode( |
+ simplified()->StoreField(AccessBuilder::ForHeapNumberValue()), |
+ value, jsgraph()->Constant( |
+ Handle<HeapNumber>::cast(boilerplate_value)->value()), |
+ effect, control); |
+ value = effect = |
+ graph()->NewNode(common()->FinishRegion(), value, effect); |
} else if (property_details.representation().IsSmi()) { |
// Ensure that value is stored as smi. |
value = boilerplate_value->IsUninitialized() |
@@ -1076,23 +1088,6 @@ Node* JSCreateLowering::AllocateFastLiteralElements( |
return builder.Finish(); |
} |
-Node* JSCreateLowering::AllocateMutableHeapNumber(double value, Node* effect, |
- Node* control) { |
- // TODO(turbofan): Support inline allocation of MutableHeapNumber |
- // (requires proper alignment on Allocate, and Begin/FinishRegion). |
- Callable callable = CodeFactory::AllocateMutableHeapNumber(isolate()); |
- CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
- isolate(), jsgraph()->zone(), callable.descriptor(), 0, |
- CallDescriptor::kNoFlags, Operator::kNoThrow); |
- Node* result = effect = graph()->NewNode( |
- common()->Call(desc), jsgraph()->HeapConstant(callable.code()), |
- jsgraph()->NoContextConstant(), effect, control); |
- effect = graph()->NewNode( |
- simplified()->StoreField(AccessBuilder::ForHeapNumberValue()), result, |
- jsgraph()->Constant(value), effect, control); |
- return result; |
-} |
- |
MaybeHandle<LiteralsArray> JSCreateLowering::GetSpecializationLiterals( |
Node* node) { |
Node* const closure = NodeProperties::GetValueInput(node, 0); |