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

Unified Diff: runtime/vm/scopes.cc

Issue 10828018: Add support for fixed parameters in the register allocator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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/intermediate_language.cc ('K') | « runtime/vm/locations.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scopes.cc
diff --git a/runtime/vm/scopes.cc b/runtime/vm/scopes.cc
index f8af769c6fdfbad25e3fbbdf9f861357e3a0753c..86932ded0565babceab1646b117a4b877a543404 100644
--- a/runtime/vm/scopes.cc
+++ b/runtime/vm/scopes.cc
@@ -540,20 +540,18 @@ bool LocalVariable::Equals(const LocalVariable& other) const {
}
-// Map the frame index into an index in the range 0..(var_count-1).
-int LocalVariable::BitIndexIn(intptr_t var_count) const {
+int LocalVariable::BitIndexIn(intptr_t fixed_param_count) const {
ASSERT(!is_captured());
// Parameters have positive indexes with the lowest index being 2. Locals
// and copied parameters have negative indexes with the lowest (closest to
// zero) index being ParsedFunction::kFirstLocalSlotIndex.
if (index() > 0) {
// Shift non-negative indexes so that the lowest one is 0.
- return index() - 2;
+ return (fixed_param_count - 1) - (index() - 2);
} else {
// Shift negative indexes so that the lowest one is 0 (they are still
// non-positive) and index them backward from the end of the vector.
- return (var_count - 1) +
- (index() - ParsedFunction::kFirstLocalSlotIndex);
+ return fixed_param_count - (index() - ParsedFunction::kFirstLocalSlotIndex);
}
}
« runtime/vm/intermediate_language.cc ('K') | « runtime/vm/locations.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698