Thanks for the comments. I uploaded a new version which does the same for CompareIC.
I also needed to insert nop when calling the stub from the lithium code generator. http://codereview.chromium.org/5714001/diff/9001/src/ia32/assembler-ia32.h File src/ia32/assembler-ia32.h (right): http://codereview.chromium.org/5714001/diff/9001/src/ia32/assembler-ia32.h#newcode576 src/ia32/assembler-ia32.h:576: static const byte kJmpShortOpcode = 0xeb; On 2010/12/09 16:27:58, William Hesse wrote:
I think we tend to use capital letters in hexadecimal constants in the assembler.
Done. http://codereview.chromium.org/5714001/diff/9001/src/ia32/full-codegen-ia32.cc File src/ia32/full-codegen-ia32.cc (right): http://codereview.chromium.org/5714001/diff/9001/src/ia32/full-codegen-ia32.cc#newcode1557 src/ia32/full-codegen-ia32.cc:1557: masm_->bind(&patch_site_); On 2010/12/09 15:59:01, Vitaly wrote:
In debug mode in ~JumpPatchSite we could assert that patch info is
emitted if
patch_site is bound.
Done. http://codereview.chromium.org/5714001/diff/9001/src/ia32/full-codegen-ia32.cc#newcode1563 src/ia32/full-codegen-ia32.cc:1563: __ test(eax, Immediate(delta_to_patch_site << 16 | cc_)); On 2010/12/09 15:59:01, Vitaly wrote:
For smi checks the condition is always not_zero. We could save 3 bytes
by using
short form of test here. Of course, this makes JumpPatchSite less
generic. On
the other hand, we could specialize it even more for smi checks, e.g.: SmiCheckPatchSite smi_check(masm_, &call_stub); smi_check.EmitCheck(eax); ... CallStub(...); smi_check.EmitPatchInfo();
Done. http://codereview.chromium.org/5714001/diff/9001/src/ia32/full-codegen-ia32.cc#newcode1597 src/ia32/full-codegen-ia32.cc:1597: __ CallStub(&stub); On 2010/12/10 06:41:41, Kevin Millikin wrote:
I like Vitaly's idea because it's safer. I think the
jumping/branching and the
calling is something you want to see in this code generator code. The
required
__nop() or EmitPatchInfo is bookkeeping and doesn't need to be seen
here.
Taking it a step further, you could make it read more like a jump by
making the
interface:
JumpPatchSite patch_site(masm_); patch_site.EmitJump(not_zero, &call_stub); ...
EmitCallStub(&stub, &patch_site);
Done. http://codereview.chromium.org/5714001/ -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
