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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/frame-elider.h"
5 #include "src/base/adapters.h" 6 #include "src/base/adapters.h"
6 #include "src/compiler/frame-elider.h" 7 #include "src/compiler/linkage.h"
7 8
8 namespace v8 { 9 namespace v8 {
9 namespace internal { 10 namespace internal {
10 namespace compiler { 11 namespace compiler {
11 12
12 FrameElider::FrameElider(InstructionSequence* code) : code_(code) {} 13 FrameElider::FrameElider(InstructionSequence* code) : code_(code) {}
13 14
14 void FrameElider::Run() { 15 void FrameElider::Run(const CallDescriptor* descriptor) {
15 MarkBlocks(); 16 if (descriptor != nullptr && descriptor->RequiresFrameAsIncoming()) {
17 instruction_blocks()[0]->mark_needs_frame();
18 } else {
19 MarkBlocks();
20 }
16 PropagateMarks(); 21 PropagateMarks();
17 MarkDeConstruction(); 22 MarkDeConstruction();
18 } 23 }
19 24
20 25
21 void FrameElider::MarkBlocks() { 26 void FrameElider::MarkBlocks() {
22 for (InstructionBlock* block : instruction_blocks()) { 27 for (InstructionBlock* block : instruction_blocks()) {
23 if (block->needs_frame()) continue; 28 if (block->needs_frame()) continue;
24 for (int i = block->code_start(); i < block->code_end(); ++i) { 29 for (int i = block->code_start(); i < block->code_end(); ++i) {
25 if (InstructionAt(i)->IsCall() || 30 if (InstructionAt(i)->IsCall() ||
26 InstructionAt(i)->opcode() == ArchOpcode::kArchDeoptimize) { 31 InstructionAt(i)->opcode() == ArchOpcode::kArchDeoptimize ||
32 InstructionAt(i)->opcode() == ArchOpcode::kArchStackPointer) {
27 block->mark_needs_frame(); 33 block->mark_needs_frame();
28 break; 34 break;
29 } 35 }
30 } 36 }
31 } 37 }
32 } 38 }
33 39
34 40
35 void FrameElider::PropagateMarks() { 41 void FrameElider::PropagateMarks() {
36 while (PropagateInOrder() && PropagateReversed()) { 42 while (PropagateInOrder() && PropagateReversed()) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 } 128 }
123 129
124 130
125 Instruction* FrameElider::InstructionAt(int index) const { 131 Instruction* FrameElider::InstructionAt(int index) const {
126 return code_->InstructionAt(index); 132 return code_->InstructionAt(index);
127 } 133 }
128 134
129 } // namespace compiler 135 } // namespace compiler
130 } // namespace internal 136 } // namespace internal
131 } // namespace v8 137 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698