[turbofan] Pass deoptimization mode to intrinsic lowering.
R=jarin@chromium.org Review URL: https://codereview.chromium.org/1148033002 Cr-Commit-Position: refs/heads/master@{#28515}
This commit is contained in:
parent
e77c69b5ca
commit
8236bfbae3
@ -16,9 +16,11 @@ namespace v8 {
|
||||
namespace internal {
|
||||
namespace compiler {
|
||||
|
||||
JSIntrinsicLowering::JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph)
|
||||
JSIntrinsicLowering::JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph,
|
||||
DeoptimizationMode mode)
|
||||
: AdvancedReducer(editor),
|
||||
jsgraph_(jsgraph),
|
||||
mode_(mode),
|
||||
simplified_(jsgraph->zone()) {}
|
||||
|
||||
|
||||
@ -103,9 +105,7 @@ Reduction JSIntrinsicLowering::ReduceConstructDouble(Node* node) {
|
||||
|
||||
|
||||
Reduction JSIntrinsicLowering::ReduceDeoptimizeNow(Node* node) {
|
||||
// TODO(jarin): This should not depend on the global flag.
|
||||
if (!FLAG_turbo_deoptimization) return NoChange();
|
||||
|
||||
if (mode() != kDeoptimizationEnabled) return NoChange();
|
||||
Node* frame_state = NodeProperties::GetFrameStateInput(node, 0);
|
||||
DCHECK_EQ(frame_state->opcode(), IrOpcode::kFrameState);
|
||||
|
||||
|
@ -22,7 +22,10 @@ class MachineOperatorBuilder;
|
||||
// Lowers certain JS-level runtime calls.
|
||||
class JSIntrinsicLowering final : public AdvancedReducer {
|
||||
public:
|
||||
JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph);
|
||||
enum DeoptimizationMode { kDeoptimizationEnabled, kDeoptimizationDisabled };
|
||||
|
||||
JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph,
|
||||
DeoptimizationMode mode);
|
||||
~JSIntrinsicLowering() final {}
|
||||
|
||||
Reduction Reduce(Node* node) final;
|
||||
@ -60,9 +63,11 @@ class JSIntrinsicLowering final : public AdvancedReducer {
|
||||
JSGraph* jsgraph() const { return jsgraph_; }
|
||||
CommonOperatorBuilder* common() const;
|
||||
MachineOperatorBuilder* machine() const;
|
||||
DeoptimizationMode mode() const { return mode_; }
|
||||
SimplifiedOperatorBuilder* simplified() { return &simplified_; }
|
||||
|
||||
JSGraph* jsgraph_;
|
||||
JSGraph* const jsgraph_;
|
||||
DeoptimizationMode const mode_;
|
||||
SimplifiedOperatorBuilder simplified_;
|
||||
};
|
||||
|
||||
|
@ -561,7 +561,11 @@ struct TypedLoweringPhase {
|
||||
LoadElimination load_elimination;
|
||||
JSBuiltinReducer builtin_reducer(data->jsgraph());
|
||||
JSTypedLowering typed_lowering(&graph_reducer, data->jsgraph(), temp_zone);
|
||||
JSIntrinsicLowering intrinsic_lowering(&graph_reducer, data->jsgraph());
|
||||
JSIntrinsicLowering intrinsic_lowering(
|
||||
&graph_reducer, data->jsgraph(),
|
||||
data->info()->is_deoptimization_enabled()
|
||||
? JSIntrinsicLowering::kDeoptimizationEnabled
|
||||
: JSIntrinsicLowering::kDeoptimizationDisabled);
|
||||
SimplifiedOperatorReducer simple_reducer(data->jsgraph());
|
||||
CommonOperatorReducer common_reducer(data->jsgraph());
|
||||
AddReducer(data, &graph_reducer, &builtin_reducer);
|
||||
|
@ -35,7 +35,8 @@ class JSIntrinsicLoweringTest : public GraphTest {
|
||||
JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine);
|
||||
// TODO(titzer): mock the GraphReducer here for better unit testing.
|
||||
GraphReducer graph_reducer(graph(), zone());
|
||||
JSIntrinsicLowering reducer(&graph_reducer, &jsgraph);
|
||||
JSIntrinsicLowering reducer(&graph_reducer, &jsgraph,
|
||||
JSIntrinsicLowering::kDeoptimizationEnabled);
|
||||
return reducer.Reduce(node);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user