http://codereview.chromium.org/354024/diff/4001/1007
File src/arm/fast-codegen-arm.cc (right):

http://codereview.chromium.org/354024/diff/4001/1007#newcode104
Line 104: EmitReturnSequence();
I actually think it's better to have the signature void
EmitReturnSequence(int pos).  Here you can call:

EmitReturnSequence(function_->end_position());

At the other site you can call

EmitReturnSequence(stmt->statement_pos());

and you can delete the (now) unneeded
FastCodeGenarator::SetReturnPosition.

Then you can write

CodeGenerator::RecordPositions(pos)
__ RecordJSReturn();

or even better, make it a one-liner:

__ RecordJSReturn(pos);

in the implementation of EmitReturnSequence.  This is better because:
(a) it doesn't rely on the (undocumented!) precondition that
Set...Position is called before EmitReturnSequence and (b) the recording
of positions is right next to where it is used in RecordJSReturn,
instead of in another function.

The second factor is important---it seems like the present confusion
about where source positions should be recorded and for what is due to
they way that they are so far from where they're used.

http://codereview.chromium.org/354024

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

Reply via email to