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

Issue 1652008: LiveEdit: calculate a real script difference (Closed)

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

Description

LiveEdit: calculate a real script difference

Patch Set 1 #

Patch Set 2 : clean up #

Patch Set 3 : small fix #

Total comments: 26

Patch Set 4 : follow codereview and merge #

Patch Set 5 : static assert #

Unified diffs Side-by-side diffs Delta from patch set Stats (+725 lines, -19 lines) Patch
M src/handles.h View 1 1 chunk +5 lines, -0 lines 0 comments Download
M src/handles.cc View 3 chunks +24 lines, -8 lines 0 comments Download
M src/liveedit.h View 1 chunk +38 lines, -0 lines 0 comments Download
M src/liveedit.cc View 1 2 3 4 1 chunk +352 lines, -0 lines 0 comments Download
M src/liveedit-debugger.js View 1 5 chunks +18 lines, -10 lines 0 comments Download
M src/runtime.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/runtime.cc View 1 chunk +12 lines, -1 line 0 comments Download
M test/cctest/SConscript View 1 chunk +1 line, -0 lines 0 comments Download
A test/cctest/test-liveedit.cc View 1 2 3 1 chunk +174 lines, -0 lines 0 comments Download
A test/mjsunit/debug-liveedit-diff.js View 1 2 1 chunk +100 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Peter Rybin
Hi Soren Here I am adding general-purpose diff algorithm and its specialization for script line-by-line ...
10 years, 8 months ago (2010-04-15 18:59:24 UTC) #1
Søren Thygesen Gjesse
LGTM http://codereview.chromium.org/1652008/diff/3001/4004 File src/liveedit.cc (right): http://codereview.chromium.org/1652008/diff/3001/4004#newcode46 src/liveedit.cc:46: // A simple implementation of dynamic programming algorithm. ...
10 years, 8 months ago (2010-04-16 07:01:44 UTC) #2
Peter Rybin
10 years, 8 months ago (2010-04-16 16:30:05 UTC) #3
http://codereview.chromium.org/1652008/diff/3001/4004
File src/liveedit.cc (right):

http://codereview.chromium.org/1652008/diff/3001/4004#newcode46
src/liveedit.cc:46: // A simple implementation of dynamic programming algorithm.
I solves a problem
On 2010/04/16 07:01:44, Søren Gjesse wrote:
> a problem -> the problem

Done.

http://codereview.chromium.org/1652008/diff/3001/4004#newcode47
src/liveedit.cc:47: // of finding a difference of 2 arrays. It uses a table of
results
On 2010/04/16 07:01:44, Søren Gjesse wrote:
> a difference -> the difference

Done.

http://codereview.chromium.org/1652008/diff/3001/4004#newcode48
src/liveedit.cc:48: // for subproblems. Each cell contains a number together
with 2-bit flag
On 2010/04/16 07:01:44, Søren Gjesse wrote:
> for -> of?

Done.

http://codereview.chromium.org/1652008/diff/3001/4004#newcode49
src/liveedit.cc:49: // that helps building chunk list.
On 2010/04/16 07:01:44, Søren Gjesse wrote:
> the chunk list.

Done.

http://codereview.chromium.org/1652008/diff/3001/4004#newcode68
src/liveedit.cc:68: // in table together with flags showing a path through
subproblems.
On 2010/04/16 07:01:44, Søren Gjesse wrote:
> in table -> in the table

Done.

http://codereview.chromium.org/1652008/diff/3001/4004#newcode124
src/liveedit.cc:124: SKIP_ANY
On 2010/04/16 07:01:44, Søren Gjesse wrote:
> Maybe add MAX_DIRECTION_FLAG = SKIP_ANY and assert MAX_DIRECTION_FLAG < (1 <<
> kDirectionSizeBits) somewhere.
> 
> (maybe MAX_DIRECTION_FLAG is not the best name).

Done.

http://codereview.chromium.org/1652008/diff/3001/4004#newcode128
src/liveedit.cc:128: // All results numbers are multiplied by 4 to have a space
for 2-bit flag.
On 2010/04/16 07:01:44, Søren Gjesse wrote:
> results -> result
> 
> Maybe leave out the actual constant values from the comment e.g. "All results
> are shifted to make space for flags in the lower bits"

Done.

http://codereview.chromium.org/1652008/diff/3001/4004#newcode263
src/liveedit.cc:263: 
On 2010/04/16 07:01:44, Søren Gjesse wrote:
> Two empty lines.

Done.

http://codereview.chromium.org/1652008/diff/3001/4004#newcode303
src/liveedit.cc:303: 
On 2010/04/16 07:01:44, Søren Gjesse wrote:
> Ditto.

Done.

http://codereview.chromium.org/1652008/diff/3001/4004#newcode336
src/liveedit.cc:336: 
On 2010/04/16 07:01:44, Søren Gjesse wrote:
> Ditto.

Done.

http://codereview.chromium.org/1652008/diff/3001/4009
File test/cctest/test-liveedit.cc (right):

http://codereview.chromium.org/1652008/diff/3001/4009#newcode59
test/cctest/test-liveedit.cc:59: 
On 2010/04/16 07:01:44, Søren Gjesse wrote:
> Two empty lines (and some more places below).

Done.

http://codereview.chromium.org/1652008/diff/3001/4010
File test/mjsunit/debug-liveedit-diff.js (right):

http://codereview.chromium.org/1652008/diff/3001/4010#newcode33
test/mjsunit/debug-liveedit-diff.js:33: function CheckCompareOneWay(s1, s2) {
On 2010/04/16 07:01:44, Søren Gjesse wrote:
> Maybe add a third (optional) argument for the expected text formatted diff
(you
> are calculating it anyway) and check that as well.

This is a good idea, but I'd rather not over-complicate tests for now. The
quality of diff (how optimal it is) I am checking in C++ tests. Here I only
check that result is correct.

However it can be added it later.

Powered by Google App Engine
This is Rietveld 408576698