Commit 8e02d4fd authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[frames] Remove obsolete {FrameSummary::Mode} support.

R=jarin@chromium.org
BUG=v8:6409

Change-Id: Ia0a04ad920b7b5c87e175ba0bcd604ef1e855f0c
Reviewed-on: https://chromium-review.googlesource.com/649727Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47842}
parent 4dd0d712
......@@ -743,8 +743,7 @@ void StandardFrame::ComputeCallerState(State* state) const {
bool StandardFrame::IsConstructor() const { return false; }
void StandardFrame::Summarize(std::vector<FrameSummary>* functions,
FrameSummary::Mode mode) const {
void StandardFrame::Summarize(std::vector<FrameSummary>* functions) const {
// This should only be called on frames which override this method.
UNREACHABLE();
}
......@@ -968,15 +967,14 @@ void JavaScriptFrame::GetFunctions(
}
}
void JavaScriptFrame::Summarize(std::vector<FrameSummary>* functions,
FrameSummary::Mode mode) const {
void JavaScriptFrame::Summarize(std::vector<FrameSummary>* functions) const {
DCHECK(functions->empty());
Code* code = LookupCode();
int offset = static_cast<int>(pc() - code->instruction_start());
AbstractCode* abstract_code = AbstractCode::cast(code);
FrameSummary::JavaScriptFrameSummary summary(isolate(), receiver(),
function(), abstract_code,
offset, IsConstructor(), mode);
offset, IsConstructor());
functions->push_back(summary);
}
......@@ -1141,8 +1139,7 @@ bool IsNonDeoptimizingAsmCode(Code* code, JSFunction* function) {
FrameSummary::JavaScriptFrameSummary::JavaScriptFrameSummary(
Isolate* isolate, Object* receiver, JSFunction* function,
AbstractCode* abstract_code, int code_offset, bool is_constructor,
Mode mode)
AbstractCode* abstract_code, int code_offset, bool is_constructor)
: FrameSummaryBase(isolate, JAVA_SCRIPT),
receiver_(receiver, isolate),
function_(function, isolate),
......@@ -1151,8 +1148,7 @@ FrameSummary::JavaScriptFrameSummary::JavaScriptFrameSummary(
is_constructor_(is_constructor) {
DCHECK(abstract_code->IsBytecodeArray() ||
Code::cast(abstract_code)->kind() != Code::OPTIMIZED_FUNCTION ||
IsNonDeoptimizingAsmCode(Code::cast(abstract_code), function) ||
mode == kApproximateSummary);
IsNonDeoptimizingAsmCode(Code::cast(abstract_code), function));
}
bool FrameSummary::JavaScriptFrameSummary::is_subject_to_debugging() const {
......@@ -1323,8 +1319,7 @@ FRAME_SUMMARY_DISPATCH(Handle<Context>, native_context)
#undef FRAME_SUMMARY_DISPATCH
void OptimizedFrame::Summarize(std::vector<FrameSummary>* frames,
FrameSummary::Mode mode) const {
void OptimizedFrame::Summarize(std::vector<FrameSummary>* frames) const {
DCHECK(frames->empty());
DCHECK(is_optimized());
......@@ -1340,9 +1335,6 @@ void OptimizedFrame::Summarize(std::vector<FrameSummary>* frames,
DeoptimizationInputData* const data = GetDeoptimizationData(&deopt_index);
if (deopt_index == Safepoint::kNoDeoptimizationIndex) {
CHECK_NULL(data);
if (mode == FrameSummary::kApproximateSummary) {
return JavaScriptFrame::Summarize(frames, mode);
}
FATAL("Missing deoptimization information for OptimizedFrame::Summarize.");
}
......@@ -1601,8 +1593,7 @@ void InterpretedFrame::WriteInterpreterRegister(int register_index,
return SetExpression(index + register_index, value);
}
void InterpretedFrame::Summarize(std::vector<FrameSummary>* functions,
FrameSummary::Mode mode) const {
void InterpretedFrame::Summarize(std::vector<FrameSummary>* functions) const {
DCHECK(functions->empty());
AbstractCode* abstract_code =
AbstractCode::cast(function()->shared()->bytecode_array());
......@@ -1700,8 +1691,7 @@ int WasmCompiledFrame::position() const {
return FrameSummary::GetSingle(this).SourcePosition();
}
void WasmCompiledFrame::Summarize(std::vector<FrameSummary>* functions,
FrameSummary::Mode mode) const {
void WasmCompiledFrame::Summarize(std::vector<FrameSummary>* functions) const {
DCHECK(functions->empty());
Handle<Code> code(LookupCode(), isolate());
int offset = static_cast<int>(pc() - code->instruction_start());
......@@ -1747,8 +1737,8 @@ void WasmInterpreterEntryFrame::Print(StringStream* accumulator, PrintMode mode,
if (mode != OVERVIEW) accumulator->Add("\n");
}
void WasmInterpreterEntryFrame::Summarize(std::vector<FrameSummary>* functions,
FrameSummary::Mode mode) const {
void WasmInterpreterEntryFrame::Summarize(
std::vector<FrameSummary>* functions) const {
Handle<WasmInstanceObject> instance(wasm_instance(), isolate());
std::vector<std::pair<uint32_t, int>> interpreted_stack =
instance->debug_info()->GetInterpretedStack(fp());
......
......@@ -453,13 +453,6 @@ class StandardFrame;
class FrameSummary BASE_EMBEDDED {
public:
// Mode for JavaScriptFrame::Summarize. Exact summary is required to produce
// an exact stack trace. It will trigger an assertion failure if that is not
// possible, e.g., because of missing deoptimization information. The
// approximate mode should produce a summary even without deoptimization
// information, but it might miss frames.
enum Mode { kExactSummary, kApproximateSummary };
// Subclasses for the different summary kinds:
#define FRAME_SUMMARY_VARIANTS(F) \
F(JAVA_SCRIPT, JavaScriptFrameSummary, java_script_summary_, JavaScript) \
......@@ -488,8 +481,7 @@ class FrameSummary BASE_EMBEDDED {
public:
JavaScriptFrameSummary(Isolate* isolate, Object* receiver,
JSFunction* function, AbstractCode* abstract_code,
int code_offset, bool is_constructor,
Mode mode = kExactSummary);
int code_offset, bool is_constructor);
Handle<Object> receiver() const { return receiver_; }
Handle<JSFunction> function() const { return function_; }
......@@ -635,9 +627,7 @@ class StandardFrame : public StackFrame {
// Build a list with summaries for this frame including all inlined frames.
// The functions are ordered bottom-to-top (i.e. summaries.last() is the
// top-most activation; caller comes before callee).
virtual void Summarize(
std::vector<FrameSummary>* frames,
FrameSummary::Mode mode = FrameSummary::kExactSummary) const;
virtual void Summarize(std::vector<FrameSummary>* frames) const;
static StandardFrame* cast(StackFrame* frame) {
DCHECK(frame->is_standard());
......@@ -688,9 +678,7 @@ class JavaScriptFrame : public StandardFrame {
public:
Type type() const override { return JAVA_SCRIPT; }
void Summarize(
std::vector<FrameSummary>* frames,
FrameSummary::Mode mode = FrameSummary::kExactSummary) const override;
void Summarize(std::vector<FrameSummary>* frames) const override;
// Accessors.
virtual JSFunction* function() const;
......@@ -829,9 +817,7 @@ class OptimizedFrame : public JavaScriptFrame {
// is the top-most activation)
void GetFunctions(std::vector<SharedFunctionInfo*>* functions) const override;
void Summarize(
std::vector<FrameSummary>* frames,
FrameSummary::Mode mode = FrameSummary::kExactSummary) const override;
void Summarize(std::vector<FrameSummary>* frames) const override;
// Lookup exception handler for current {pc}, returns -1 if none found.
int LookupExceptionHandlerInTable(
......@@ -883,9 +869,7 @@ class InterpretedFrame : public JavaScriptFrame {
void WriteInterpreterRegister(int register_index, Object* value);
// Build a list with summaries for this frame including all inlined frames.
void Summarize(
std::vector<FrameSummary>* frames,
FrameSummary::Mode mode = FrameSummary::kExactSummary) const override;
void Summarize(std::vector<FrameSummary>* frames) const override;
static int GetBytecodeOffset(Address fp);
......@@ -975,8 +959,7 @@ class WasmCompiledFrame final : public StandardFrame {
int position() const override;
bool at_to_number_conversion() const;
void Summarize(std::vector<FrameSummary>* frames,
FrameSummary::Mode mode) const override;
void Summarize(std::vector<FrameSummary>* frames) const override;
static WasmCompiledFrame* cast(StackFrame* frame) {
DCHECK(frame->is_wasm_compiled());
......@@ -1003,9 +986,7 @@ class WasmInterpreterEntryFrame final : public StandardFrame {
void Print(StringStream* accumulator, PrintMode mode,
int index) const override;
void Summarize(
std::vector<FrameSummary>* frames,
FrameSummary::Mode mode = FrameSummary::kExactSummary) const override;
void Summarize(std::vector<FrameSummary>* frames) const override;
// Determine the code for the frame.
Code* unchecked_code() const override;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment