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

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: Review feedback 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
« no previous file with comments | « src/frames.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.cc
diff --git a/src/frames.cc b/src/frames.cc
index 0b2a6b644930220e6ecd531d77560a3be3c24f62..8561e557e86fd78211ec5c1d08f163140841d642 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -1079,18 +1079,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));
}
« no previous file with comments | « src/frames.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698