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

Issue 5699002: RFC: Switch to ast ids (instead of positions) for type feedback. (Closed)

Created:
10 years ago by Vitaly Repeshko
Modified:
9 years, 3 months ago
CC:
v8-dev
Visibility:
Public.

Description

RFC: Switch to ast ids (instead of positions) for type feedback. The goal here is to avoid having several pieces of type feedback tied to a single position. Since everything else already relied on ast ids, it seemed natural to use them for type feedback as well[*]. The implementation squeezes in a new reloc info mode (CODE_TARGET_WITH_ID) which is used for calls to IC stubs from the code generated by the full codegen. The new mode should (in most cases) use just one extra byte per call in the encoded form. The type feedback oracle can simply focus on this reloc info mode. [*]: I did play with disambiguating positions, but because of the implicit way they are set, it's hard to be sure all the cases are fixed.

Patch Set 1 #

Patch Set 2 : Cleanup #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+391 lines, -261 lines) Patch
M src/accessors.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/arm/lithium-arm.h View 1 chunk +1 line, -1 line 0 comments Download
M src/arm/lithium-arm.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M src/assembler.h View 7 chunks +28 lines, -13 lines 1 comment Download
M src/assembler.cc View 17 chunks +150 lines, -57 lines 3 comments Download
M src/ast.h View 6 chunks +11 lines, -13 lines 0 comments Download
M src/ast.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/compiler.h View 3 chunks +3 lines, -3 lines 0 comments Download
M src/compiler.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M src/deoptimizer.h View 1 chunk +1 line, -1 line 0 comments Download
M src/deoptimizer.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/disassembler.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M src/frames.h View 1 chunk +1 line, -1 line 0 comments Download
M src/frames.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M src/full-codegen.h View 3 chunks +12 lines, -9 lines 0 comments Download
M src/full-codegen.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/handles.h View 1 chunk +1 line, -1 line 0 comments Download
M src/handles.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/hydrogen.h View 4 chunks +4 lines, -4 lines 0 comments Download
M src/hydrogen.cc View 6 chunks +7 lines, -7 lines 0 comments Download
M src/hydrogen-instructions.h View 2 chunks +4 lines, -4 lines 0 comments Download
M src/ia32/assembler-ia32.h View 2 chunks +2 lines, -2 lines 0 comments Download
M src/ia32/assembler-ia32.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M src/ia32/assembler-ia32-inl.h View 1 chunk +7 lines, -2 lines 0 comments Download
M src/ia32/deoptimizer-ia32.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 28 chunks +42 lines, -33 lines 0 comments Download
M src/ia32/lithium-ia32.h View 3 chunks +3 lines, -3 lines 0 comments Download
M src/ia32/lithium-ia32.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M src/ia32/macro-assembler-ia32.h View 1 chunk +1 line, -1 line 0 comments Download
M src/ia32/macro-assembler-ia32.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M src/objects.h View 1 chunk +1 line, -1 line 0 comments Download
M src/objects.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M src/runtime.cc View 4 chunks +5 lines, -5 lines 0 comments Download
M src/safepoint-table.h View 2 chunks +3 lines, -3 lines 0 comments Download
M src/type-info.h View 1 1 chunk +6 lines, -4 lines 0 comments Download
M src/type-info.cc View 6 chunks +53 lines, -63 lines 0 comments Download
M src/v8globals.h View 1 chunk +4 lines, -0 lines 1 comment Download
M test/cctest/test-debug.cc View 2 chunks +10 lines, -2 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Vitaly Repeshko
10 years ago (2010-12-09 14:09:08 UTC) #1
fschneider
9 years, 10 months ago (2011-02-11 11:28:18 UTC) #2
Overall the change lgtm. Could you upload a rebased version?

It would be see how much it changes the size of our relocation info overall.

I'd consider not changing the type of ast ids and leave them as integers, since
it would make the change a lot smaller without changing the semantics.

http://codereview.chromium.org/5699002/diff/3001/src/assembler.cc
File src/assembler.cc (left):

http://codereview.chromium.org/5699002/diff/3001/src/assembler.cc#oldcode92
src/assembler.cc:92: // The encoding relies on the fact that there are less than
14
I'm confused by this comment in the existing code since the ASSERT below says <=
14

http://codereview.chromium.org/5699002/diff/3001/src/assembler.cc
File src/assembler.cc (right):

http://codereview.chromium.org/5699002/diff/3001/src/assembler.cc#newcode97
src/assembler.cc:97: // code_taget:         [6 bits pc delta] 01
--> code_target

http://codereview.chromium.org/5699002/diff/3001/src/assembler.cc#newcode99
src/assembler.cc:99: // code_taget_with_id: [6 bits pc delta] 10,
--> code_target

http://codereview.chromium.org/5699002/diff/3001/src/assembler.h
File src/assembler.h (right):

http://codereview.chromium.org/5699002/diff/3001/src/assembler.h#newcode202
src/assembler.h:202: NUMBER_OF_MODES,  // must be no greater than ?? - see
RelocInfoWriter
Update comment. Maybe a STATIC_ASSERT would be better than just a comment or
normal ASSERT.

http://codereview.chromium.org/5699002/diff/3001/src/v8globals.h
File src/v8globals.h (right):

http://codereview.chromium.org/5699002/diff/3001/src/v8globals.h#newcode108
src/v8globals.h:108: typedef unsigned AstId;
Maybe consider leaving ast id as integers (like before) - although I like having
a separate type AstId, I'm not sure if the typedef alone gives us much benefit
overall.

It would also affect less source lines if we leave the type for ast ids
unchanged (i.e. making it easier to merge).

Powered by Google App Engine
This is Rietveld 408576698