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

Unified Diff: src/compiler/pipeline.cc

Issue 809333002: [turbofan] Implement OSR for outer loops. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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/pipeline.cc
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc
index 4ca289c112d056bd0a7154a288f890ab56241cd2..c40a5e327996e33a80d671991da7ccc833a1c879 100644
--- a/src/compiler/pipeline.cc
+++ b/src/compiler/pipeline.cc
@@ -27,6 +27,7 @@
#include "src/compiler/load-elimination.h"
#include "src/compiler/machine-operator-reducer.h"
#include "src/compiler/move-optimizer.h"
+#include "src/compiler/osr.h"
#include "src/compiler/pipeline-statistics.h"
#include "src/compiler/register-allocator.h"
#include "src/compiler/register-allocator-verifier.h"
@@ -410,6 +411,19 @@ struct TyperPhase {
};
+struct OsrDeconstructionPhase {
+ static const char* phase_name() { return "OSR deconstruction"; }
+
+ void Run(PipelineData* data, Zone* temp_zone) {
+ SourcePositionTable::Scope pos(data->source_positions(),
+ SourcePosition::Unknown());
+ OsrHelper osr_helper(data->info());
+ osr_helper.Deconstruct(data->graph(), data->common(), temp_zone);
+ ControlReducer::ReduceGraph(temp_zone, data->jsgraph(), data->common());
+ }
+};
+
+
struct TypedLoweringPhase {
static const char* phase_name() { return "typed lowering"; }
@@ -748,8 +762,8 @@ Handle<Code> Pipeline::GenerateCode() {
info()->function()->dont_optimize_reason() == kSuperReference ||
// TODO(turbofan): Make class literals work and remove this bailout.
info()->function()->dont_optimize_reason() == kClassLiteral ||
- // TODO(turbofan): Make OSR work and remove this bailout.
- info()->is_osr()) {
+ // TODO(turbofan): Make OSR work with inner loops and remove this bailout.
+ (info()->is_osr() && !FLAG_turbo_osr)) {
return Handle<Code>::null();
}
@@ -821,6 +835,11 @@ Handle<Code> Pipeline::GenerateCode() {
Run<TypedLoweringPhase>();
RunPrintAndVerify("Lowered typed");
+ if (info()->is_osr()) {
+ Run<OsrDeconstructionPhase>();
+ RunPrintAndVerify("OSR deconstruction");
+ }
+
// Lower simplified operators and insert changes.
Run<SimplifiedLoweringPhase>();
RunPrintAndVerify("Lowered simplified");
@@ -832,6 +851,11 @@ Handle<Code> Pipeline::GenerateCode() {
Run<LateControlReductionPhase>();
RunPrintAndVerify("Late Control reduced");
+ } else {
+ if (info()->is_osr()) {
+ Run<OsrDeconstructionPhase>();
+ RunPrintAndVerify("OSR deconstruction");
+ }
}
// Lower any remaining generic JSOperators.
@@ -1019,6 +1043,10 @@ void Pipeline::AllocateRegisters(const RegisterConfiguration* config,
ZonePool::Scope zone_scope(data->zone_pool());
data->InitializeRegisterAllocator(zone_scope.zone(), config,
debug_name.get());
+ if (info()->is_osr()) {
+ OsrHelper osr_helper(info());
+ osr_helper.SetupFrame(data->frame());
+ }
Run<MeetRegisterConstraintsPhase>();
Run<ResolvePhisPhase>();

Powered by Google App Engine
This is Rietveld 408576698