< prev index next >

src/share/vm/opto/output.cpp

Print this page
rev 12113 : 8166561: [s390] Adaptions needed for s390 port in C1 and C2.


1196         // align the instruction if necessary
1197         int padding = mach->compute_padding(current_offset);
1198         // Make sure safepoint node for polling is distinct from a call's
1199         // return by adding a nop if needed.
1200         if (is_sfn && !is_mcall && padding == 0 && current_offset == last_call_offset) {
1201           padding = nop_size;
1202         }
1203         if (padding == 0 && mach->avoid_back_to_back(MachNode::AVOID_BEFORE) &&
1204             current_offset == last_avoid_back_to_back_offset) {
1205           // Avoid back to back some instructions.
1206           padding = nop_size;
1207         }
1208 
1209         if(padding > 0) {
1210           assert((padding % nop_size) == 0, "padding is not a multiple of NOP size");
1211           int nops_cnt = padding / nop_size;
1212           MachNode *nop = new MachNopNode(nops_cnt);
1213           block->insert_node(nop, j++);
1214           last_inst++;
1215           _cfg->map_node_to_block(nop, block);







1216           nop->emit(*cb, _regalloc);
1217           cb->flush_bundle(true);
1218           current_offset = cb->insts_size();
1219         }
1220 
1221         // Remember the start of the last call in a basic block
1222         if (is_mcall) {
1223           MachCallNode *mcall = mach->as_MachCall();
1224 
1225           // This destination address is NOT PC-relative
1226           mcall->method_set((intptr_t)mcall->entry_point());
1227 
1228           // Save the return address
1229           call_returns[block->_pre_order] = current_offset + mcall->ret_addr_offset();
1230 
1231           if (mcall->is_MachCallLeaf()) {
1232             is_mcall = false;
1233             is_sfn = false;
1234           }
1235         }




1196         // align the instruction if necessary
1197         int padding = mach->compute_padding(current_offset);
1198         // Make sure safepoint node for polling is distinct from a call's
1199         // return by adding a nop if needed.
1200         if (is_sfn && !is_mcall && padding == 0 && current_offset == last_call_offset) {
1201           padding = nop_size;
1202         }
1203         if (padding == 0 && mach->avoid_back_to_back(MachNode::AVOID_BEFORE) &&
1204             current_offset == last_avoid_back_to_back_offset) {
1205           // Avoid back to back some instructions.
1206           padding = nop_size;
1207         }
1208 
1209         if(padding > 0) {
1210           assert((padding % nop_size) == 0, "padding is not a multiple of NOP size");
1211           int nops_cnt = padding / nop_size;
1212           MachNode *nop = new MachNopNode(nops_cnt);
1213           block->insert_node(nop, j++);
1214           last_inst++;
1215           _cfg->map_node_to_block(nop, block);
1216           // Ensure enough space.
1217           cb->insts()->maybe_expand_to_ensure_remaining(MAX_inst_size);
1218           if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) {
1219             C->record_failure("CodeCache is full");
1220             CompileBroker::handle_full_code_cache(CodeCache::get_code_blob_type(((nmethod*)cb)->comp_level()));
1221             return;
1222           }
1223           nop->emit(*cb, _regalloc);
1224           cb->flush_bundle(true);
1225           current_offset = cb->insts_size();
1226         }
1227 
1228         // Remember the start of the last call in a basic block
1229         if (is_mcall) {
1230           MachCallNode *mcall = mach->as_MachCall();
1231 
1232           // This destination address is NOT PC-relative
1233           mcall->method_set((intptr_t)mcall->entry_point());
1234 
1235           // Save the return address
1236           call_returns[block->_pre_order] = current_offset + mcall->ret_addr_offset();
1237 
1238           if (mcall->is_MachCallLeaf()) {
1239             is_mcall = false;
1240             is_sfn = false;
1241           }
1242         }


< prev index next >