Commit b72c32c0 authored by Mythri Alle's avatar Mythri Alle Committed by Commit Bot

Revert "[turboprop] Pass required parameters as value inputs to TierUpCheck node"

This reverts commit 44f46def.

Reason for revert: Causes failure in  linux 64 fyi bots.
https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20-%20fyi/18646?

Original change's description:
> [turboprop] Pass required parameters as value inputs to TierUpCheck node
>
> TierUpCheck node tail calls interpreter entry trampoline when additional
> processing is needed for tiering up. Calling IET requires target,
> new_target, input count and context as parameters. Earlier these were
> created as parameter nodes in effect-control-linearizer. This causes
> problems with Turboprop since TurboProp doesn't use the second scheduler
> and cannot reschedule these nodes to the start block. We should instead
> create these parameter nodes in bytecode-graph-builder and pass them
> as value inputs to TierUpCheck node.
>
> Bug: v8:9684
> Change-Id: Icfe5a33b4e628d5a3ba9a3121b2b0746be6aed5c
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2498695
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Commit-Queue: Mythri Alle <mythria@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70790}

TBR=rmcilroy@chromium.org,mythria@chromium.org,jgruber@chromium.org

Change-Id: I66cd8a90efb39378c99e18f35548a1490b5e413a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9684
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2501846Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70794}
parent 23ba0667
......@@ -1330,8 +1330,6 @@ void InstructionSelector::VisitNode(Node* node) {
case IrOpcode::kFinishRegion:
return MarkAsTagged(node), VisitFinishRegion(node);
case IrOpcode::kParameter: {
// Parameters should always be scheduled to the first block.
DCHECK_EQ(schedule()->block(node)->rpo_number(), 0);
MachineType type =
linkage()->GetParameterType(ParameterIndexOf(node->op()));
MarkAsRepresentation(type.representation(), node);
......
......@@ -1117,23 +1117,7 @@ Node* BytecodeGraphBuilder::BuildLoadNativeContext() {
void BytecodeGraphBuilder::MaybeBuildTierUpCheck() {
if (!CodeKindChecksOptimizationMarker(code_kind())) return;
int parameter_count = bytecode_array().parameter_count();
Node* target = GetFunctionClosure();
Node* new_target = graph()->NewNode(
common()->Parameter(
Linkage::GetJSCallNewTargetParamIndex(parameter_count),
"%new.target"),
graph()->start());
Node* argc = graph()->NewNode(
common()->Parameter(Linkage::GetJSCallArgCountParamIndex(parameter_count),
"%argc"),
graph()->start());
DCHECK_EQ(environment()->Context()->opcode(), IrOpcode::kParameter);
Node* context = environment()->Context();
NewNode(simplified()->TierUpCheck(), feedback_vector_node(), target,
new_target, argc, context);
NewNode(simplified()->TierUpCheck(), feedback_vector_node());
}
void BytecodeGraphBuilder::MaybeBuildIncrementInvocationCount() {
......
......@@ -3713,8 +3713,17 @@ void EffectControlLinearizer::LowerTierUpCheck(Node* node) {
// Currently we delegate these tasks to the InterpreterEntryTrampoline.
// TODO(jgruber,v8:8888): Consider a dedicated builtin instead.
const int parameter_count =
StartNode{graph()->start()}.FormalParameterCount();
TNode<HeapObject> code =
__ HeapConstant(BUILTIN_CODE(isolate(), InterpreterEntryTrampoline));
Node* target = __ Parameter(Linkage::kJSCallClosureParamIndex);
Node* new_target =
__ Parameter(Linkage::GetJSCallNewTargetParamIndex(parameter_count));
Node* argc =
__ Parameter(Linkage::GetJSCallArgCountParamIndex(parameter_count));
Node* context =
__ Parameter(Linkage::GetJSCallContextParamIndex(parameter_count));
JSTrampolineDescriptor descriptor;
CallDescriptor::Flags flags = CallDescriptor::kFixedTargetRegister |
......@@ -3722,8 +3731,8 @@ void EffectControlLinearizer::LowerTierUpCheck(Node* node) {
auto call_descriptor = Linkage::GetStubCallDescriptor(
graph()->zone(), descriptor, descriptor.GetStackParameterCount(), flags,
Operator::kNoProperties);
Node* nodes[] = {code, n.target(), n.new_target(), n.input_count(),
n.context(), __ effect(), __ control()};
Node* nodes[] = {code, target, new_target, argc,
context, __ effect(), __ control()};
#ifdef DEBUG
static constexpr int kCodeContextEffectControl = 4;
......
......@@ -2828,16 +2828,7 @@ class RepresentationSelector {
return VisitUnop<T>(node, UseInfo::AnyTagged(),
MachineRepresentation::kTaggedPointer);
}
case IrOpcode::kTierUpCheck: {
ProcessInput<T>(node, 0, UseInfo::AnyTagged());
ProcessInput<T>(node, 1, UseInfo::AnyTagged());
ProcessInput<T>(node, 2, UseInfo::AnyTagged());
ProcessInput<T>(node, 3, UseInfo::AnyTagged());
ProcessInput<T>(node, 4, UseInfo::AnyTagged());
ProcessRemainingInputs<T>(node, 5);
SetOutput<T>(node, MachineRepresentation::kNone);
return;
}
case IrOpcode::kTierUpCheck:
case IrOpcode::kUpdateInterruptBudget: {
ProcessInput<T>(node, 0, UseInfo::AnyTagged());
ProcessRemainingInputs<T>(node, 1);
......
......@@ -1325,7 +1325,7 @@ const Operator* SimplifiedOperatorBuilder::UpdateInterruptBudget(int delta) {
const Operator* SimplifiedOperatorBuilder::TierUpCheck() {
return zone()->New<Operator>(IrOpcode::kTierUpCheck,
Operator::kNoThrow | Operator::kNoDeopt,
"TierUpCheck", 5, 1, 1, 0, 1, 0);
"TierUpCheck", 1, 1, 1, 0, 1, 0);
}
const Operator* SimplifiedOperatorBuilder::AssertType(Type type) {
......
......@@ -1190,12 +1190,7 @@ class TierUpCheckNode final : public SimplifiedNodeWrapperBase {
CONSTEXPR_DCHECK(node->opcode() == IrOpcode::kTierUpCheck);
}
#define INPUTS(V) \
V(FeedbackVector, feedback_vector, 0, FeedbackVector) \
V(Target, target, 1, JSReceiver) \
V(NewTarget, new_target, 2, Object) \
V(InputCount, input_count, 3, Object) \
V(Context, context, 4, Context)
#define INPUTS(V) V(FeedbackVector, feedback_vector, 0, FeedbackVector)
INPUTS(DEFINE_INPUT_ACCESSORS)
#undef INPUTS
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment