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

Unified Diff: src/frames.cc

Issue 2629113004: Revert of [runtime] Change JavaScriptFrame::GetFunctions interface. (Closed)
Patch Set: Created 3 years, 11 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/runtime-profiler.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 c4bb4c789be8941cab24720d2ab888e9c68728e3..755882ae8389f05806a06e1cfb2e6df2b745b962 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -926,7 +926,7 @@
bool JavaScriptFrame::HasInlinedFrames() const {
- List<SharedFunctionInfo*> functions(1);
+ List<JSFunction*> functions(1);
GetFunctions(&functions);
return functions.length() > 1;
}
@@ -959,9 +959,10 @@
return fp() + StandardFrameConstants::kCallerSPOffset;
}
-void JavaScriptFrame::GetFunctions(List<SharedFunctionInfo*>* functions) const {
+
+void JavaScriptFrame::GetFunctions(List<JSFunction*>* functions) const {
DCHECK(functions->length() == 0);
- functions->Add(function()->shared());
+ functions->Add(function());
}
void JavaScriptFrame::Summarize(List<FrameSummary>* functions,
@@ -1339,7 +1340,7 @@
}
}
-void OptimizedFrame::GetFunctions(List<SharedFunctionInfo*>* functions) const {
+void OptimizedFrame::GetFunctions(List<JSFunction*>* functions) const {
DCHECK(functions->length() == 0);
DCHECK(is_optimized());
@@ -1369,20 +1370,25 @@
// in the deoptimization translation are ordered bottom-to-top.
while (jsframe_count != 0) {
opcode = static_cast<Translation::Opcode>(it.Next());
+ // Skip over operands to advance to the next opcode.
+ it.Skip(Translation::NumberOfOperandsFor(opcode));
if (opcode == Translation::JS_FRAME ||
opcode == Translation::INTERPRETED_FRAME) {
- it.Next(); // Skip bailout id.
jsframe_count--;
- // The second operand of the frame points to the function.
- Object* shared = literal_array->get(it.Next());
- functions->Add(SharedFunctionInfo::cast(shared));
-
- // Skip over remaining operands to advance to the next opcode.
- it.Skip(Translation::NumberOfOperandsFor(opcode) - 2);
- } else {
- // Skip over operands to advance to the next opcode.
- it.Skip(Translation::NumberOfOperandsFor(opcode));
+ // The translation commands are ordered and the function is always at the
+ // first position.
+ opcode = static_cast<Translation::Opcode>(it.Next());
+
+ // Get the correct function in the optimized frame.
+ Object* function;
+ if (opcode == Translation::LITERAL) {
+ function = literal_array->get(it.Next());
+ } else {
+ CHECK_EQ(Translation::STACK_SLOT, opcode);
+ function = StackSlotAt(it.Next());
+ }
+ functions->Add(JSFunction::cast(function));
}
}
}
« no previous file with comments | « src/frames.h ('k') | src/runtime-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698