| Index: src/compiler/js-inlining-heuristic.h
|
| diff --git a/src/compiler/js-inlining-heuristic.h b/src/compiler/js-inlining-heuristic.h
|
| index 9499e1f8c756b5b6c5b29637ae67713c3c9e1978..aa7ab811f53d16516d097d3bfbcc444550a01b1c 100644
|
| --- a/src/compiler/js-inlining-heuristic.h
|
| +++ b/src/compiler/js-inlining-heuristic.h
|
| @@ -13,18 +13,37 @@ namespace compiler {
|
|
|
| class JSInliningHeuristic final : public AdvancedReducer {
|
| public:
|
| - enum Mode { kRestrictedInlining, kGeneralInlining };
|
| + enum Mode { kGeneralInlining, kRestrictedInlining, kStressInlining };
|
| JSInliningHeuristic(Editor* editor, Mode mode, Zone* local_zone,
|
| CompilationInfo* info, JSGraph* jsgraph)
|
| : AdvancedReducer(editor),
|
| mode_(mode),
|
| - inliner_(editor, local_zone, info, jsgraph) {}
|
| + local_zone_(local_zone),
|
| + jsgraph_(jsgraph),
|
| + inliner_(editor, local_zone, info, jsgraph),
|
| + candidates_(local_zone) {}
|
|
|
| Reduction Reduce(Node* node) final;
|
|
|
| + // Processes the list of candidates gathered while the reducer was running,
|
| + // and inlines call sites that the heuristic determines to be important.
|
| + void ProcessCandidates();
|
| +
|
| private:
|
| + struct Candidate {
|
| + Handle<JSFunction> function; // The call target being inlined.
|
| + Node* node; // The call site at which to inline.
|
| + int calls; // Number of times the call site was hit.
|
| + };
|
| +
|
| + static bool Compare(const Candidate& left, const Candidate& right);
|
| + void PrintCandidates();
|
| +
|
| Mode const mode_;
|
| + Zone* local_zone_;
|
| + JSGraph* jsgraph_;
|
| JSInliner inliner_;
|
| + ZoneVector<Candidate> candidates_;
|
| };
|
|
|
| } // namespace compiler
|
|
|