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

Unified Diff: src/compiler/frame-elider.cc

Issue 1775323002: [turbofan] Frame elision for code stubs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: MOVED InitializeRootRegister call Created 4 years, 9 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
Index: src/compiler/frame-elider.cc
diff --git a/src/compiler/frame-elider.cc b/src/compiler/frame-elider.cc
index bb35643f5dc965c612bc0d9a73f5982a4b9b0aff..20e922b78a108c6282c181db1a393480b2977d5a 100644
--- a/src/compiler/frame-elider.cc
+++ b/src/compiler/frame-elider.cc
@@ -17,13 +17,13 @@ void FrameElider::Run() {
MarkDeConstruction();
}
-
void FrameElider::MarkBlocks() {
for (InstructionBlock* block : instruction_blocks()) {
if (block->needs_frame()) continue;
for (int i = block->code_start(); i < block->code_end(); ++i) {
- if (InstructionAt(i)->IsCall() ||
- InstructionAt(i)->opcode() == ArchOpcode::kArchDeoptimize) {
+ const Instruction* instr = InstructionAt(i);
+ if (instr->IsCall() || instr->IsDeoptimizeCall() ||
+ instr->arch_opcode() == ArchOpcode::kArchStackPointer) {
block->mark_needs_frame();
break;
}
@@ -50,6 +50,16 @@ void FrameElider::MarkDeConstruction() {
for (RpoNumber& succ : block->successors()) {
if (!InstructionBlockAt(succ)->needs_frame()) {
DCHECK_EQ(1U, block->SuccessorCount());
+ const Instruction* last =
+ InstructionAt(block->last_instruction_index());
+ if (last->IsThrow() || last->IsTailCall() ||
+ last->IsDeoptimizeCall()) {
+ // We need to keep the frame if we exit the block through any
+ // of these.
+ continue;
+ }
+ // The only cases when we need to deconstruct are ret and jump.
+ DCHECK(last->IsRet() || last->IsJump());
block->mark_must_deconstruct_frame();
}
}

Powered by Google App Engine
This is Rietveld 408576698