Commit 4a1ab1ca authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Pass deoptimization mode to type feedback specializer.

R=jarin@chromium.org

Review URL: https://codereview.chromium.org/1145143002

Cr-Commit-Position: refs/heads/master@{#28524}
parent 1ec55616
......@@ -173,7 +173,7 @@ Reduction JSTypeFeedbackSpecializer::ReduceJSLoadNamed(Node* node) {
return ReduceJSLoadNamedForGlobalVariable(node);
}
if (!FLAG_turbo_deoptimization) return NoChange();
if (mode() != kDeoptimizationEnabled) return NoChange();
Node* frame_state_before = GetFrameStateBefore(node);
if (frame_state_before == nullptr) return NoChange();
......@@ -245,7 +245,7 @@ Reduction JSTypeFeedbackSpecializer::ReduceJSLoadNamedForGlobalVariable(
return NoChange();
}
if (FLAG_turbo_deoptimization) {
if (mode() == kDeoptimizationEnabled) {
// Handle lookups in the script context.
{
Handle<ScriptContextTable> script_contexts(
......
......@@ -62,10 +62,13 @@ class JSTypeFeedbackTable : public ZoneObject {
// {js_type_feedback} provided to the constructor.
class JSTypeFeedbackSpecializer : public AdvancedReducer {
public:
enum DeoptimizationMode { kDeoptimizationEnabled, kDeoptimizationDisabled };
JSTypeFeedbackSpecializer(Editor* editor, JSGraph* jsgraph,
JSTypeFeedbackTable* js_type_feedback,
TypeFeedbackOracle* oracle,
Handle<GlobalObject> global_object,
DeoptimizationMode mode,
CompilationDependencies* dependencies)
: AdvancedReducer(editor),
jsgraph_(jsgraph),
......@@ -73,8 +76,9 @@ class JSTypeFeedbackSpecializer : public AdvancedReducer {
js_type_feedback_(js_type_feedback),
oracle_(oracle),
global_object_(global_object),
mode_(mode),
dependencies_(dependencies) {
CHECK(js_type_feedback);
CHECK_NOT_NULL(js_type_feedback);
}
Reduction Reduce(Node* node) override;
......@@ -92,12 +96,14 @@ class JSTypeFeedbackSpecializer : public AdvancedReducer {
JSTypeFeedbackTable* js_type_feedback_;
TypeFeedbackOracle* oracle_;
Handle<GlobalObject> global_object_;
DeoptimizationMode const mode_;
CompilationDependencies* dependencies_;
TypeFeedbackOracle* oracle() { return oracle_; }
Graph* graph() { return jsgraph_->graph(); }
JSGraph* jsgraph() { return jsgraph_; }
CommonOperatorBuilder* common() { return jsgraph_->common(); }
DeoptimizationMode mode() const { return mode_; }
SimplifiedOperatorBuilder* simplified() { return &simplified_; }
void BuildMapCheck(Node* receiver, Handle<Map> map, bool smi_check,
......
......@@ -546,7 +546,10 @@ struct JSTypeFeedbackPhase {
// specializing to the global object here.
JSTypeFeedbackSpecializer specializer(
&graph_reducer, data->jsgraph(), data->js_type_feedback(), &oracle,
global_object, data->info()->dependencies());
global_object, data->info()->is_deoptimization_enabled()
? JSTypeFeedbackSpecializer::kDeoptimizationEnabled
: JSTypeFeedbackSpecializer::kDeoptimizationDisabled,
data->info()->dependencies());
AddReducer(data, &graph_reducer, &specializer);
graph_reducer.ReduceGraph();
}
......@@ -1048,9 +1051,7 @@ Handle<Code> Pipeline::GenerateCode() {
RunPrintAndVerify("OSR deconstruction");
}
// TODO(turbofan): Type feedback currently requires deoptimization.
if (info()->is_deoptimization_enabled() &&
info()->is_type_feedback_enabled()) {
if (info()->is_type_feedback_enabled()) {
Run<JSTypeFeedbackPhase>();
RunPrintAndVerify("JSType feedback");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment