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; |
} |
} |