Index: src/compiler/frame-elider.cc |
diff --git a/src/compiler/frame-elider.cc b/src/compiler/frame-elider.cc |
index 172a724dd8a744dce535f47f96ec9f1342d3d4d1..7db6b61026809c3f1a184d6d23198c01f49597b8 100644 |
--- a/src/compiler/frame-elider.cc |
+++ b/src/compiler/frame-elider.cc |
@@ -2,8 +2,9 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "src/base/adapters.h" |
#include "src/compiler/frame-elider.h" |
+#include "src/base/adapters.h" |
+#include "src/compiler/linkage.h" |
namespace v8 { |
namespace internal { |
@@ -11,8 +12,12 @@ namespace compiler { |
FrameElider::FrameElider(InstructionSequence* code) : code_(code) {} |
-void FrameElider::Run() { |
- MarkBlocks(); |
+void FrameElider::Run(const CallDescriptor* descriptor) { |
+ if (descriptor != nullptr && descriptor->RequiresFrameAsIncoming()) { |
+ instruction_blocks()[0]->mark_needs_frame(); |
+ } else { |
+ MarkBlocks(); |
+ } |
PropagateMarks(); |
MarkDeConstruction(); |
} |
@@ -23,7 +28,8 @@ void FrameElider::MarkBlocks() { |
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) { |
+ InstructionAt(i)->opcode() == ArchOpcode::kArchDeoptimize || |
+ InstructionAt(i)->opcode() == ArchOpcode::kArchStackPointer) { |
block->mark_needs_frame(); |
break; |
} |