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

Unified Diff: src/ast.cc

Issue 16128004: Reorder switch clauses using newly-introduced execution counters in (Closed) Base URL: gh:v8/v8.git@master
Patch Set: tweak heuristic Created 7 years, 7 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 | « src/ast.h ('k') | src/hydrogen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index e27feec1a63dbed8f1882d347144ff867664a859..e313779e13762ef703385816e823dbbf2fcae8d7 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -516,6 +516,8 @@ void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
} else {
ASSERT(compare_type_ == NONE);
}
+
+ hit_count_ = oracle->SwitchHitCount(this);
}
@@ -1074,7 +1076,9 @@ CaseClause::CaseClause(Isolate* isolate,
statements_(statements),
position_(pos),
compare_type_(NONE),
+ hit_count_(0),
compare_id_(AstNode::GetNextId(isolate)),
+ counter_id_(AstNode::GetNextId(isolate)),
entry_id_(AstNode::GetNextId(isolate)) {
}
« no previous file with comments | « src/ast.h ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698