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

Unified Diff: src/compiler/js-inlining-heuristic.h

Issue 1406543002: [turbofan] First rudimentary inlining heuristic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compilation on 64-bit architectures. Created 5 years, 2 months 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
« no previous file with comments | « no previous file | src/compiler/js-inlining-heuristic.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | src/compiler/js-inlining-heuristic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698