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/js-typed-lowering.cc

Issue 1399423002: [turbofan] Introduce node regions for protection from scheduling. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move RelaxControls Created 5 years, 2 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/instruction-selector.cc ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-typed-lowering.cc
diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc
index de07f5a52e960a796678cf31c1ef6361d5a5b4a8..95e22082ea25bf92188cd53e0d2f92451fd80493 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -46,6 +46,7 @@ class AllocationBuilder final {
// Primitive allocation of static size.
void Allocate(int size) {
+ effect_ = graph()->NewNode(jsgraph()->common()->BeginRegion(), effect_);
allocation_ = graph()->NewNode(
simplified()->Allocate(), jsgraph()->Constant(size), effect_, control_);
effect_ = allocation_;
@@ -70,8 +71,13 @@ class AllocationBuilder final {
Store(access, jsgraph()->Constant(value));
}
- Node* allocation() const { return allocation_; }
- Node* effect() const { return effect_; }
+ void Finish(Node* node) {
+ NodeProperties::SetType(allocation_, NodeProperties::GetType(node));
+ node->ReplaceInput(0, allocation_);
+ node->ReplaceInput(1, effect_);
+ node->TrimInputCount(2);
+ NodeProperties::ChangeOp(node, jsgraph()->common()->FinishRegion());
+ }
protected:
JSGraph* jsgraph() { return jsgraph_; }
@@ -1274,13 +1280,8 @@ Reduction JSTypedLowering::ReduceJSCreateFunctionContext(Node* node) {
for (int i = Context::MIN_CONTEXT_SLOTS; i < context_length; ++i) {
a.Store(AccessBuilder::ForContextSlot(i), jsgraph()->TheHoleConstant());
}
- // TODO(mstarzinger): We could mutate {node} into the allocation instead.
- NodeProperties::SetType(a.allocation(), NodeProperties::GetType(node));
- ReplaceWithValue(node, node, a.effect());
- node->ReplaceInput(0, a.allocation());
- node->ReplaceInput(1, a.effect());
- node->TrimInputCount(2);
- NodeProperties::ChangeOp(node, common()->Finish(1));
+ RelaxControls(node);
+ a.Finish(node);
return Changed(node);
}
@@ -1325,13 +1326,8 @@ Reduction JSTypedLowering::ReduceJSCreateWithContext(Node* node) {
a.Store(AccessBuilder::ForContextSlot(Context::PREVIOUS_INDEX), context);
a.Store(AccessBuilder::ForContextSlot(Context::EXTENSION_INDEX), input);
a.Store(AccessBuilder::ForContextSlot(Context::GLOBAL_OBJECT_INDEX), load);
- // TODO(mstarzinger): We could mutate {node} into the allocation instead.
- NodeProperties::SetType(a.allocation(), NodeProperties::GetType(node));
- ReplaceWithValue(node, node, a.effect());
- node->ReplaceInput(0, a.allocation());
- node->ReplaceInput(1, a.effect());
- node->TrimInputCount(2);
- NodeProperties::ChangeOp(node, common()->Finish(1));
+ RelaxControls(node);
+ a.Finish(node);
return Changed(node);
}
@@ -1366,13 +1362,8 @@ Reduction JSTypedLowering::ReduceJSCreateBlockContext(Node* node) {
for (int i = Context::MIN_CONTEXT_SLOTS; i < context_length; ++i) {
a.Store(AccessBuilder::ForContextSlot(i), jsgraph()->TheHoleConstant());
}
- // TODO(mstarzinger): We could mutate {node} into the allocation instead.
- NodeProperties::SetType(a.allocation(), NodeProperties::GetType(node));
- ReplaceWithValue(node, node, a.effect());
- node->ReplaceInput(0, a.allocation());
- node->ReplaceInput(1, a.effect());
- node->TrimInputCount(2);
- NodeProperties::ChangeOp(node, common()->Finish(1));
+ RelaxControls(node);
+ a.Finish(node);
return Changed(node);
}
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698