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

Unified Diff: runtime/vm/locations.cc

Issue 26823006: Record a correct deoptimization environment for slow-path code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use an environment value's representation to decide its size. Created 7 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
« runtime/vm/locations.h ('K') | « runtime/vm/locations.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/locations.cc
diff --git a/runtime/vm/locations.cc b/runtime/vm/locations.cc
index fb19c1f2d45430d697abed284276ab195f6c1d96..265b198ff776454f23f39b9eea3c17dfe748f7db 100644
--- a/runtime/vm/locations.cc
+++ b/runtime/vm/locations.cc
@@ -12,6 +12,17 @@
namespace dart {
+intptr_t RegisterSet::RegisterCount(intptr_t registers) {
+ // Brian Kernighan's algorithm for counting the bits set.
+ intptr_t count = 0;
+ while (registers != 0) {
+ ++count;
+ registers &= (registers - 1); // Clear the least significant bit set.
+ }
+ return count;
+}
+
+
LocationSummary::LocationSummary(intptr_t input_count,
intptr_t temp_count,
LocationSummary::ContainsCall contains_call)
« runtime/vm/locations.h ('K') | « runtime/vm/locations.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698