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

Unified Diff: src/runtime.cc

Issue 544143003: Store frame pointers (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.27
Patch Set: moved to v8 trunk, added a unittest, and fixed compile warning from mainline v8 build. 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') | test/cctest/test-debug.cc » ('j') | 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 77c7bb99f78771e92432a40921cc0dc8b7bcc7f6..eb1f18de7dad9ad2b08b95475284de2af96cfa38 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -11226,9 +11226,10 @@ 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 kFrameDetailsFramePointerHighIndex = 8;
+static const int kFrameDetailsFramePointerLowIndex = 9;
+static const int kFrameDetailsFlagsIndex = 10;
+static const int kFrameDetailsFirstDynamicIndex = 11;
static SaveContext* FindSavedContextForFrame(Isolate* isolate,
JavaScriptFrame* frame) {
@@ -11271,7 +11272,9 @@ static int FindIndexedNonNativeFrame(JavaScriptFrameIterator* it, int index) {
// 5: Source position
// 6: Constructor call
// 7: Is at return
-// 8: Flags
+// 8: Frame pointer high
+// 9: Frame pointer low
+// 10: Flags
// Arguments name, value
// Locals name, value
// Return value if any
@@ -11448,6 +11451,20 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) {
// Add the at return information.
details->set(kFrameDetailsAtReturnIndex, heap->ToBoolean(at_return));
+ uintptr_t frame_pointer =
+ reinterpret_cast<uintptr_t>(it.frame()->UnpaddedFP());
+
+#ifdef V8_HOST_ARCH_64_BIT
+ Handle<Object> frame_pointer_high = isolate->factory()->NewNumberFromUint(
+ static_cast<uint32_t>(frame_pointer >> 32));
+ details->set(kFrameDetailsFramePointerHighIndex, *frame_pointer_high);
+#else
+ details->set(kFrameDetailsFramePointerHighIndex, Smi::FromInt(0));
+#endif
+ Handle<Object> frame_pointer_low = isolate->factory()->NewNumberFromUint(
+ static_cast<uint32_t>(frame_pointer & 0xffffffff));
+ details->set(kFrameDetailsFramePointerLowIndex, *frame_pointer_low);
+
// 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') | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698