Index: src/frames.cc |
diff --git a/src/frames.cc b/src/frames.cc |
index 8acc1e6ffe9fce2fbc0cfc27cc375169a6a4aa59..3c9eaa38d2fae06454ee3837132c859c682b37ca 100644 |
--- a/src/frames.cc |
+++ b/src/frames.cc |
@@ -694,12 +694,23 @@ void FrameSummary::Print() { |
} |
+JSFunction* OptimizedFrame::LiteralAt(FixedArray* literal_array, |
+ int literal_id) { |
+ if (literal_id == Translation::kSelfLiteralId) { |
+ return JSFunction::cast(function()); |
+ } |
+ |
+ return JSFunction::cast(literal_array->get(literal_id)); |
+} |
+ |
+ |
void OptimizedFrame::Summarize(List<FrameSummary>* frames) { |
ASSERT(frames->length() == 0); |
ASSERT(is_optimized()); |
int deopt_index = Safepoint::kNoDeoptimizationIndex; |
DeoptimizationInputData* data = GetDeoptimizationData(&deopt_index); |
+ FixedArray* literal_array = data->LiteralArray(); |
// BUG(3243555): Since we don't have a lazy-deopt registered at |
// throw-statements, we can't use the translation at the call-site of |
@@ -729,10 +740,8 @@ void OptimizedFrame::Summarize(List<FrameSummary>* frames) { |
i--; |
int ast_id = it.Next(); |
- int function_id = it.Next(); |
+ JSFunction* function = LiteralAt(literal_array, it.Next()); |
it.Next(); // Skip height. |
- JSFunction* function = |
- JSFunction::cast(data->LiteralArray()->get(function_id)); |
// The translation commands are ordered and the receiver is always |
// at the first position. Since we are always at a call when we need |
@@ -808,6 +817,7 @@ void OptimizedFrame::GetFunctions(List<JSFunction*>* functions) { |
int deopt_index = Safepoint::kNoDeoptimizationIndex; |
DeoptimizationInputData* data = GetDeoptimizationData(&deopt_index); |
+ FixedArray* literal_array = data->LiteralArray(); |
TranslationIterator it(data->TranslationByteArray(), |
data->TranslationIndex(deopt_index)->value()); |
@@ -822,10 +832,8 @@ void OptimizedFrame::GetFunctions(List<JSFunction*>* functions) { |
if (opcode == Translation::FRAME) { |
frame_count--; |
it.Next(); // Skip ast id. |
- int function_id = it.Next(); |
+ JSFunction* function = LiteralAt(literal_array, it.Next()); |
it.Next(); // Skip height. |
- JSFunction* function = |
- JSFunction::cast(data->LiteralArray()->get(function_id)); |
functions->Add(function); |
} else { |
// Skip over operands to advance to the next opcode. |