Remove PushRel in exception handling (issue1958046)

3 views
Skip to first unread message

e...@4geeks.de

unread,
Aug 17, 2010, 2:30:04 AM8/17/10
to reid.k...@gmail.com, unladen...@googlegroups.com, re...@codereview.appspotmail.com
Reviewers: Reid Kleckner,

Message:
This removes PushRel from exception handling.
Exceptions are stored in extra allocas and wrote on the correct stack
position before entering the handler block.

Please review this at http://codereview.appspot.com/1958046/

Affected files:
M JIT/llvm_fbuilder.cc
M JIT/llvm_fbuilder.h
M JIT/opcodes/block.cc


reid.k...@gmail.com

unread,
Aug 17, 2010, 1:54:15 PM8/17/10
to e...@4geeks.de, unladen...@googlegroups.com, re...@codereview.appspotmail.com
LGTM


http://codereview.appspot.com/1958046/diff/1/4
File JIT/llvm_fbuilder.cc (right):

http://codereview.appspot.com/1958046/diff/1/4#newcode601
JIT/llvm_fbuilder.cc:601: // Just store the exception in allocas.
I'd elaborate here along the lines of:
We don't know which stack slots the exc triplet is going into until
later, so we save it in an alloca and let the opcode implementations
copy it into the correct stack slots.

http://codereview.appspot.com/1958046/

Dan Stromberg

unread,
Aug 29, 2010, 8:28:38 PM8/29/10
to e...@4geeks.de, reid.k...@gmail.com, unladen...@googlegroups.com, re...@codereview.appspotmail.com

A half-rhetorical question:

Has alloca grown more portable over the years?

alloca used to be somewhat frowned upon.  Granted it's convenient when you have it, but at least at one time not all systems had it:

--
Dan Stromberg

Reid Kleckner

unread,
Aug 30, 2010, 10:51:25 AM8/30/10
to Dan Stromberg, e...@4geeks.de, unladen...@googlegroups.com, re...@codereview.appspotmail.com
In LLVM, alloca is the name of the instruction that allocates stack
space. I think you can give it an argument that isn't a constant, but
generally speaking you give it a constant argument and it gives you
some local stack space. It's used for all of your local variables.

Reid

Reply all
Reply to author
Forward
0 new messages