[tracing] Add column num to ICStats
For minified files especially, the line number alone isn't enough to identify an IC site. Change-Id: I93f54f8fca1002072af0d702c155768fa2a8dbcb Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1800566 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Peter Marshall <petermarshall@chromium.org> Commit-Queue: Peter Marshall <petermarshall@chromium.org> Auto-Submit: Leszek Swirski <leszeks@chromium.org> Cr-Commit-Position: refs/heads/master@{#63745}
This commit is contained in:
parent
7b7df7db4d
commit
48ef2a22aa
@ -1263,6 +1263,7 @@ void JavaScriptFrame::CollectFunctionAndOffsetForICStats(JSFunction function,
|
||||
if (maybe_script.IsScript()) {
|
||||
Script script = Script::cast(maybe_script);
|
||||
ic_info.line_num = script.GetLineNumber(source_pos) + 1;
|
||||
ic_info.column_num = script.GetColumnNumber(source_pos);
|
||||
ic_info.script_name = ic_stats->GetOrCacheScriptName(script);
|
||||
}
|
||||
}
|
||||
|
@ -94,6 +94,7 @@ ICInfo::ICInfo()
|
||||
script_offset(0),
|
||||
script_name(nullptr),
|
||||
line_num(-1),
|
||||
column_num(-1),
|
||||
is_constructor(false),
|
||||
is_optimized(false),
|
||||
map(nullptr),
|
||||
@ -106,6 +107,7 @@ void ICInfo::Reset() {
|
||||
script_offset = 0;
|
||||
script_name = nullptr;
|
||||
line_num = -1;
|
||||
column_num = -1;
|
||||
is_constructor = false;
|
||||
is_optimized = false;
|
||||
state.clear();
|
||||
@ -127,6 +129,7 @@ void ICInfo::AppendToTracedValue(v8::tracing::TracedValue* value) const {
|
||||
if (script_offset) value->SetInteger("offset", script_offset);
|
||||
if (script_name) value->SetString("scriptName", script_name);
|
||||
if (line_num != -1) value->SetInteger("lineNum", line_num);
|
||||
if (column_num != -1) value->SetInteger("columnNum", column_num);
|
||||
if (is_constructor) value->SetInteger("constructor", is_constructor);
|
||||
if (!state.empty()) value->SetString("state", state);
|
||||
if (map) {
|
||||
|
@ -34,6 +34,7 @@ struct ICInfo {
|
||||
int script_offset;
|
||||
const char* script_name;
|
||||
int line_num;
|
||||
int column_num;
|
||||
bool is_constructor;
|
||||
bool is_optimized;
|
||||
std::string state;
|
||||
|
Loading…
Reference in New Issue
Block a user