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

Unified Diff: runtime/vm/block_scheduler.cc

Issue 311993007: VM: Reduce the number of edge counters in generated code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/block_scheduler.cc
===================================================================
--- runtime/vm/block_scheduler.cc (revision 37078)
+++ runtime/vm/block_scheduler.cc (working copy)
@@ -37,7 +37,13 @@
intptr_t entry_count) {
TargetEntryInstr* target = successor->AsTargetEntry();
if (target != NULL) {
- intptr_t count = ComputeEdgeCount(unoptimized_code, target->deopt_id());
+ // If this block ends in a goto, the edge count of this edge is the same
+ // as the count on the single outgoing edge. This is true as long as the
+ // block does not throw an exception.
+ GotoInstr* jump = target->last_instruction()->AsGoto();
+ const intptr_t deopt_id =
+ (jump != NULL) ? jump->deopt_id() : target->deopt_id();
+ intptr_t count = ComputeEdgeCount(unoptimized_code, deopt_id);
if ((count >= 0) && (entry_count != 0)) {
double weight =
static_cast<double>(count) / static_cast<double>(entry_count);
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698