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

Unified Diff: src/log.cc

Issue 2603333002: [profiler] Log both code and bytecode in heap SFI traversal (Closed)
Patch Set: Created 3 years, 12 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/log.cc
diff --git a/src/log.cc b/src/log.cc
index e303773310ad4239816ff20bb2baa215bb807f13..e73d7facb80c0f3e75385f52e78ca65501e455f2 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -1377,14 +1377,30 @@ static int EnumerateCompiledFunctions(Heap* heap,
if (sfi->is_compiled()
&& (!sfi->script()->IsScript()
|| Script::cast(sfi->script())->HasValidSource())) {
- if (sfis != NULL) {
- sfis[compiled_funcs_count] = Handle<SharedFunctionInfo>(sfi);
+ // In some cases, an SFI might have (and have executing!) both bytecode
+ // and baseline code, so check for both and add them both if needed.
+
rmcilroy 2017/01/03 12:05:30 nit - drop the newline
Leszek Swirski 2017/01/03 12:22:45 Done.
+ if (sfi->HasBytecodeArray()) {
+ if (sfis != NULL) {
+ sfis[compiled_funcs_count] = Handle<SharedFunctionInfo>(sfi);
+ }
+ if (code_objects != NULL) {
+ code_objects[compiled_funcs_count] =
+ Handle<AbstractCode>(AbstractCode::cast(sfi->bytecode_array()));
+ }
+ ++compiled_funcs_count;
}
- if (code_objects != NULL) {
- code_objects[compiled_funcs_count] =
- Handle<AbstractCode>(sfi->abstract_code());
+
+ if (!sfi->IsInterpreted()) {
rmcilroy 2017/01/03 12:05:30 This should be HasBaselineCode instead
Leszek Swirski 2017/01/03 12:22:45 This would change previous behaviour, which also i
+ if (sfis != NULL) {
+ sfis[compiled_funcs_count] = Handle<SharedFunctionInfo>(sfi);
+ }
+ if (code_objects != NULL) {
+ code_objects[compiled_funcs_count] =
+ Handle<AbstractCode>(AbstractCode::cast(sfi->code()));
+ }
+ ++compiled_funcs_count;
rmcilroy 2017/01/03 12:05:30 nit - could you pull the duplicate code out into a
Leszek Swirski 2017/01/03 12:22:45 Done.
}
- ++compiled_funcs_count;
}
}
« 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