}
-int OptimizedFrame::GetInlineCount() {
- DCHECK(is_optimized());
-
- // Delegate to JS frame in absence of turbofan deoptimization.
- // TODO(turbofan): Revisit once we support deoptimization across the board.
- if (LookupCode()->is_turbofanned() && function()->shared()->asm_function() &&
- !FLAG_turbo_asm_deoptimization) {
- return JavaScriptFrame::GetInlineCount();
- }
-
- int deopt_index = Safepoint::kNoDeoptimizationIndex;
- DeoptimizationInputData* data = GetDeoptimizationData(&deopt_index);
-
- TranslationIterator it(data->TranslationByteArray(),
- data->TranslationIndex(deopt_index)->value());
- Translation::Opcode opcode = static_cast<Translation::Opcode>(it.Next());
- DCHECK(opcode == Translation::BEGIN);
- USE(opcode);
- it.Next(); // Drop frame count.
- int jsframe_count = it.Next();
- return jsframe_count;
-}
-
-
void OptimizedFrame::GetFunctions(List<JSFunction*>* functions) {
DCHECK(functions->length() == 0);
DCHECK(is_optimized());
// Determine the code for the frame.
virtual Code* unchecked_code() const;
- // Returns the levels of inlining for this frame.
- virtual int GetInlineCount() { return 1; }
-
// Return a list with JSFunctions of this frame.
virtual void GetFunctions(List<JSFunction*>* functions);
// GC support.
virtual void Iterate(ObjectVisitor* v) const;
- virtual int GetInlineCount();
-
// Return a list with JSFunctions of this frame.
// The functions are ordered bottom-to-top (i.e. functions.last()
// is the top-most activation)
namespace {
-// Helper to determine inline count via JavaScriptFrame::GetInlineCount.
+// Helper to determine inline count via JavaScriptFrame::GetFunctions.
// Note that a count of 1 indicates that no inlining has occured.
void AssertInlineCount(const v8::FunctionCallbackInfo<v8::Value>& args) {
StackTraceFrameIterator it(CcTest::i_isolate());
JavaScriptFrame* topmost = it.frame();
while (!it.done()) {
JavaScriptFrame* frame = it.frame();
+ List<JSFunction*> functions(2);
+ frame->GetFunctions(&functions);
PrintF("%d %s, inline count: %d\n", frames_seen,
frame->function()->shared()->DebugName()->ToCString().get(),
- frame->GetInlineCount());
+ functions.length());
frames_seen++;
it.Advance();
}
- CHECK_EQ(args[0]->ToInt32(args.GetIsolate())->Value(),
- topmost->GetInlineCount());
+ List<JSFunction*> functions(2);
+ topmost->GetFunctions(&functions);
+ CHECK_EQ(args[0]->ToInt32(args.GetIsolate())->Value(), functions.length());
}