"Wrong address or value passed to RecordWrite") \
V(kShouldNotDirectlyEnterOsrFunction, \
"Should not directly enter OSR-compiled function") \
- V(kOsrCompileFailed, "OSR compilation failed") \
V(kYield, "Yield")
return AbortOptimization(kHydrogenFilter);
}
- // Crankshaft requires a version of fullcode with deoptimization support.
+ // Optimization requires a version of fullcode with deoptimization support.
// Recompile the unoptimized version of the code if the current version
// doesn't have deoptimization support already.
// Otherwise, if we are gathering compilation time and space statistics
DCHECK(info()->shared_info()->has_deoptimization_support());
- // Check the whitelist for TurboFan.
- if ((FLAG_turbo_asm && info()->shared_info()->asm_function()) ||
- info()->closure()->PassesFilter(FLAG_turbo_filter)) {
+ // Check the enabling conditions for TurboFan.
+ if (((FLAG_turbo_asm && info()->shared_info()->asm_function()) ||
+ info()->closure()->PassesFilter(FLAG_turbo_filter)) &&
+ (FLAG_turbo_osr || !info()->is_osr())) {
if (FLAG_trace_opt) {
OFStream os(stdout);
os << "[compiling method " << Brief(*info()->closure())
}
-bool OsrHelper::Deconstruct(JSGraph* jsgraph, CommonOperatorBuilder* common,
+void OsrHelper::Deconstruct(JSGraph* jsgraph, CommonOperatorBuilder* common,
Zone* tmp_zone) {
Graph* graph = jsgraph->graph();
Node* osr_normal_entry = nullptr;
if (osr_loop_entry == nullptr) {
// No OSR entry found, do nothing.
CHECK(osr_normal_entry);
- return true;
+ return;
}
for (Node* use : osr_loop_entry->uses()) {
// Run the normal control reduction, which naturally trims away the dead
// parts of the graph.
ControlReducer::ReduceGraph(tmp_zone, jsgraph, common);
-
- return true;
}
// Deconstructs the artificial {OsrNormalEntry} and rewrites the graph so
// that only the path corresponding to {OsrLoopEntry} remains.
- // Return {false} if the OSR deconstruction failed somehow.
- bool Deconstruct(JSGraph* jsgraph, CommonOperatorBuilder* common,
+ void Deconstruct(JSGraph* jsgraph, CommonOperatorBuilder* common,
Zone* tmp_zone);
// Prepares the frame w.r.t. OSR.
SourcePositionTable::Scope pos(data->source_positions(),
SourcePosition::Unknown());
OsrHelper osr_helper(data->info());
- bool success =
- osr_helper.Deconstruct(data->jsgraph(), data->common(), temp_zone);
- if (!success) data->info()->RetryOptimization(kOsrCompileFailed);
+ osr_helper.Deconstruct(data->jsgraph(), data->common(), temp_zone);
}
};
Handle<Code> Pipeline::GenerateCode() {
- if (info()->is_osr() && !FLAG_turbo_osr) {
- // TODO(turbofan): remove this flag and always handle OSR
- info()->RetryOptimization(kOsrCompileFailed);
- return Handle<Code>::null();
- }
-
// TODO(mstarzinger): This is just a temporary hack to make TurboFan work,
// the correct solution is to restore the context register after invoking
// builtins from full-codegen.
if (info()->is_osr()) {
Run<OsrDeconstructionPhase>();
- if (info()->bailout_reason() != kNoReason) return Handle<Code>::null();
RunPrintAndVerify("OSR deconstruction");
}