| Index: runtime/vm/profiler.cc
|
| diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc
|
| index e9ad1ccfa0de04fc67062c904699b5e00d6f3dba..c75f1362008c444430ae74f4c5ec4bf06fd66d88 100644
|
| --- a/runtime/vm/profiler.cc
|
| +++ b/runtime/vm/profiler.cc
|
| @@ -965,11 +965,6 @@ void Profiler::RecordAllocation(Isolate* isolate, intptr_t cid) {
|
|
|
| const bool exited_dart_code = ExitedDart(isolate);
|
|
|
| - if (!exited_dart_code && !FLAG_profile_vm) {
|
| - // No Dart frames on stack and we are not profiling the vm.
|
| - return;
|
| - }
|
| -
|
| SampleBuffer* sample_buffer = GetSampleBuffer(isolate);
|
| if (sample_buffer == NULL) {
|
| // Profiler not initialized.
|
| @@ -1010,14 +1005,22 @@ void Profiler::RecordAllocation(Isolate* isolate, intptr_t cid) {
|
| fp,
|
| sp);
|
| native_stack_walker.walk();
|
| - } else {
|
| - ASSERT(exited_dart_code);
|
| + } else if (exited_dart_code) {
|
| Sample* sample = SetupSample(isolate,
|
| sample_buffer,
|
| OSThread::GetCurrentThreadId());
|
| sample->SetAllocationCid(cid);
|
| ProfilerDartExitStackWalker dart_exit_stack_walker(isolate, sample);
|
| dart_exit_stack_walker.walk();
|
| + } else {
|
| + // Fall back.
|
| + uintptr_t pc = GetProgramCounter();
|
| + Sample* sample = SetupSample(isolate,
|
| + sample_buffer,
|
| + OSThread::GetCurrentThreadId());
|
| + sample->SetAllocationCid(cid);
|
| + sample->set_vm_tag(VMTag::kEmbedderTagId);
|
| + sample->SetAt(0, pc);
|
| }
|
| }
|
|
|
|
|