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

Issue 492002: Fast-codegen: Implementing try/finally on top of nesting context. (Closed)

Created:
11 years ago by Lasse Reichstein
Modified:
9 years, 6 months ago
CC:
v8-dev
Visibility:
Public.

Description

Fast-codegen: Implementing try/finally on top of nesting context.

Patch Set 1 #

Patch Set 2 : Updated to be based on latest release. #

Total comments: 17
Unified diffs Side-by-side diffs Delta from patch set Stats (+223 lines, -6 lines) Patch
M src/arm/fast-codegen-arm.cc View 1 2 chunks +33 lines, -1 line 0 comments Download
M src/compiler.cc View 1 1 chunk +3 lines, -1 line 0 comments Download
M src/fast-codegen.h View 1 chunk +6 lines, -0 lines 0 comments Download
M src/fast-codegen.cc View 1 2 chunks +62 lines, -1 line 11 comments Download
M src/ia32/fast-codegen-ia32.cc View 1 1 chunk +37 lines, -2 lines 6 comments Download
M src/ia32/macro-assembler-ia32.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/x64/fast-codegen-x64.cc View 1 1 chunk +35 lines, -0 lines 0 comments Download
M src/x64/macro-assembler-x64.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download
M test/mjsunit/try.js View 1 1 chunk +45 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Lasse Reichstein
Depends on http://codereview.chromium.org/466033/show
11 years ago (2009-12-10 09:24:59 UTC) #1
Kevin Millikin (Chromium)
LGTM. I like the code for try/finally much better than the optimizing compiler. http://codereview.chromium.org/492002/diff/24/27 File ...
11 years ago (2009-12-10 13:51:12 UTC) #2
Lasse Reichstein
11 years ago (2009-12-16 08:43:30 UTC) #3
http://codereview.chromium.org/492002/diff/24/27
File src/fast-codegen.cc (right):

http://codereview.chromium.org/492002/diff/24/27#newcode499
src/fast-codegen.cc:499: // the fially block through finally_entry label.
Fixed

http://codereview.chromium.org/492002/diff/24/27#newcode504
src/fast-codegen.cc:504: // and a value in the result register (rax/eax/r0),
both of which must
Done

http://codereview.chromium.org/492002/diff/24/27#newcode525
src/fast-codegen.cc:525: Visit(stmt->finally_block());
It should be ok (you can't label the blocks, so there is no reason to visit the
blocks themselves). Will change.

http://codereview.chromium.org/492002/diff/24/27#newcode526
src/fast-codegen.cc:526: ReturnFromFinallyBlock();  // Performs a return to the
calling code.
Fixed.
(The point was that it actually did a return at the end, so it was named to show
that control didn't fall through. I'll just use a comment).

http://codereview.chromium.org/492002/diff/24/27#newcode532
src/fast-codegen.cc:532: __ PushTryHandler(IN_JAVASCRIPT, TRY_FINALLY_HANDLER);
Done

http://codereview.chromium.org/492002/diff/24/29
File src/ia32/fast-codegen-ia32.cc (right):

http://codereview.chromium.org/492002/diff/24/29#newcode1642
src/ia32/fast-codegen-ia32.cc:1642: __ mov(edx, Operand(esp, 0));
Good idea. Done.

http://codereview.chromium.org/492002/diff/24/29#newcode1649
src/ia32/fast-codegen-ia32.cc:1649: __ push(eax);
Indeed. Half an abstractions is ... useless.

http://codereview.chromium.org/492002/diff/24/29#newcode1657
src/ia32/fast-codegen-ia32.cc:1657: __ mov(edx, Operand(esp, 0));
The CPU has a call/return stack that expects calls/returns to be properly
nested. If they aren't, the stack gets out of sync, and return becomes slower.

I don't know if messing with stack values break it anyway (I'm guess it won't,
which is why I cook and uncook without popping, so that the next expected return
value is never outside the stack).

We definitely get out of sync with the try-handler chain management, so maybe
it's not worth keeping it here.
I'll keep it for now, and try to do a little research on whether we break it,
and how much it matters.

Powered by Google App Engine
This is Rietveld 408576698