mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-16 00:54:38 +02:00
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
Distance is too large for one short branch in string_indexofC8(). Reviewed-by: iveresov
This commit is contained in:
parent
59b883333b
commit
6c38bc48ca
3 changed files with 51 additions and 6 deletions
|
@ -241,6 +241,33 @@ class AbstractAssembler : public ResourceObj {
|
|||
// Make it return true on platforms which need to verify
|
||||
// instruction boundaries for some operations.
|
||||
inline static bool pd_check_instruction_mark();
|
||||
|
||||
// Add delta to short branch distance to verify that it still fit into imm8.
|
||||
int _short_branch_delta;
|
||||
|
||||
int short_branch_delta() const { return _short_branch_delta; }
|
||||
void set_short_branch_delta() { _short_branch_delta = 32; }
|
||||
void clear_short_branch_delta() { _short_branch_delta = 0; }
|
||||
|
||||
class ShortBranchVerifier: public StackObj {
|
||||
private:
|
||||
AbstractAssembler* _assm;
|
||||
|
||||
public:
|
||||
ShortBranchVerifier(AbstractAssembler* assm) : _assm(assm) {
|
||||
assert(assm->short_branch_delta() == 0, "overlapping instructions");
|
||||
_assm->set_short_branch_delta();
|
||||
}
|
||||
~ShortBranchVerifier() {
|
||||
_assm->clear_short_branch_delta();
|
||||
}
|
||||
};
|
||||
#else
|
||||
// Dummy in product.
|
||||
class ShortBranchVerifier: public StackObj {
|
||||
public:
|
||||
ShortBranchVerifier(AbstractAssembler* assm) {}
|
||||
};
|
||||
#endif
|
||||
|
||||
// Label functions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue