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

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: rebase, fix off by one in deopt stub generation 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
« no previous file with comments | « 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 8b0ee04015e503d2458b2d89f36204516c107c81..c6e2e1ba827ffca86ce96b63a6f5d77229a3ed0a 100644
--- a/runtime/vm/scopes.cc
+++ b/runtime/vm/scopes.cc
@@ -540,19 +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_parameter_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_parameter_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) +
+ // non-positive).
+ return fixed_parameter_count -
(index() - ParsedFunction::kFirstLocalSlotIndex);
}
}
« no previous file with comments | « runtime/vm/locations.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698