Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(824)

Unified Diff: src/compiler/js-create-lowering.cc

Issue 1963583004: [turbofan] Initial version of allocation folding and write barrier elimination. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Jaros comments; Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/js-create-lowering.h ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/compiler/js-create-lowering.h ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698