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

Issue 434117: Remove usage of JSArray in Script object... (Closed)

Created:
11 years ago by Søren Thygesen Gjesse
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Remove usage of JSArray in Script object Storing a JSArray in the Script object could cause an indirect reference from the compilation cache to a global object to be created. Now the line ends are only stored as a FixedArrya and when that is needed in JavaScript a JSArray copy is created. Changed some of the JavaScript code to cache the line ends in a local variable for better performance. BUG=http://code.google.com/p/v8/issues/detail?id=528 TEST=test/test-api/Bug528 Committed: http://code.google.com/p/v8/source/detail?r=3374

Patch Set 1 #

Total comments: 4

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -76 lines) Patch
M include/v8.h View 2 chunks +2 lines, -2 lines 0 comments Download
M src/accessors.cc View 1 1 chunk +5 lines, -8 lines 0 comments Download
M src/api.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M src/factory.cc View 1 chunk +1 line, -2 lines 0 comments Download
M src/handles.cc View 3 chunks +6 lines, -6 lines 0 comments Download
M src/messages.js View 5 chunks +14 lines, -10 lines 0 comments Download
M src/objects.h View 2 chunks +3 lines, -14 lines 0 comments Download
M src/objects-debug.cc View 2 chunks +3 lines, -6 lines 0 comments Download
M src/objects-inl.h View 1 chunk +1 line, -2 lines 0 comments Download
M test/cctest/test-api.cc View 4 chunks +2 lines, -20 lines 0 comments Download
M test/cctest/test-debug.cc View 3 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Søren Thygesen Gjesse
11 years ago (2009-11-27 12:00:19 UTC) #1
Mads Ager (chromium)
LGTM with a couple of nits. http://codereview.chromium.org/434117/diff/1/10 File src/accessors.cc (right): http://codereview.chromium.org/434117/diff/1/10#newcode318 src/accessors.cc:318: if (!script->line_ends()->IsUndefined()) { ...
11 years ago (2009-11-27 12:15:01 UTC) #2
Søren Thygesen Gjesse
11 years ago (2009-11-27 14:09:14 UTC) #3
http://codereview.chromium.org/434117/diff/1/10
File src/accessors.cc (right):

http://codereview.chromium.org/434117/diff/1/10#newcode318
src/accessors.cc:318: if (!script->line_ends()->IsUndefined()) {
On 2009/11/27 12:15:01, Mads Ager wrote:
> Shouldn't this always be true after InitScriptLineEnds?  Can we just assert
that
> it is not undefined?

Done.

http://codereview.chromium.org/434117/diff/1/3
File test/cctest/test-api.cc (right):

http://codereview.chromium.org/434117/diff/1/3#newcode8559
test/cctest/test-api.cc:8559: CHECK_EQ(2, gc_count);
On 2009/11/27 12:15:01, Mads Ager wrote:
> Does this change fix the issue with eval?  It seems that the function is still
> there on the script object?

It does not - I will do that in separate change. The previous check on Android
was plain wrong. The reason the count is 2 here is that the compilation cache
for eval only has two generations.

Powered by Google App Engine
This is Rietveld 408576698