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

Issue 8462010: Add a level of indirection to exception handler addresses. (Closed)

Created:
9 years, 1 month ago by Kevin Millikin (Chromium)
Modified:
9 years, 1 month ago
CC:
v8-dev
Visibility:
Public.

Description

Add a level of indirection to exception handler addresses. To support deoptimization of exception handlers, the handler address in the stack is converted to a pair of code object and an index into a separate table of code offsets. The index part is invariant under deoptimization. The index is packed into the handler state field so that handler size does not change. R=vegorov@chromium.org,fschneider@chromium.org BUG= TEST= Committed: http://code.google.com/p/v8/source/detail?r=9975

Patch Set 1 #

Total comments: 10

Patch Set 2 : Incorporate review changes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+504 lines, -367 lines) Patch
M src/arm/code-stubs-arm.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/arm/code-stubs-arm.cc View 1 3 chunks +14 lines, -11 lines 0 comments Download
M src/arm/frames-arm.h View 1 chunk +6 lines, -6 lines 0 comments Download
M src/arm/full-codegen-arm.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M src/arm/macro-assembler-arm.h View 1 2 chunks +7 lines, -3 lines 0 comments Download
M src/arm/macro-assembler-arm.cc View 1 4 chunks +74 lines, -64 lines 0 comments Download
M src/ast.h View 7 chunks +18 lines, -6 lines 0 comments Download
M src/code-stubs.h View 6 chunks +11 lines, -5 lines 0 comments Download
M src/code-stubs.cc View 2 chunks +9 lines, -1 line 0 comments Download
M src/frames.h View 2 chunks +8 lines, -3 lines 0 comments Download
M src/frames-inl.h View 3 chunks +9 lines, -9 lines 0 comments Download
M src/full-codegen.h View 2 chunks +3 lines, -0 lines 0 comments Download
M src/full-codegen.cc View 5 chunks +46 lines, -54 lines 0 comments Download
M src/heap.cc View 1 2 chunks +5 lines, -5 lines 0 comments Download
M src/ia32/code-stubs-ia32.h View 2 chunks +2 lines, -2 lines 0 comments Download
M src/ia32/code-stubs-ia32.cc View 1 4 chunks +18 lines, -16 lines 0 comments Download
M src/ia32/frames-ia32.h View 1 chunk +6 lines, -6 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M src/ia32/macro-assembler-ia32.h View 1 2 chunks +8 lines, -3 lines 0 comments Download
M src/ia32/macro-assembler-ia32.cc View 1 3 chunks +76 lines, -52 lines 0 comments Download
M src/objects.h View 2 chunks +5 lines, -1 line 0 comments Download
M src/objects-inl.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/objects-visiting-inl.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/parser.h View 3 chunks +5 lines, -7 lines 0 comments Download
M src/parser.cc View 11 chunks +43 lines, -24 lines 0 comments Download
M src/v8globals.h View 1 chunk +0 lines, -1 line 0 comments Download
M src/v8memory.h View 2 chunks +5 lines, -1 line 0 comments Download
M src/x64/assembler-x64.h View 1 chunk +0 lines, -1 line 0 comments Download
M src/x64/code-stubs-x64.h View 2 chunks +2 lines, -2 lines 0 comments Download
M src/x64/code-stubs-x64.cc View 1 4 chunks +17 lines, -14 lines 0 comments Download
M src/x64/frames-x64.h View 1 chunk +6 lines, -6 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M src/x64/macro-assembler-x64.h View 1 2 chunks +8 lines, -3 lines 0 comments Download
M src/x64/macro-assembler-x64.cc View 1 3 chunks +81 lines, -59 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Kevin Millikin (Chromium)
This looks like a big change by the number of files, but many of them ...
9 years, 1 month ago (2011-11-10 12:00:07 UTC) #1
Vyacheslav Egorov (Chromium)
lgtm http://codereview.chromium.org/8462010/diff/1/src/arm/macro-assembler-arm.cc File src/arm/macro-assembler-arm.cc (right): http://codereview.chromium.org/8462010/diff/1/src/arm/macro-assembler-arm.cc#newcode1309 src/arm/macro-assembler-arm.cc:1309: // Compute the handler entry address and jump ...
9 years, 1 month ago (2011-11-10 19:01:04 UTC) #2
fschneider
lgtm http://codereview.chromium.org/8462010/diff/1/src/arm/macro-assembler-arm.cc File src/arm/macro-assembler-arm.cc (right): http://codereview.chromium.org/8462010/diff/1/src/arm/macro-assembler-arm.cc#newcode1267 src/arm/macro-assembler-arm.cc:1267: // The exception is expected in eax. Should ...
9 years, 1 month ago (2011-11-11 09:43:13 UTC) #3
Kevin Millikin (Chromium)
9 years, 1 month ago (2011-11-11 11:22:50 UTC) #4
http://codereview.chromium.org/8462010/diff/1/src/arm/macro-assembler-arm.cc
File src/arm/macro-assembler-arm.cc (right):

http://codereview.chromium.org/8462010/diff/1/src/arm/macro-assembler-arm.cc#...
src/arm/macro-assembler-arm.cc:1267: // The exception is expected in eax.
On 2011/11/11 09:43:13, fschneider wrote:
> Should be r0 for arm.

Thanks.  Silly that it was right and I changed it :)

http://codereview.chromium.org/8462010/diff/1/src/arm/macro-assembler-arm.cc#...
src/arm/macro-assembler-arm.cc:1309: // Compute the handler entry address and
jump to it.  The handler table is
On 2011/11/10 19:01:04, Vyacheslav Egorov wrote:
> Seems this code can be shared between throw and throw uncatchable.

Yeah, good idea.  Done.

http://codereview.chromium.org/8462010/diff/1/src/objects.h
File src/objects.h (right):

http://codereview.chromium.org/8462010/diff/1/src/objects.h#newcode4063
src/objects.h:4063: static const int kHandlerTableOffset = kRelocationInfoOffset
+ kPointerSize;
On 2011/11/10 19:01:04, Vyacheslav Egorov wrote:
> I think this makes Code's header 64 bytes (with 28 bytes of padding) on ia32.

That's disappointing.  I guess we could later choose to move this into the
deoptimization data to save the padding at the cost of an extra indirection when
throwing.

http://codereview.chromium.org/8462010/diff/1/src/parser.cc
File src/parser.cc (right):

http://codereview.chromium.org/8462010/diff/1/src/parser.cc#newcode496
src/parser.cc:496: int NextHandlerIndex() { return next_handler_index_++; }
On 2011/11/10 19:01:04, Vyacheslav Egorov wrote:
> Maybe call it AllocateHandlerIndex()? 
> 
> I would not expect side-effects from function called NextHandlerIndex.

I can see that, but I was following the style of NextMaterializedBlahBlahBlah
just above.  And AllocateMaterializedLiteralIndex is an eyeful.  Since those
materialized literal lines are already 78 characters long, I'm a-gonna keep it
this way :)

Powered by Google App Engine
This is Rietveld 408576698