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

Side by Side Diff: src/compiler/pipeline.cc

Issue 1053123006: Calculate blocks needing a frame and frame (de)construction sites. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added missing files Created 5 years, 7 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
« no previous file with comments | « src/compiler/instruction.cc ('k') | src/flag-definitions.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/pipeline.h" 5 #include "src/compiler/pipeline.h"
6 6
7 #include <fstream> // NOLINT(readability/streams) 7 #include <fstream> // NOLINT(readability/streams)
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "src/base/adapters.h"
10 #include "src/base/platform/elapsed-timer.h" 11 #include "src/base/platform/elapsed-timer.h"
11 #include "src/compiler/ast-graph-builder.h" 12 #include "src/compiler/ast-graph-builder.h"
12 #include "src/compiler/ast-loop-assignment-analyzer.h" 13 #include "src/compiler/ast-loop-assignment-analyzer.h"
13 #include "src/compiler/basic-block-instrumentor.h" 14 #include "src/compiler/basic-block-instrumentor.h"
14 #include "src/compiler/change-lowering.h" 15 #include "src/compiler/change-lowering.h"
15 #include "src/compiler/code-generator.h" 16 #include "src/compiler/code-generator.h"
16 #include "src/compiler/common-operator-reducer.h" 17 #include "src/compiler/common-operator-reducer.h"
17 #include "src/compiler/control-flow-optimizer.h" 18 #include "src/compiler/control-flow-optimizer.h"
18 #include "src/compiler/control-reducer.h" 19 #include "src/compiler/control-reducer.h"
20 #include "src/compiler/frame-elider.h"
19 #include "src/compiler/graph-replay.h" 21 #include "src/compiler/graph-replay.h"
20 #include "src/compiler/graph-visualizer.h" 22 #include "src/compiler/graph-visualizer.h"
21 #include "src/compiler/instruction.h" 23 #include "src/compiler/instruction.h"
22 #include "src/compiler/instruction-selector.h" 24 #include "src/compiler/instruction-selector.h"
23 #include "src/compiler/js-builtin-reducer.h" 25 #include "src/compiler/js-builtin-reducer.h"
24 #include "src/compiler/js-context-specialization.h" 26 #include "src/compiler/js-context-specialization.h"
25 #include "src/compiler/js-generic-lowering.h" 27 #include "src/compiler/js-generic-lowering.h"
26 #include "src/compiler/js-inlining.h" 28 #include "src/compiler/js-inlining.h"
27 #include "src/compiler/js-intrinsic-lowering.h" 29 #include "src/compiler/js-intrinsic-lowering.h"
28 #include "src/compiler/js-type-feedback.h" 30 #include "src/compiler/js-type-feedback.h"
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 struct OptimizeMovesPhase { 827 struct OptimizeMovesPhase {
826 static const char* phase_name() { return "optimize moves"; } 828 static const char* phase_name() { return "optimize moves"; }
827 829
828 void Run(PipelineData* data, Zone* temp_zone) { 830 void Run(PipelineData* data, Zone* temp_zone) {
829 MoveOptimizer move_optimizer(temp_zone, data->sequence()); 831 MoveOptimizer move_optimizer(temp_zone, data->sequence());
830 move_optimizer.Run(); 832 move_optimizer.Run();
831 } 833 }
832 }; 834 };
833 835
834 836
837 struct FrameElisionPhase {
838 static const char* phase_name() { return "frame elision"; }
839
840 void Run(PipelineData* data, Zone* temp_zone) {
841 FrameElider(data->sequence()).Run();
842 }
843 };
844
845
835 struct JumpThreadingPhase { 846 struct JumpThreadingPhase {
836 static const char* phase_name() { return "jump threading"; } 847 static const char* phase_name() { return "jump threading"; }
837 848
838 void Run(PipelineData* data, Zone* temp_zone) { 849 void Run(PipelineData* data, Zone* temp_zone) {
839 ZoneVector<RpoNumber> result(temp_zone); 850 ZoneVector<RpoNumber> result(temp_zone);
840 if (JumpThreading::ComputeForwarding(temp_zone, result, data->sequence())) { 851 if (JumpThreading::ComputeForwarding(temp_zone, result, data->sequence())) {
841 JumpThreading::ApplyForwarding(result, data->sequence()); 852 JumpThreading::ApplyForwarding(result, data->sequence());
842 } 853 }
843 } 854 }
844 }; 855 };
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 BeginPhaseKind("register allocation"); 1188 BeginPhaseKind("register allocation");
1178 1189
1179 bool run_verifier = FLAG_turbo_verify_allocation; 1190 bool run_verifier = FLAG_turbo_verify_allocation;
1180 // Allocate registers. 1191 // Allocate registers.
1181 AllocateRegisters(RegisterConfiguration::ArchDefault(), run_verifier); 1192 AllocateRegisters(RegisterConfiguration::ArchDefault(), run_verifier);
1182 if (data->compilation_failed()) { 1193 if (data->compilation_failed()) {
1183 info()->AbortOptimization(kNotEnoughVirtualRegistersRegalloc); 1194 info()->AbortOptimization(kNotEnoughVirtualRegistersRegalloc);
1184 return Handle<Code>(); 1195 return Handle<Code>();
1185 } 1196 }
1186 1197
1198 if (FLAG_turbo_frame_elision) {
1199 Run<FrameElisionPhase>();
1200 }
1201
1187 BeginPhaseKind("code generation"); 1202 BeginPhaseKind("code generation");
1188 1203
1189 // Optimimize jumps. 1204 // Optimimize jumps.
1190 if (FLAG_turbo_jt) { 1205 if (FLAG_turbo_jt) {
1191 Run<JumpThreadingPhase>(); 1206 Run<JumpThreadingPhase>();
1192 } 1207 }
1193 1208
1194 // Generate final machine code. 1209 // Generate final machine code.
1195 Run<GenerateCodePhase>(&linkage); 1210 Run<GenerateCodePhase>(&linkage);
1196 1211
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 tcf << AsC1VRegisterAllocationData("CodeGen", 1321 tcf << AsC1VRegisterAllocationData("CodeGen",
1307 data->register_allocation_data()); 1322 data->register_allocation_data());
1308 } 1323 }
1309 1324
1310 data->DeleteRegisterAllocationZone(); 1325 data->DeleteRegisterAllocationZone();
1311 } 1326 }
1312 1327
1313 } // namespace compiler 1328 } // namespace compiler
1314 } // namespace internal 1329 } // namespace internal
1315 } // namespace v8 1330 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/instruction.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698