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

Unified Diff: src/compiler/effect-control-linearizer.cc

Issue 1900593002: [turbofan] Lower HeapNumber allocations to Allocate nodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/effect-control-linearizer.h ('k') | src/compiler/js-graph.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « src/compiler/effect-control-linearizer.h ('k') | src/compiler/js-graph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698