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

Side by Side Diff: src/compiler/frame-elider.cc

Issue 2469273003: [stubs] Add a utility class to generate code to access builtin arguments (Closed)
Patch Set: Review feedback 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 unified diff | Download patch
« no previous file with comments | « src/code-stub-assembler.cc ('k') | test/cctest/compiler/code-assembler-tester.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/base/adapters.h" 5 #include "src/base/adapters.h"
6 #include "src/compiler/frame-elider.h" 6 #include "src/compiler/frame-elider.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 namespace compiler { 10 namespace compiler {
11 11
12 FrameElider::FrameElider(InstructionSequence* code) : code_(code) {} 12 FrameElider::FrameElider(InstructionSequence* code) : code_(code) {}
13 13
14 void FrameElider::Run() { 14 void FrameElider::Run() {
15 MarkBlocks(); 15 MarkBlocks();
16 PropagateMarks(); 16 PropagateMarks();
17 MarkDeConstruction(); 17 MarkDeConstruction();
18 } 18 }
19 19
20 20
21 void FrameElider::MarkBlocks() { 21 void FrameElider::MarkBlocks() {
22 for (InstructionBlock* block : instruction_blocks()) { 22 for (InstructionBlock* block : instruction_blocks()) {
23 if (block->needs_frame()) continue; 23 if (block->needs_frame()) continue;
24 for (int i = block->code_start(); i < block->code_end(); ++i) { 24 for (int i = block->code_start(); i < block->code_end(); ++i) {
25 const Instruction* instr = InstructionAt(i); 25 const Instruction* instr = InstructionAt(i);
26 if (instr->IsCall() || instr->IsDeoptimizeCall() || 26 if (instr->IsCall() || instr->IsDeoptimizeCall() ||
27 instr->arch_opcode() == ArchOpcode::kArchStackPointer) { 27 instr->arch_opcode() == ArchOpcode::kArchStackPointer ||
28 instr->arch_opcode() == ArchOpcode::kArchFramePointer) {
28 block->mark_needs_frame(); 29 block->mark_needs_frame();
29 break; 30 break;
30 } 31 }
31 } 32 }
32 } 33 }
33 } 34 }
34 35
35 36
36 void FrameElider::PropagateMarks() { 37 void FrameElider::PropagateMarks() {
37 while (PropagateInOrder() || PropagateReversed()) { 38 while (PropagateInOrder() || PropagateReversed()) {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 134 }
134 135
135 136
136 Instruction* FrameElider::InstructionAt(int index) const { 137 Instruction* FrameElider::InstructionAt(int index) const {
137 return code_->InstructionAt(index); 138 return code_->InstructionAt(index);
138 } 139 }
139 140
140 } // namespace compiler 141 } // namespace compiler
141 } // namespace internal 142 } // namespace internal
142 } // namespace v8 143 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stub-assembler.cc ('k') | test/cctest/compiler/code-assembler-tester.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698