Review URL: http://codereview.chromium.org/126045
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2155
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
void Operand::set_sib(ScaleFactor scale, Register index, Register base) {
ASSERT(len_ == 1);
ASSERT(is_uint2(scale));
- // Use SIB with no index register only for base rsp or r12.
+ // Use SIB with no index register only for base rsp or r12. Otherwise we
+ // would skip the SIB byte entirely.
ASSERT(!index.is(rsp) || base.is(rsp) || base.is(r12));
buf_[1] = scale << 6 | (index.code() & 0x7) << 3 | (base.code() & 0x7);
rex_ |= (index.code() >> 3) << 1 | base.code() >> 3;
Register index,
ScaleFactor scale,
int32_t disp): rex_(0) {
- ASSERT(!index.is(rsp) && !index.is(r12));
+ ASSERT(!index.is(rsp));
len_ = 1;
set_sib(scale, index, base);
if (disp == 0 && !base.is(rbp) && !base.is(r13)) {
- // The call to set_modrm doesn't overwrite the REX.B bit possibly set
- // by set_sib.
+ // This call to set_modrm doesn't overwrite the REX.B (or REX.X) bits
+ // possibly set by set_sib.
set_modrm(0, rsp);
} else if (is_int8(disp)) {
set_modrm(1, rsp);