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

Issue 2908009: Create a separate class to encapsulate ScopeInfo serialization.... (Closed)

Created:
10 years, 5 months ago by Vladislav Kaznacheev
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Create a separate class to encapsulate ScopeInfo serialization. The static ScopeInfo members moved into this class. The new class is named ScopeInfoObject which I am not proud of, better ideas are very welcome. Also got rid of the sentinels in the serialized scope info which saves 3 words per function and is not slower. Committed: http://code.google.com/p/v8/source/detail?r=5067

Patch Set 1 #

Total comments: 18

Patch Set 2 : '' #

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+237 lines, -252 lines) Patch
M src/accessors.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/compiler.cc View 1 2 5 chunks +5 lines, -5 lines 0 comments Download
M src/contexts.cc View 1 2 4 chunks +11 lines, -11 lines 0 comments Download
M src/factory.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/factory.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/frames.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/globals.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/heap.cc View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M src/objects.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/objects-inl.h View 1 2 2 chunks +13 lines, -1 line 0 comments Download
M src/parser.cc View 1 2 2 chunks +4 lines, -2 lines 0 comments Download
M src/profile-generator.cc View 1 2 1 chunk +4 lines, -3 lines 0 comments Download
M src/runtime.cc View 1 2 13 chunks +25 lines, -28 lines 0 comments Download
M src/scopeinfo.h View 1 2 2 chunks +46 lines, -35 lines 0 comments Download
M src/scopeinfo.cc View 1 2 12 chunks +118 lines, -157 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Vladislav Kaznacheev
10 years, 5 months ago (2010-07-14 07:55:02 UTC) #1
Mads Ager (chromium)
LGTM It would be nice with a bit of extra cleanup in the scope info ...
10 years, 5 months ago (2010-07-14 08:53:49 UTC) #2
Vladislav Kaznacheev
10 years, 5 months ago (2010-07-14 10:56:35 UTC) #3
Renamed ScopeInfoObject to SerializedScopeInfo (discussed with Mads).

http://codereview.chromium.org/2908009/diff/1/15
File src/objects-inl.h (right):

http://codereview.chromium.org/2908009/diff/1/15#newcode2650
src/objects-inl.h:2650: ScopeInfoObject* SharedFunctionInfo::scope_info() {
On 2010/07/14 08:53:49, Mads Ager wrote:
> Why can't you use 
> 
> ACCESSORS(SharedFunctionInfo, scope_info, ScopeInfoObject, kScopeInfoOffset)?

Oh, I tried that. ACCESSORS does not work with forward-declared classes (it
wants to use ScopeInfoObject::cast), and if I try to declare ScopeInfoObject
properly there are all kinds of problems with circular dependencies (scopeinfo.h
includes variables.h which includes handles.h etc). This is the least messy way
out.

http://codereview.chromium.org/2908009/diff/1/16
File src/scopeinfo.cc (right):

http://codereview.chromium.org/2908009/diff/1/16#newcode332
src/scopeinfo.cc:332: // For variables allocated in the context they are always
preceded by the
On 2010/07/14 08:53:49, Mads Ager wrote:
> by the number Context... number of fixed allocated
> ->
> by Context... fixed allocated

Done.

http://codereview.chromium.org/2908009/diff/1/16#newcode368
src/scopeinfo.cc:368: // +2 for function name and calls eval:
On 2010/07/14 08:53:49, Mads Ager wrote:
> : -> .

Done.

http://codereview.chromium.org/2908009/diff/1/16#newcode376
src/scopeinfo.cc:376: int n;  // number of context slots;
On 2010/07/14 08:53:49, Mads Ager wrote:
> Call this number_of_context_slots instead of having a comment?

Done.

http://codereview.chromium.org/2908009/diff/1/16#newcode385
src/scopeinfo.cc:385: int n;  // number of parameter slots;
On 2010/07/14 08:53:49, Mads Ager wrote:
> Call the variable number_of_parameter_slots instead of the comment?

Done.

http://codereview.chromium.org/2908009/diff/1/16#newcode393
src/scopeinfo.cc:393: // +1 for function name:
On 2010/07/14 08:53:49, Mads Ager wrote:
> : -> .

Done.

http://codereview.chromium.org/2908009/diff/1/16#newcode406
src/scopeinfo.cc:406: int n;  // number of stack slots;
On 2010/07/14 08:53:49, Mads Ager wrote:
> Argh. I know this is not your changes at all. But could you rename these
> variables instead of having to need the comments. That would be a nice cleanup
> and there are more below.

Done.

http://codereview.chromium.org/2908009/diff/1/16#newcode458
src/scopeinfo.cc:458: // slots start after length entry
On 2010/07/14 08:53:49, Mads Ager wrote:
> Capitalize comment and end with period.

Done.

http://codereview.chromium.org/2908009/diff/1/16#newcode462
src/scopeinfo.cc:462: Object** pn = p0 + n * 2;
On 2010/07/14 08:53:49, Mads Ager wrote:
> Better names for variables would be nice. pn -> end or last_context_entry or
> something.

Done.

Powered by Google App Engine
This is Rietveld 408576698