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

Unified Diff: runtime/vm/profiler.cc

Issue 1192103004: VM: New calling convention for generated code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fixed comments Created 5 years, 3 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/object.cc ('k') | runtime/vm/raw_object.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 c470b6a6b6b4743087c713b70376a35596d95853..98fd63d0ca8ffbab2d7f6f70acd747793a342e9a 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -759,35 +759,8 @@ class ProfilerNativeStackWalker : public ProfilerStackWalker {
};
-static void CopyPCMarkerIfSafe(Sample* sample, uword fp_addr, uword sp_addr) {
- ASSERT(sample != NULL);
-
- if (sample->vm_tag() != VMTag::kDartTagId) {
- // We can only trust the stack pointer if we are executing Dart code.
- // See http://dartbug.com/20421 for details.
- return;
- }
- uword* fp = reinterpret_cast<uword*>(fp_addr);
- uword* sp = reinterpret_cast<uword*>(sp_addr);
-
- // If FP == SP, the pc marker hasn't been pushed.
- if (fp > sp) {
- uword* pc_marker_ptr = fp + kPcMarkerSlotFromFp;
- // MSan/ASan are unaware of frames initialized by generated code.
- MSAN_UNPOISON(pc_marker_ptr, kWordSize);
- ASAN_UNPOISON(pc_marker_ptr, kWordSize);
- sample->set_pc_marker(*pc_marker_ptr);
- }
-}
-
-
static void CopyStackBuffer(Sample* sample, uword sp_addr) {
ASSERT(sample != NULL);
- if (sample->vm_tag() != VMTag::kDartTagId) {
- // We can only trust the stack pointer if we are executing Dart code.
- // See http://dartbug.com/20421 for details.
- return;
- }
uword* sp = reinterpret_cast<uword*>(sp_addr);
uword* buffer = sample->GetStackBuffer();
if (sp != NULL) {
@@ -834,8 +807,11 @@ static void CollectSample(Isolate* isolate,
__try {
#endif
- CopyStackBuffer(sample, sp);
- CopyPCMarkerIfSafe(sample, fp, sp);
+ if (in_dart_code) {
+ // We can only trust the stack pointer if we are executing Dart code.
+ // See http://dartbug.com/20421 for details.
+ CopyStackBuffer(sample, sp);
+ }
if (FLAG_profile_vm) {
// Always walk the native stack collecting both native and Dart frames.
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698