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

Unified Diff: src/profiler/sampling-heap-profiler.cc

Issue 1826953003: Make sampling heap profiler work for short living scripts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profiler/sampling-heap-profiler.cc
diff --git a/src/profiler/sampling-heap-profiler.cc b/src/profiler/sampling-heap-profiler.cc
index b38643cf1a3a67e1516146219fd4ef86a9c12ae4..b2bba7010bfde256aa3990d2753272f5c81c9a97 100644
--- a/src/profiler/sampling-heap-profiler.cc
+++ b/src/profiler/sampling-heap-profiler.cc
@@ -204,15 +204,17 @@ v8::AllocationProfile::Node* SamplingHeapProfiler::TranslateAllocationNode(
// Cannot use std::map<T>::at because it is not available on android.
auto non_const_scripts = const_cast<std::map<int, Script*>&>(scripts);
Script* script = non_const_scripts[node->script_id_];
- if (script->name()->IsName()) {
- Name* name = Name::cast(script->name());
- script_name = ToApiHandle<v8::String>(
- isolate_->factory()->InternalizeUtf8String(names_->GetName(name)));
+ if (script) {
+ if (script->name()->IsName()) {
+ Name* name = Name::cast(script->name());
Michael Achenbach 2016/03/24 09:18:25 Experimental code-coverage reports this block as n
+ script_name = ToApiHandle<v8::String>(
+ isolate_->factory()->InternalizeUtf8String(names_->GetName(name)));
+ }
+ Handle<Script> script_handle(script);
+ line = 1 + Script::GetLineNumber(script_handle, node->script_position_);
+ column =
+ 1 + Script::GetColumnNumber(script_handle, node->script_position_);
}
- Handle<Script> script_handle(script);
-
- line = 1 + Script::GetLineNumber(script_handle, node->script_position_);
- column = 1 + Script::GetColumnNumber(script_handle, node->script_position_);
for (auto alloc : node->allocations_) {
allocations.push_back(ScaleSample(alloc.first, alloc.second));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698