< prev index next >

src/share/vm/asm/assembler.cpp

Print this page
rev 12037 : 8166562: C2: Suppress relocations in scratch emit.


 136     int bang_end = (int)JavaThread::stack_shadow_zone_size();
 137 
 138     // This is how far the previous frame's stack banging extended.
 139     const int bang_end_safe = bang_end;
 140 
 141     if (frame_size_in_bytes > page_size) {
 142       bang_end += frame_size_in_bytes;
 143     }
 144 
 145     int bang_offset = bang_end_safe;
 146     while (bang_offset <= bang_end) {
 147       // Need at least one stack bang at end of shadow zone.
 148       bang_stack_with_offset(bang_offset);
 149       bang_offset += page_size;
 150     }
 151   } // end (UseStackBanging)
 152 }
 153 
 154 void Label::add_patch_at(CodeBuffer* cb, int branch_loc) {
 155   assert(_loc == -1, "Label is unbound");


 156   if (_patch_index < PatchCacheSize) {
 157     _patches[_patch_index] = branch_loc;
 158   } else {
 159     if (_patch_overflow == NULL) {
 160       _patch_overflow = cb->create_patch_overflow();
 161     }
 162     _patch_overflow->push(branch_loc);
 163   }
 164   ++_patch_index;
 165 }
 166 
 167 void Label::patch_instructions(MacroAssembler* masm) {
 168   assert(is_bound(), "Label is bound");
 169   CodeBuffer* cb = masm->code();
 170   int target_sect = CodeBuffer::locator_sect(loc());
 171   address target = cb->locator_address(loc());
 172   while (_patch_index > 0) {
 173     --_patch_index;
 174     int branch_loc;
 175     if (_patch_index >= PatchCacheSize) {




 136     int bang_end = (int)JavaThread::stack_shadow_zone_size();
 137 
 138     // This is how far the previous frame's stack banging extended.
 139     const int bang_end_safe = bang_end;
 140 
 141     if (frame_size_in_bytes > page_size) {
 142       bang_end += frame_size_in_bytes;
 143     }
 144 
 145     int bang_offset = bang_end_safe;
 146     while (bang_offset <= bang_end) {
 147       // Need at least one stack bang at end of shadow zone.
 148       bang_stack_with_offset(bang_offset);
 149       bang_offset += page_size;
 150     }
 151   } // end (UseStackBanging)
 152 }
 153 
 154 void Label::add_patch_at(CodeBuffer* cb, int branch_loc) {
 155   assert(_loc == -1, "Label is unbound");
 156   // Don't add patch locations during scratch emit.
 157   if (cb->insts()->scratch_emit()) { return; }
 158   if (_patch_index < PatchCacheSize) {
 159     _patches[_patch_index] = branch_loc;
 160   } else {
 161     if (_patch_overflow == NULL) {
 162       _patch_overflow = cb->create_patch_overflow();
 163     }
 164     _patch_overflow->push(branch_loc);
 165   }
 166   ++_patch_index;
 167 }
 168 
 169 void Label::patch_instructions(MacroAssembler* masm) {
 170   assert(is_bound(), "Label is bound");
 171   CodeBuffer* cb = masm->code();
 172   int target_sect = CodeBuffer::locator_sect(loc());
 173   address target = cb->locator_address(loc());
 174   while (_patch_index > 0) {
 175     --_patch_index;
 176     int branch_loc;
 177     if (_patch_index >= PatchCacheSize) {


< prev index next >