Added function EnsureSpaceForLazyDeopt() on all platforms. It inserts
nop-padding when needed at each LLazyBailout instruction and at the end of the
function body.

It turns out that a function ending with a Throw has a lazy-bailout as last
instruction and therefore needs padding before emitting the deopt data table.


http://codereview.chromium.org/8492004/diff/27004/src/arm/lithium-codegen-arm.cc
File src/arm/lithium-codegen-arm.cc (left):

http://codereview.chromium.org/8492004/diff/27004/src/arm/lithium-codegen-arm.cc#oldcode282
src/arm/lithium-codegen-arm.cc:282: __ nop();
On 2011/11/15 12:03:56, Vyacheslav Egorov wrote:
Maybe add an assertion to check that we always have enough space for
patching
(or at least a comment about why it is so).

Especially interesting is the case at the end of the function: @call
@lazy-bailout @return

Done.

http://codereview.chromium.org/8492004/diff/27004/src/arm/lithium-codegen-arm.cc
File src/arm/lithium-codegen-arm.cc (right):

http://codereview.chromium.org/8492004/diff/27004/src/arm/lithium-codegen-arm.cc#newcode4515
src/arm/lithium-codegen-arm.cc:4515:
safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index());
On 2011/11/15 12:03:56, Vyacheslav Egorov wrote:
I think it should emit nop padding (the one removed from
SafepointGenerator).

Done.

http://codereview.chromium.org/8492004/diff/27004/src/ia32/lithium-codegen-ia32.cc
File src/ia32/lithium-codegen-ia32.cc (right):

http://codereview.chromium.org/8492004/diff/27004/src/ia32/lithium-codegen-ia32.cc#newcode4422
src/ia32/lithium-codegen-ia32.cc:4422:
safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index());
On 2011/11/15 12:03:56, Vyacheslav Egorov wrote:
Are we sure we always have enough space between lazy-bailout and other
lazy
bailout or the end of the code?

If we are sure please add a comment explaining why and assertion.

Done.

http://codereview.chromium.org/8492004/diff/27004/src/x64/lithium-codegen-x64.cc
File src/x64/lithium-codegen-x64.cc (right):

http://codereview.chromium.org/8492004/diff/27004/src/x64/lithium-codegen-x64.cc#newcode4128
src/x64/lithium-codegen-x64.cc:4128:
safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index());
On 2011/11/15 12:03:56, Vyacheslav Egorov wrote:
This code does not pad the last @lazy-bailout in the code.

Done.

http://codereview.chromium.org/8492004/

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to