2039 emit_int8((unsigned char)(0x80 | cc)); |
2039 emit_int8((unsigned char)(0x80 | cc)); |
2040 emit_int32(0); |
2040 emit_int32(0); |
2041 } |
2041 } |
2042 } |
2042 } |
2043 |
2043 |
2044 void Assembler::jccb(Condition cc, Label& L) { |
2044 void Assembler::jccb_0(Condition cc, Label& L, const char* file, int line) { |
2045 if (L.is_bound()) { |
2045 if (L.is_bound()) { |
2046 const int short_size = 2; |
2046 const int short_size = 2; |
2047 address entry = target(L); |
2047 address entry = target(L); |
2048 #ifdef ASSERT |
2048 #ifdef ASSERT |
2049 intptr_t dist = (intptr_t)entry - ((intptr_t)pc() + short_size); |
2049 intptr_t dist = (intptr_t)entry - ((intptr_t)pc() + short_size); |
2050 intptr_t delta = short_branch_delta(); |
2050 intptr_t delta = short_branch_delta(); |
2051 if (delta != 0) { |
2051 if (delta != 0) { |
2052 dist += (dist < 0 ? (-delta) :delta); |
2052 dist += (dist < 0 ? (-delta) :delta); |
2053 } |
2053 } |
2054 assert(is8bit(dist), "Dispacement too large for a short jmp"); |
2054 assert(is8bit(dist), "Dispacement too large for a short jmp at %s:%d", file, line); |
2055 #endif |
2055 #endif |
2056 intptr_t offs = (intptr_t)entry - (intptr_t)pc(); |
2056 intptr_t offs = (intptr_t)entry - (intptr_t)pc(); |
2057 // 0111 tttn #8-bit disp |
2057 // 0111 tttn #8-bit disp |
2058 emit_int8(0x70 | cc); |
2058 emit_int8(0x70 | cc); |
2059 emit_int8((offs - short_size) & 0xFF); |
2059 emit_int8((offs - short_size) & 0xFF); |
2060 } else { |
2060 } else { |
2061 InstructionMark im(this); |
2061 InstructionMark im(this); |
2062 L.add_patch_at(code(), locator()); |
2062 L.add_patch_at(code(), locator(), file, line); |
2063 emit_int8(0x70 | cc); |
2063 emit_int8(0x70 | cc); |
2064 emit_int8(0); |
2064 emit_int8(0); |
2065 } |
2065 } |
2066 } |
2066 } |
2067 |
2067 |
2112 intptr_t disp = dest - (pc() + sizeof(int32_t)); |
2112 intptr_t disp = dest - (pc() + sizeof(int32_t)); |
2113 assert(is_simm32(disp), "must be 32bit offset (jmp)"); |
2113 assert(is_simm32(disp), "must be 32bit offset (jmp)"); |
2114 emit_data(disp, rspec.reloc(), call32_operand); |
2114 emit_data(disp, rspec.reloc(), call32_operand); |
2115 } |
2115 } |
2116 |
2116 |
2117 void Assembler::jmpb(Label& L) { |
2117 void Assembler::jmpb_0(Label& L, const char* file, int line) { |
2118 if (L.is_bound()) { |
2118 if (L.is_bound()) { |
2119 const int short_size = 2; |
2119 const int short_size = 2; |
2120 address entry = target(L); |
2120 address entry = target(L); |
2121 assert(entry != NULL, "jmp most probably wrong"); |
2121 assert(entry != NULL, "jmp most probably wrong"); |
2122 #ifdef ASSERT |
2122 #ifdef ASSERT |
2123 intptr_t dist = (intptr_t)entry - ((intptr_t)pc() + short_size); |
2123 intptr_t dist = (intptr_t)entry - ((intptr_t)pc() + short_size); |
2124 intptr_t delta = short_branch_delta(); |
2124 intptr_t delta = short_branch_delta(); |
2125 if (delta != 0) { |
2125 if (delta != 0) { |
2126 dist += (dist < 0 ? (-delta) :delta); |
2126 dist += (dist < 0 ? (-delta) :delta); |
2127 } |
2127 } |
2128 assert(is8bit(dist), "Dispacement too large for a short jmp"); |
2128 assert(is8bit(dist), "Dispacement too large for a short jmp at %s:%d", file, line); |
2129 #endif |
2129 #endif |
2130 intptr_t offs = entry - pc(); |
2130 intptr_t offs = entry - pc(); |
2131 emit_int8((unsigned char)0xEB); |
2131 emit_int8((unsigned char)0xEB); |
2132 emit_int8((offs - short_size) & 0xFF); |
2132 emit_int8((offs - short_size) & 0xFF); |
2133 } else { |
2133 } else { |
2134 InstructionMark im(this); |
2134 InstructionMark im(this); |
2135 L.add_patch_at(code(), locator()); |
2135 L.add_patch_at(code(), locator(), file, line); |
2136 emit_int8((unsigned char)0xEB); |
2136 emit_int8((unsigned char)0xEB); |
2137 emit_int8(0); |
2137 emit_int8(0); |
2138 } |
2138 } |
2139 } |
2139 } |
2140 |
2140 |