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

Issue 544143003: Store frame pointers (Closed)

Created:
6 years, 3 months ago by Jacob
Modified:
5 years, 9 months ago
CC:
vsm, Leaf
Visibility:
Public.

Description

Store frame pointers

Patch Set 1 : #

Total comments: 1

Patch Set 2 : ptal #

Patch Set 3 : ptal #

Total comments: 2

Patch Set 4 : moved to v8 trunk, added a unittest, and fixed compile warning from mainline v8 build. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+57 lines, -6 lines) Patch
M src/mirror-debugger.js View 1 2 3 2 chunks +16 lines, -2 lines 0 comments Download
M src/runtime.cc View 1 2 3 3 chunks +21 lines, -4 lines 0 comments Download
M test/cctest/test-debug.cc View 1 2 3 2 chunks +20 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (7 generated)
Jacob
Expose v8 stack pointers to the V8 debugger API used by Blink.
6 years, 3 months ago (2014-09-05 17:33:13 UTC) #4
hausner
DBC. Someone who understand V8 should decide whether this LG. https://codereview.chromium.org/544143003/diff/40001/src/runtime.cc File src/runtime.cc (right): https://codereview.chromium.org/544143003/diff/40001/src/runtime.cc#newcode11417 ...
6 years, 3 months ago (2014-09-05 18:08:36 UTC) #5
Jacob
siva, can you take a look and recommend someone on the V8 team to review ...
6 years, 3 months ago (2014-09-05 23:46:26 UTC) #6
Jacob
PTAL. Switched to framePointerHigh and framePointerLow instead of truncating frame pointers to 52 bits.
6 years, 3 months ago (2014-09-10 17:54:19 UTC) #7
Vyacheslav Egorov (Google)
DBC https://codereview.chromium.org/544143003/diff/80001/src/runtime.cc File src/runtime.cc (right): https://codereview.chromium.org/544143003/diff/80001/src/runtime.cc#newcode11415 src/runtime.cc:11415: *isolate->factory()->NewNumberFromUint( this is GC unsafe in V8, you ...
6 years, 3 months ago (2014-09-10 22:34:25 UTC) #9
Jacob
Hello Yang Guo, Vyacheslav Egorov suggested I ask you to review this v8 CL. My ...
6 years, 3 months ago (2014-09-11 00:45:57 UTC) #11
Jacob
+iposva
6 years, 3 months ago (2014-09-18 17:04:35 UTC) #13
Yang
sorry for overlooking this. I'll review this tomorrow!
6 years, 3 months ago (2014-09-18 17:49:49 UTC) #15
Yang
On 2014/09/18 17:49:49, Yang wrote: > sorry for overlooking this. I'll review this tomorrow! While ...
6 years, 3 months ago (2014-09-19 13:05:52 UTC) #16
Jacob
6 years, 3 months ago (2014-09-19 17:06:43 UTC) #17
On 2014/09/19 13:05:52, Yang wrote:
> On 2014/09/18 17:49:49, Yang wrote:
> > sorry for overlooking this. I'll review this tomorrow!
> 
> While the CL looks good to me, I have some concerns about exposing internal
> addresses to Javascript. I don't think we do that anywhere else, and while I
> can't pinpoint the security issues this could cause, it seems bad style and
> weird.
> 
> Since you will need to eventually convert the pointer address to C++ again,
> would it make sense to use a C++ api in v8-debug.h that converts frame id to
> address?

Thanks for taking a look.
Some clarification:
I first considered adding the API to v8-debug.h but the problem is that the
Chrome devtools rely on this API rather than the C++ API so at minimum I'd cause
all stack traces to be computed twice if I only exposed this field via the
v8-debug.h api. In addition, I hit edge cases where the list of frames exposed
via this API and the v8-debug.h API are different depending on which flags are
passed so merging results from the two APIs.

To mitigate the security concerns here are a couple options I would prefer to
moving this to v8-debug.h:
1. instead of exposing the frame pointer as a number, pass a V8 handle with the
frame pointer as a hidden field. C++ code on the blink side could then read the
frame pointer back but user code could not. This would also make the API
slightly cleaner as the code to convert possible 64 bit values into two numbers
could be removed.
2. Salt the frame pointers with a random seed. I don't care about the actual
memory addresses, only the relative order of frame pointers from VMs on the page
so as long as I can still compute the correct relative order I'm fine.

Powered by Google App Engine
This is Rietveld 408576698