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

Unified Diff: src/runtime.cc

Issue 544143003: Store frame pointers (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.27
Patch Set: Created 6 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 | « src/mirror-debugger.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 36b3177b7c02c474b058bc3f0f8f2a8c1aa5b4c1..c4b2185d757d10a6156435425b59b14404895599 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -11192,8 +11192,9 @@ static const int kFrameDetailsLocalCountIndex = 4;
static const int kFrameDetailsSourcePositionIndex = 5;
static const int kFrameDetailsConstructCallIndex = 6;
static const int kFrameDetailsAtReturnIndex = 7;
-static const int kFrameDetailsFlagsIndex = 8;
-static const int kFrameDetailsFirstDynamicIndex = 9;
+static const int kFrameDetailsFramePointerIndex = 8;
+static const int kFrameDetailsFlagsIndex = 9;
+static const int kFrameDetailsFirstDynamicIndex = 10;
static SaveContext* FindSavedContextForFrame(Isolate* isolate,
@@ -11220,7 +11221,8 @@ static SaveContext* FindSavedContextForFrame(Isolate* isolate,
// 5: Source position
// 6: Constructor call
// 7: Is at return
-// 8: Flags
+// 8: Frame pointer
+// 9: Flags
// Arguments name, value
// Locals name, value
// Return value if any
@@ -11405,6 +11407,17 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) {
// Add the at return information.
details->set(kFrameDetailsAtReturnIndex, heap->ToBoolean(at_return));
+ // No memory address will actually be larger than 2^48 on a current x64
+ // machine but we truncate to 53 bits to future proof this method. Users
+ // should not care about the exact frame pointer values only the
+ // order of frame pointers. Truncating to 53 bits will still generate the
+ // correct ordering with very high probability.
+ uintptr_t frame_pointer =
+ reinterpret_cast<uintptr_t>(it.frame()->UnpaddedFP()) &
+ ((static_cast<uintptr_t>(1)<<53) - 1);
hausner 2014/09/05 18:08:36 How about building the mask as a const uint64_t va
+ details->set(kFrameDetailsFramePointerIndex,
+ *isolate->factory()->NewNumber(static_cast<double>(frame_pointer)));
+
// Add flags to indicate information on whether this frame is
// bit 0: invoked in the debugger context.
// bit 1: optimized frame.
« no previous file with comments | « src/mirror-debugger.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698