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

Issue 914003: LiveEdit: patch positions in function (Closed)

Created:
10 years, 9 months ago by Peter Rybin
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

LiveEdit: patch positions in function Committed: http://code.google.com/p/v8/source/detail?r=4139

Patch Set 1 #

Patch Set 2 : developing #

Patch Set 3 : clean up #

Patch Set 4 : merge #

Patch Set 5 : remove debug print #

Total comments: 43

Patch Set 6 : follow codereview #

Patch Set 7 : merge #

Unified diffs Side-by-side diffs Delta from patch set Stats (+511 lines, -10 lines) Patch
M src/factory.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M src/factory.cc View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M src/heap.h View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M src/heap.cc View 1 2 3 4 5 1 chunk +49 lines, -0 lines 0 comments Download
M src/liveedit.cc View 1 2 3 4 5 4 chunks +237 lines, -9 lines 0 comments Download
M src/liveedit-delay.js View 2 1 chunk +5 lines, -0 lines 0 comments Download
M src/runtime.h View 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M src/runtime.cc View 2 3 4 5 6 1 chunk +30 lines, -0 lines 0 comments Download
A test/mjsunit/debug-liveedit-patch-positions.js View 1 2 3 4 5 1 chunk +93 lines, -0 lines 0 comments Download
A test/mjsunit/debug-liveedit-patch-positions-replace.js View 3 4 5 1 chunk +83 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Peter Rybin
Hi Soren I'm working on updating all positions in functions after source has been changed. ...
10 years, 9 months ago (2010-03-15 01:00:36 UTC) #1
Søren Thygesen Gjesse
LGTM, with comments addressed http://codereview.chromium.org/914003/diff/12001/13002 File src/factory.h (right): http://codereview.chromium.org/914003/diff/12001/13002#newcode233 src/factory.h:233: static Handle<Code> CopyCode(Handle<Code> code, patched_relocation_info ...
10 years, 9 months ago (2010-03-15 08:41:16 UTC) #2
Peter Rybin
http://codereview.chromium.org/914003/diff/12001/13002 File src/factory.h (right): http://codereview.chromium.org/914003/diff/12001/13002#newcode233 src/factory.h:233: static Handle<Code> CopyCode(Handle<Code> code, On 2010/03/15 08:41:16, Søren Gjesse ...
10 years, 9 months ago (2010-03-15 20:56:10 UTC) #3
Søren Thygesen Gjesse
10 years, 9 months ago (2010-03-16 07:42:02 UTC) #4
http://codereview.chromium.org/914003/diff/12001/13006
File src/liveedit.cc (right):

http://codereview.chromium.org/914003/diff/12001/13006#newcode455
src/liveedit.cc:455: // Clear the buffer in debug mode. Use 'int3' instructions
to make
On 2010/03/15 20:56:10, Peter Rybin wrote:
> On 2010/03/15 08:41:16, Søren Gjesse wrote:
> > in3 and opcode 0xCC is not very platform independent.
> 
> I simply removed it.
> Do we anything better, e.g. any API for platform-independent memory filler?

No, there is not. The ia32 and x64 assemblers fills 0xCC in code buffers they
allocate themselves in debug mode. The ARM assembler does no such thing.

http://codereview.chromium.org/914003/diff/12001/13006#newcode515
src/liveedit.cc:515: } else {
On 2010/03/15 20:56:10, Peter Rybin wrote:
> On 2010/03/15 08:41:16, Søren Gjesse wrote:
> > Please rephrase this comment.
> > 
> > Regarding the TODO, then shorting the code object in-place probably will not
> > work, as I don't think it is possible to have non-code fillers in the code
> > space, but I am not sure. Shorting objects in-place can be done by adjusting
> > their size and writing fillers (one pointer filler map, two pointer filler
map
> > or a byte array of the right size) in the freed-up space after the shorter
> > object. You can try it out, but otherwise I suggest that you add some
fillers
> to
> > the reloc info instead.
> 
> Done
> Speaking about TODO I think I can safely drop it, because it would make the
code
> too complicated for now real benefit.

Agree.

http://codereview.chromium.org/914003/diff/12001/13006#newcode580
src/liveedit.cc:580: 
On 2010/03/15 20:56:10, Peter Rybin wrote:
> On 2010/03/15 08:41:16, Søren Gjesse wrote:
> > Please add some comments to what the different iterators takes care of.
Isn't
> it
> > possible that the same object will be visited twice?
> 
> Done.
> 
> I'm not sure. However, I need to iterate over all pointers. I thought that
there
> are roots and there are pointers inside objects and that is roughly all
pointers
> in the system and these 2 sets do not overlap.
> Do you think it is also worth making into a comment?

As all objects are in the heap the heap iterator will visit all of them. The
strong roots are the set of objects which defines the initial set of live
objects when performing a GC. They include all "basic" objects, objects
reachable from the execution stack, objects reachable from the various C++
structures used internally, etc. In this case I think you could just use the
HeapIterator. We have been talking about making a HeapIterator which only visits
live objects using the same marking scheme as used by the GC, but have never
taken the time. The HeapIterator just visits everything.

Powered by Google App Engine
This is Rietveld 408576698