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

Unified Diff: runtime/vm/profiler.cc

Issue 395233002: Move some isolate state setup from C++ code to JumpToExceptionHandler stub (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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 | « runtime/vm/exceptions.cc ('k') | runtime/vm/simulator_arm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler.cc
diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc
index c4fe878ba9d7d2216b055b5fa0006118bbe603cf..8bc24207c6e74a97eb79ae10217f43249d8beed8 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -1869,6 +1869,12 @@ void Profiler::RecordSampleInterruptCallback(
if (sample_buffer == NULL) {
return;
}
+ if (StubCode::InJumpToExceptionHandlerStub(state.pc)) {
+ // The JumpToExceptionHandler stub manually adjusts the stack pointer,
+ // frame pointer, and some isolate state before jumping to a catch entry.
+ // It is not safe to walk the stack when executing this stub.
+ return;
+ }
siva 2014/07/16 17:54:09 Maybe move this bail out further up.
Sample* sample = sample_buffer->ReserveSample();
sample->Init(isolate, OS::GetCurrentTimeMicros(), state.tid);
sample->set_vm_tag(isolate->vm_tag());
@@ -1890,8 +1896,9 @@ void Profiler::RecordSampleInterruptCallback(
stackWalker.walk(isolate->heap());
} else {
if ((isolate->stub_code() != NULL) &&
- (isolate->top_exit_frame_info() != 0)) {
- // Collect only Dart frames.
+ (isolate->top_exit_frame_info() != 0) &&
+ (isolate->vm_tag() != VMTag::kScriptTagId)) {
+ // We have a valid exit frame info, use the Dart stack walker.
ProfilerDartStackWalker stackWalker(isolate, sample);
stackWalker.walk();
} else {
« no previous file with comments | « runtime/vm/exceptions.cc ('k') | runtime/vm/simulator_arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698