Mercurial > hg > truffle
comparison src/cpu/sparc/vm/methodHandles_sparc.cpp @ 3449:a9b8b43b115f
7052219: JSR 292: Crash in ~BufferBlob::MethodHandles adapters
Reviewed-by: twisti, kvn, jrose
author | never |
---|---|
date | Tue, 14 Jun 2011 14:41:33 -0700 |
parents | f7d55ea6ee56 |
children | 38fa55e5e792 |
comparison
equal
deleted
inserted
replaced
3448:fc043ce2136c | 3449:a9b8b43b115f |
---|---|
268 } | 268 } |
269 | 269 |
270 // Emit code to verify that FP is pointing at a valid ricochet frame. | 270 // Emit code to verify that FP is pointing at a valid ricochet frame. |
271 #ifdef ASSERT | 271 #ifdef ASSERT |
272 enum { | 272 enum { |
273 ARG_LIMIT = 255, SLOP = 35, | 273 ARG_LIMIT = 255, SLOP = 45, |
274 // use this parameter for checking for garbage stack movements: | 274 // use this parameter for checking for garbage stack movements: |
275 UNREASONABLE_STACK_MOVE = (ARG_LIMIT + SLOP) | 275 UNREASONABLE_STACK_MOVE = (ARG_LIMIT + SLOP) |
276 // the slop defends against false alarms due to fencepost errors | 276 // the slop defends against false alarms due to fencepost errors |
277 }; | 277 }; |
278 | 278 |
1579 // work argslot up to destslot, copying contiguous data downwards | 1579 // work argslot up to destslot, copying contiguous data downwards |
1580 // pseudo-code: | 1580 // pseudo-code: |
1581 // argslot = src_addr + swap_bytes | 1581 // argslot = src_addr + swap_bytes |
1582 // destslot = dest_addr | 1582 // destslot = dest_addr |
1583 // while (argslot <= destslot) *(argslot - swap_bytes) = *(argslot + 0), argslot++; | 1583 // while (argslot <= destslot) *(argslot - swap_bytes) = *(argslot + 0), argslot++; |
1584 __ add(O1_destslot, wordSize, O1_destslot); | 1584 // dest_slot denotes an exclusive upper limit |
1585 int limit_bias = OP_ROT_ARGS_DOWN_LIMIT_BIAS; | |
1586 if (limit_bias != 0) | |
1587 __ add(O1_destslot, - limit_bias * wordSize, O1_destslot); | |
1585 move_arg_slots_down(_masm, | 1588 move_arg_slots_down(_masm, |
1586 Address(O0_argslot, swap_slots * wordSize), | 1589 Address(O0_argslot, swap_slots * wordSize), |
1587 O1_destslot, | 1590 O1_destslot, |
1588 -swap_slots, | 1591 -swap_slots, |
1589 O0_argslot, O2_scratch); | 1592 O0_argslot, O2_scratch); |
1590 | 1593 |
1591 __ sub(O1_destslot, wordSize, O1_destslot); | 1594 __ sub(O1_destslot, swap_slots * wordSize, O1_destslot); |
1592 } | 1595 } |
1593 // pop the original first chunk into the destination slot, now free | 1596 // pop the original first chunk into the destination slot, now free |
1594 switch (swap_slots) { | 1597 switch (swap_slots) { |
1595 case 2 : __ st_ptr(O4_scratch, Address(O1_destslot, 1 * wordSize)); // fall-thru | 1598 case 2 : __ st_ptr(O4_scratch, Address(O1_destslot, 1 * wordSize)); // fall-thru |
1596 case 1 : __ st_ptr(O3_scratch, Address(O1_destslot, 0 * wordSize)); break; | 1599 case 1 : __ st_ptr(O3_scratch, Address(O1_destslot, 0 * wordSize)); break; |