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

Issue 501076: Fast-codegen: Adding support for try/catch and throw. (Closed)

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

Description

Fast-codegen: Adding support for try/catch and throw. Still no support for lookup-variables, so we bailout if using the catch variable.

Patch Set 1 #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -27 lines) Patch
M src/arm/fast-codegen-arm.cc View 1 chunk +0 lines, -6 lines 0 comments Download
M src/compiler.cc View 3 chunks +5 lines, -3 lines 1 comment Download
M src/fast-codegen.h View 1 chunk +0 lines, -1 line 0 comments Download
M src/fast-codegen.cc View 4 chunks +66 lines, -7 lines 6 comments Download
M src/ia32/fast-codegen-ia32.cc View 1 chunk +0 lines, -5 lines 0 comments Download
M src/x64/fast-codegen-x64.cc View 1 chunk +0 lines, -5 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Lasse Reichstein
Short review.
11 years ago (2009-12-17 09:41:24 UTC) #1
Kevin Millikin (Chromium)
11 years ago (2009-12-17 14:36:16 UTC) #2
LGTM.

http://codereview.chromium.org/501076/diff/1/3
File src/compiler.cc (right):

http://codereview.chromium.org/501076/diff/1/3#newcode881
src/compiler.cc:881: // Supported.
It seems right to visit the subexpressions in a value context.  We will generate
code for them, and may eventually want to do something here.

http://codereview.chromium.org/501076/diff/1/4
File src/fast-codegen.cc (right):

http://codereview.chromium.org/501076/diff/1/4#newcode463
src/fast-codegen.cc:463: Label setup_try_handler, catch_entry, done;
This isn't as complicated as TryFinally, but I miss the nice big comment
explaining what's going on here.

http://codereview.chromium.org/501076/diff/1/4#newcode465
src/fast-codegen.cc:465: __ Call(&setup_try_handler);
You called this 'try_handler_setup' in TryFinally :)

http://codereview.chromium.org/501076/diff/1/4#newcode473
src/fast-codegen.cc:473: ASSERT_EQ(Variable::TEMPORARY, catch_var->mode());
I think this is true, but the code doesn't depend on it.

http://codereview.chromium.org/501076/diff/1/4#newcode474
src/fast-codegen.cc:474: Slot* variable_slot = catch_var->rewrite()->AsSlot();
No need for catch_var->rewrite()->AsSlot(), catch_var->slot() will do the same
thing.  (Using rewrite() just makes it a bit harder to get rid of rewrites.  I
thinking getting rid of rewrites would be a good thing.)

http://codereview.chromium.org/501076/diff/1/4#newcode707
src/fast-codegen.cc:707: Move(Expression::kValue, expr->key());
Seems just as simple to compile the key and variable.

Visit(expr->key());
Visit(expr->value());

(Asserting they have the right expreession context to be sure).

http://codereview.chromium.org/501076/diff/1/4#newcode729
src/fast-codegen.cc:729: Visit(expr->exception());
Might assert the expression context is value.

Powered by Google App Engine
This is Rietveld 408576698