| Index: regexp2000/src/assembler-ia32.cc
|
| diff --git a/regexp2000/src/assembler-ia32.cc b/regexp2000/src/assembler-ia32.cc
|
| index 989889ce0b87b6cd6bb3580277661f7148ec8650..bf705f2d488161f74cc3786fcf9c583070da152d 100644
|
| --- a/regexp2000/src/assembler-ia32.cc
|
| +++ b/regexp2000/src/assembler-ia32.cc
|
| @@ -419,6 +419,28 @@ void Assembler::push(const Operand& src) {
|
| }
|
|
|
|
|
| +void Assembler::push(Label* label, RelocInfo::Mode reloc_mode) {
|
| + EnsureSpace ensure_space(this);
|
| + last_pc_ = pc_;
|
| + // If reloc_mode == NONE, the label is stored as buffer relative.
|
| + ASSERT(reloc_mode == RelocInfo::NONE);
|
| + if (label->is_bound()) {
|
| + // Index of position in Code object:
|
| + int pos = label->pos() + Code::kHeaderSize;
|
| + if (pos >= 0 && pos < 256) {
|
| + EMIT(0x6a);
|
| + EMIT(pos);
|
| + } else {
|
| + EMIT(0x68);
|
| + emit(pos);
|
| + }
|
| + } else {
|
| + EMIT(0x68);
|
| + emit_disp(label, Displacement::CODE_RELATIVE);
|
| + }
|
| +}
|
| +
|
| +
|
| void Assembler::pop(Register dst) {
|
| ASSERT(reloc_info_writer.last_pc() != NULL);
|
| if (FLAG_push_pop_elimination && (reloc_info_writer.last_pc() <= last_pc_)) {
|
| @@ -1106,6 +1128,14 @@ void Assembler::shr(Register dst) {
|
| }
|
|
|
|
|
| +void Assembler::shr_cl(Register dst) {
|
| + EnsureSpace ensure_space(this);
|
| + last_pc_ = pc_;
|
| + EMIT(0xD1);
|
| + EMIT(0xE8 | dst.code());
|
| +}
|
| +
|
| +
|
| void Assembler::sub(const Operand& dst, const Immediate& x) {
|
| EnsureSpace ensure_space(this);
|
| last_pc_ = pc_;
|
| @@ -1304,12 +1334,16 @@ void Assembler::bind_to(Label* L, int pos) {
|
| while (L->is_linked()) {
|
| Displacement disp = disp_at(L);
|
| int fixup_pos = L->pos();
|
| - if (disp.type() == Displacement::UNCONDITIONAL_JUMP) {
|
| - ASSERT(byte_at(fixup_pos - 1) == 0xE9); // jmp expected
|
| + if (disp.type() == Displacement::CODE_RELATIVE) {
|
| + long_at_put(fixup_pos, pos + Code::kHeaderSize);
|
| + } else {
|
| + if (disp.type() == Displacement::UNCONDITIONAL_JUMP) {
|
| + ASSERT(byte_at(fixup_pos - 1) == 0xE9); // jmp expected
|
| + }
|
| + // relative address, relative to point after address
|
| + int imm32 = pos - (fixup_pos + sizeof(int32_t));
|
| + long_at_put(fixup_pos, imm32);
|
| }
|
| - // relative address, relative to point after address
|
| - int imm32 = pos - (fixup_pos + sizeof(int32_t));
|
| - long_at_put(fixup_pos, imm32);
|
| disp.next(L);
|
| }
|
| L->bind_to(pos);
|
|
|