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

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

Issue 1978453002: [turbofan] Properly initialize mutable heap numbers in literals. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.1
Patch Set: 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') | test/mjsunit/regress/regress-crbug-610228.js » ('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 df5c8d07df1fda816a712ee88cb74bef85f45b8c..20033636edc186e9015b316d6de95c8fbce7f8df 100644
--- a/src/compiler/js-create-lowering.cc
+++ b/src/compiler/js-create-lowering.cc
@@ -905,8 +905,17 @@ 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(),
+ Callable callable = CodeFactory::AllocateMutableHeapNumber(isolate());
+ CallDescriptor* desc = Linkage::GetStubCallDescriptor(
+ isolate(), jsgraph()->zone(), callable.descriptor(), 0,
+ CallDescriptor::kNoFlags, Operator::kNoThrow);
+ value = effect = graph()->NewNode(
+ common()->Call(desc), jsgraph()->HeapConstant(callable.code()),
+ jsgraph()->NoContextConstant(), effect, control);
+ effect = graph()->NewNode(
+ simplified()->StoreField(AccessBuilder::ForHeapNumberValue()),
+ value, jsgraph()->Constant(
+ Handle<HeapNumber>::cast(boilerplate_value)->value()),
effect, control);
} else if (property_details.representation().IsSmi()) {
// Ensure that value is stored as smi.
@@ -1028,23 +1037,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') | test/mjsunit/regress/regress-crbug-610228.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698