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

Issue 5965011: Basic GDB JIT Interface integration. (Closed)

Created:
9 years, 12 months ago by Vyacheslav Egorov (Chromium)
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Basic GDB JIT Interface integration. It has certain overheads even when gdb is not attached so it is guarded by ENABLE_GDBJIT_INTERFACE define and --gdbjit flag. Committed: http://code.google.com/p/v8/source/detail?r=6367

Patch Set 1 #

Patch Set 2 : fix release build #

Patch Set 3 : reduce pressure on GDB, add support for x64 #

Patch Set 4 : fix ia32 compilation #

Patch Set 5 : minor formatting cleanup #

Total comments: 32
Unified diffs Side-by-side diffs Delta from patch set Stats (+1425 lines, -2 lines) Patch
M SConstruct View 1 2 3 chunks +10 lines, -0 lines 2 comments Download
M src/SConscript View 1 chunk +1 line, -0 lines 0 comments Download
M src/assembler.h View 1 2 3 chunks +27 lines, -1 line 4 comments Download
M src/assembler.cc View 2 chunks +10 lines, -0 lines 0 comments Download
M src/bootstrapper.cc View 1 chunk +1 line, -0 lines 2 comments Download
M src/builtins.cc View 2 chunks +6 lines, -1 line 2 comments Download
M src/code-stubs.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M src/codegen.cc View 1 2 2 chunks +11 lines, -0 lines 0 comments Download
M src/compiler.cc View 4 chunks +9 lines, -0 lines 0 comments Download
M src/flag-definitions.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M src/full-codegen.cc View 1 2 2 chunks +11 lines, -0 lines 0 comments Download
A src/gdbjit.h View 1 chunk +137 lines, -0 lines 10 comments Download
A src/gdbjit.cc View 1 2 3 4 1 chunk +1143 lines, -0 lines 10 comments Download
M src/mark-compact.cc View 3 chunks +12 lines, -0 lines 2 comments Download
M src/stub-cache.cc View 33 chunks +41 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Vyacheslav Egorov (Chromium)
Hi Mads, This CL provides basic GDB JIT interface integration for the sake of V8 ...
9 years, 12 months ago (2010-12-29 19:39:55 UTC) #1
ry
Tested in Node ( https://github.com/ry/node/commit/3f45187815ba043ef04b591da53d6cacb11937c1 ) and it seems to work. It's extremely slow though; ...
9 years, 12 months ago (2010-12-30 04:53:03 UTC) #2
Vyacheslav Egorov (Chromium)
Redirecting CL to Erik.
9 years, 11 months ago (2011-01-03 14:17:00 UTC) #3
Erik Corry
http://codereview.chromium.org/5965011/diff/12016/src/gdbjit.cc File src/gdbjit.cc (right): http://codereview.chromium.org/5965011/diff/12016/src/gdbjit.cc#newcode95 src/gdbjit.cc:95: Slot<T> SlotHere() { The name should reflect the fact ...
9 years, 11 months ago (2011-01-04 14:21:48 UTC) #4
Erik Corry
LGTM http://codereview.chromium.org/5965011/diff/12016/SConstruct File SConstruct (right): http://codereview.chromium.org/5965011/diff/12016/SConstruct#newcode882 SConstruct:882: Abort("GDBJIT interface is supported only for 32-bit Linux ...
9 years, 11 months ago (2011-01-05 09:00:15 UTC) #5
Vyacheslav Egorov (Chromium)
9 years, 11 months ago (2011-01-18 16:10:42 UTC) #6
Thanks for the review Erik!

Landing.

I will also create a Wiki and Issues to cover current progress.

http://codereview.chromium.org/5965011/diff/12016/SConstruct
File SConstruct (right):

http://codereview.chromium.org/5965011/diff/12016/SConstruct#newcode882
SConstruct:882: Abort("GDBJIT interface is supported only for 32-bit Linux
target.")
On 2011/01/05 09:00:15, Erik Corry wrote:
> 32-bit should perhaps be Intel-compatible?

Done.

http://codereview.chromium.org/5965011/diff/12016/src/assembler.h
File src/assembler.h (right):

http://codereview.chromium.org/5965011/diff/12016/src/assembler.h#newcode38
src/assembler.h:38: #include "gdbjit.h"
On 2011/01/05 09:00:15, Erik Corry wrote:
> The files should really be called gdb-jit.*

Done.

http://codereview.chromium.org/5965011/diff/12016/src/assembler.h#newcode637
src/assembler.h:637: #ifdef ENABLE_GDBJIT_INTERFACE
On 2011/01/05 09:00:15, Erik Corry wrote:
> and the macro should really be called ENABLE_GDB_JIT_INTERFACE.

Done.

http://codereview.chromium.org/5965011/diff/12016/src/bootstrapper.cc
File src/bootstrapper.cc (right):

http://codereview.chromium.org/5965011/diff/12016/src/bootstrapper.cc#newcode36
src/bootstrapper.cc:36: #include "gdbjit.h"
On 2011/01/05 09:00:15, Erik Corry wrote:
> This shouldn't be necessary.  The .cc file doesn't use it and the .h files
> should include what they need.

Done.

http://codereview.chromium.org/5965011/diff/12016/src/builtins.cc
File src/builtins.cc (right):

http://codereview.chromium.org/5965011/diff/12016/src/builtins.cc#newcode1549
src/builtins.cc:1549: Object* code = 0;
On 2011/01/05 09:00:15, Erik Corry wrote:
> Not your code, but this should be NULL.  Also it should be typed as a Code*
> instead of being cast to it 3 places below.

We get it from ToObject() which does not provide get and case primitive.

http://codereview.chromium.org/5965011/diff/12016/src/gdbjit.cc
File src/gdbjit.cc (right):

http://codereview.chromium.org/5965011/diff/12016/src/gdbjit.cc#newcode95
src/gdbjit.cc:95: Slot<T> SlotHere() {
On 2011/01/04 14:21:48, Erik Corry wrote:
> The name should reflect the fact that this function (and the next) create
slots.
>  eg CreateSlotHere()

Done.

http://codereview.chromium.org/5965011/diff/12016/src/gdbjit.cc#newcode102
src/gdbjit.cc:102: Ensure(position_ += sizeof(T) * count);
On 2011/01/04 14:21:48, Erik Corry wrote:
> no no no no

Done.

http://codereview.chromium.org/5965011/diff/12016/src/gdbjit.cc#newcode311
src/gdbjit.cc:311: WriteString("");
On 2011/01/04 14:21:48, Erik Corry wrote:
> I'm sure there is a good reason why we do this which we could put in a
comment.

Done.

http://codereview.chromium.org/5965011/diff/12016/src/gdbjit.cc#newcode401
src/gdbjit.cc:401: #endif
On 2011/01/04 14:21:48, Erik Corry wrote:
> At least one place in this file should have an else and a #error to catch the
> ARM case and give a sensible error message.

Done.

http://codereview.chromium.org/5965011/diff/12016/src/gdbjit.cc#newcode858
src/gdbjit.cc:858: is_statement = !is_statement;
On 2011/01/04 14:21:48, Erik Corry wrote:
> How about is_statement = info->is_statement_;

I want to reflect the meaning of an emitted operation: in this case emitted
operation is negation not an assignment.

http://codereview.chromium.org/5965011/diff/12016/src/gdbjit.h
File src/gdbjit.h (right):

http://codereview.chromium.org/5965011/diff/12016/src/gdbjit.h#newcode31
src/gdbjit.h:31: #ifdef ENABLE_GDBJIT_INTERFACE
On 2011/01/04 14:21:48, Erik Corry wrote:
> A few lines here on which gdb versions, OSs etc. this is expected to work on
> would be nice.

Done.

http://codereview.chromium.org/5965011/diff/12016/src/gdbjit.h#newcode59
src/gdbjit.h:59: void SetPosition(intptr_t pc, int pos, bool is_statement) {
On 2011/01/04 14:21:48, Erik Corry wrote:
> What is pos, a line number?
> 
> The names of the function and the variables should tell us more.

pos is used in common V8 sense --- position in string.

it is not line number.

http://codereview.chromium.org/5965011/diff/12016/src/gdbjit.h#newcode72
src/gdbjit.h:72: List<PCInfo>* pc_info() {
On 2011/01/04 14:21:48, Erik Corry wrote:
> Lower case names are reserved for getters.  Doing a sort means it is not just
a
> getter.  Either the function should be renamed or the sort should be moved
out.

Done.

http://codereview.chromium.org/5965011/diff/12016/src/gdbjit.h#newcode82
src/gdbjit.h:82: return a->pc_ - b->pc_;
On 2011/01/04 14:21:48, Erik Corry wrote:
> Subtracting two 64 bit values and returning the answer as a signed 32 bit
value
> is rather fragile even though it probably works right now.

Done.

http://codereview.chromium.org/5965011/diff/12016/src/gdbjit.h#newcode91
src/gdbjit.h:91: 
On 2011/01/04 14:21:48, Erik Corry wrote:
> There should be two blank lines here.

Done.

http://codereview.chromium.org/5965011/diff/12016/src/mark-compact.cc
File src/mark-compact.cc (right):

http://codereview.chromium.org/5965011/diff/12016/src/mark-compact.cc#newcode131
src/mark-compact.cc:131: // If GDBJIT interface is active disable compaction.
On 2011/01/05 09:00:15, Erik Corry wrote:
> We should remember to fix this in the new GC.  We only have to disable
> compaction of code space or perhaps we can do it as a delete followed by an
add,
> though that may kill gdb breakpoints.  Perhaps this feature should be
mentioned
> somewhere prominent like the --help text.

Done.

Powered by Google App Engine
This is Rietveld 408576698