48 |
48 |
49 destreg = inv_rd(*(unsigned int *)instaddr); |
49 destreg = inv_rd(*(unsigned int *)instaddr); |
50 // Generate a the new sequence |
50 // Generate a the new sequence |
51 _masm->patchable_sethi(x, destreg); |
51 _masm->patchable_sethi(x, destreg); |
52 ICache::invalidate_range(instaddr, 7 * BytesPerInstWord); |
52 ICache::invalidate_range(instaddr, 7 * BytesPerInstWord); |
|
53 } |
|
54 |
|
55 void NativeInstruction::verify_data64_sethi(address instaddr, intptr_t x) { |
|
56 ResourceMark rm; |
|
57 unsigned char buffer[10 * BytesPerInstWord]; |
|
58 CodeBuffer buf(buffer, 10 * BytesPerInstWord); |
|
59 MacroAssembler masm(&buf); |
|
60 |
|
61 Register destreg = inv_rd(*(unsigned int *)instaddr); |
|
62 // Generate the proper sequence into a temporary buffer and compare |
|
63 // it with the original sequence. |
|
64 masm.patchable_sethi(x, destreg); |
|
65 int len = buffer - masm.pc(); |
|
66 for (int i = 0; i < len; i++) { |
|
67 assert(instaddr[i] == buffer[i], "instructions must match"); |
|
68 } |
53 } |
69 } |
54 |
70 |
55 void NativeInstruction::verify() { |
71 void NativeInstruction::verify() { |
56 // make sure code pattern is actually an instruction address |
72 // make sure code pattern is actually an instruction address |
57 address addr = addr_at(0); |
73 address addr = addr_at(0); |