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

Unified Diff: src/frames.cc

Issue 1261923007: [turbofan] Unify referencing of stack slots (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Final tweaks Created 5 years, 4 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
Index: src/frames.cc
diff --git a/src/frames.cc b/src/frames.cc
index c4a93c87e5089f571671e4fa86c57e7ad40f1ece..98a257000a607e11f8928309c99224af617b6407 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -1081,18 +1081,14 @@ void OptimizedFrame::GetFunctions(List<JSFunction*>* functions) {
}
+int OptimizedFrame::StackSlotOffsetRelativeToFp(int slot_index) {
+ return StandardFrameConstants::kCallerSPOffset -
+ ((slot_index + 1) * kPointerSize);
+}
+
+
Object* OptimizedFrame::StackSlotAt(int index) const {
- // Positive index means the value is spilled to the locals
- // area. Negative means it is stored in the incoming parameter
- // area.
- if (index >= 0) return GetExpression(index);
-
- // Index -1 overlaps with last parameter, -n with the first parameter,
- // (-n - 1) with the receiver with n being the number of parameters
- // of the outermost, optimized frame.
- int const parameter_count = ComputeParametersCount();
- int const parameter_index = index + parameter_count;
- return (parameter_index == -1) ? receiver() : GetParameter(parameter_index);
+ return Memory::Object_at(fp() + StackSlotOffsetRelativeToFp(index));
}

Powered by Google App Engine
This is Rietveld 408576698