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

Unified Diff: src/compiler/ia32/code-generator-ia32.cc

Issue 2473643002: Revert of [turbofan] Support variable size argument popping in TF-generated functions (Closed)
Patch Set: Created 4 years, 1 month 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/common-operator-reducer.cc ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ia32/code-generator-ia32.cc
diff --git a/src/compiler/ia32/code-generator-ia32.cc b/src/compiler/ia32/code-generator-ia32.cc
index 2e54e2a6341654c0e5bee142b65cba715c7c34b6..2b8cf08cb71e81eb286fbed3009e2a33484fb48d 100644
--- a/src/compiler/ia32/code-generator-ia32.cc
+++ b/src/compiler/ia32/code-generator-ia32.cc
@@ -649,7 +649,7 @@
break;
}
case kArchRet:
- AssembleReturn(instr->InputAt(0));
+ AssembleReturn();
break;
case kArchStackPointer:
__ mov(i.OutputRegister(), esp);
@@ -1981,7 +1981,8 @@
}
}
-void CodeGenerator::AssembleReturn(InstructionOperand* pop) {
+
+void CodeGenerator::AssembleReturn() {
CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
const RegList saves = descriptor->CalleeSavedRegisters();
@@ -1993,41 +1994,22 @@
}
}
- // Might need ecx for scratch if pop_size is too big or if there is a variable
- // pop count.
- DCHECK_EQ(0u, descriptor->CalleeSavedRegisters() & ecx.bit());
- size_t pop_size = descriptor->StackParameterCount() * kPointerSize;
- IA32OperandConverter g(this, nullptr);
if (descriptor->IsCFunctionCall()) {
AssembleDeconstructFrame();
} else if (frame_access_state()->has_frame()) {
- // Canonicalize JSFunction return sites for now if they always have the same
- // number of return args.
- if (pop->IsImmediate() && g.ToConstant(pop).ToInt32() == 0) {
- if (return_label_.is_bound()) {
- __ jmp(&return_label_);
- return;
- } else {
- __ bind(&return_label_);
- AssembleDeconstructFrame();
- }
+ // Canonicalize JSFunction return sites for now.
+ if (return_label_.is_bound()) {
+ __ jmp(&return_label_);
+ return;
} else {
+ __ bind(&return_label_);
AssembleDeconstructFrame();
}
}
- DCHECK_EQ(0u, descriptor->CalleeSavedRegisters() & edx.bit());
+ size_t pop_size = descriptor->StackParameterCount() * kPointerSize;
+ // Might need ecx for scratch if pop_size is too big.
DCHECK_EQ(0u, descriptor->CalleeSavedRegisters() & ecx.bit());
- if (pop->IsImmediate()) {
- DCHECK_EQ(Constant::kInt32, g.ToConstant(pop).type());
- pop_size += g.ToConstant(pop).ToInt32() * kPointerSize;
- __ Ret(static_cast<int>(pop_size), ecx);
- } else {
- Register pop_reg = g.ToRegister(pop);
- Register scratch_reg = pop_reg.is(ecx) ? edx : ecx;
- __ pop(scratch_reg);
- __ lea(esp, Operand(esp, pop_reg, times_4, static_cast<int>(pop_size)));
- __ jmp(scratch_reg);
- }
+ __ Ret(static_cast<int>(pop_size), ecx);
}
« no previous file with comments | « src/compiler/common-operator-reducer.cc ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698