Mercurial > hg > truffle
comparison src/share/vm/opto/output.cpp @ 1748:3e8fbc61cee8
6978355: renaming for 6961697
Summary: This is the renaming part of 6961697 to keep the actual changes small for review.
Reviewed-by: kvn, never
author | twisti |
---|---|
date | Wed, 25 Aug 2010 05:27:54 -0700 |
parents | 0e09207fc81b |
children | f95d63e2154a |
comparison
equal
deleted
inserted
replaced
1747:53dbe853fb3a | 1748:3e8fbc61cee8 |
---|---|
1182 // Define the label at the beginning of the basic block | 1182 // Define the label at the beginning of the basic block |
1183 if( labels_not_set ) | 1183 if( labels_not_set ) |
1184 MacroAssembler(cb).bind( blk_labels[b->_pre_order] ); | 1184 MacroAssembler(cb).bind( blk_labels[b->_pre_order] ); |
1185 | 1185 |
1186 else | 1186 else |
1187 assert( blk_labels[b->_pre_order].loc_pos() == cb->code_size(), | 1187 assert( blk_labels[b->_pre_order].loc_pos() == cb->insts_size(), |
1188 "label position does not match code offset" ); | 1188 "label position does not match code offset" ); |
1189 | 1189 |
1190 uint last_inst = b->_nodes.size(); | 1190 uint last_inst = b->_nodes.size(); |
1191 | 1191 |
1192 // Emit block normally, except for last instruction. | 1192 // Emit block normally, except for last instruction. |
1223 bool is_sfn = n->is_MachSafePoint(); | 1223 bool is_sfn = n->is_MachSafePoint(); |
1224 | 1224 |
1225 // If this requires all previous instructions be flushed, then do so | 1225 // If this requires all previous instructions be flushed, then do so |
1226 if( is_sfn || is_mcall || mach->alignment_required() != 1) { | 1226 if( is_sfn || is_mcall || mach->alignment_required() != 1) { |
1227 cb->flush_bundle(true); | 1227 cb->flush_bundle(true); |
1228 current_offset = cb->code_size(); | 1228 current_offset = cb->insts_size(); |
1229 } | 1229 } |
1230 | 1230 |
1231 // align the instruction if necessary | 1231 // align the instruction if necessary |
1232 int padding = mach->compute_padding(current_offset); | 1232 int padding = mach->compute_padding(current_offset); |
1233 // Make sure safepoint node for polling is distinct from a call's | 1233 // Make sure safepoint node for polling is distinct from a call's |
1244 b->_nodes.insert(j++, nop); | 1244 b->_nodes.insert(j++, nop); |
1245 last_inst++; | 1245 last_inst++; |
1246 _cfg->_bbs.map( nop->_idx, b ); | 1246 _cfg->_bbs.map( nop->_idx, b ); |
1247 nop->emit(*cb, _regalloc); | 1247 nop->emit(*cb, _regalloc); |
1248 cb->flush_bundle(true); | 1248 cb->flush_bundle(true); |
1249 current_offset = cb->code_size(); | 1249 current_offset = cb->insts_size(); |
1250 } | 1250 } |
1251 | 1251 |
1252 // Remember the start of the last call in a basic block | 1252 // Remember the start of the last call in a basic block |
1253 if (is_mcall) { | 1253 if (is_mcall) { |
1254 MachCallNode *mcall = mach->as_MachCall(); | 1254 MachCallNode *mcall = mach->as_MachCall(); |
1346 } | 1346 } |
1347 | 1347 |
1348 // Save the offset for the listing | 1348 // Save the offset for the listing |
1349 #ifndef PRODUCT | 1349 #ifndef PRODUCT |
1350 if( node_offsets && n->_idx < node_offset_limit ) | 1350 if( node_offsets && n->_idx < node_offset_limit ) |
1351 node_offsets[n->_idx] = cb->code_size(); | 1351 node_offsets[n->_idx] = cb->insts_size(); |
1352 #endif | 1352 #endif |
1353 | 1353 |
1354 // "Normal" instruction case | 1354 // "Normal" instruction case |
1355 n->emit(*cb, _regalloc); | 1355 n->emit(*cb, _regalloc); |
1356 current_offset = cb->code_size(); | 1356 current_offset = cb->insts_size(); |
1357 non_safepoints.observe_instruction(n, current_offset); | 1357 non_safepoints.observe_instruction(n, current_offset); |
1358 | 1358 |
1359 // mcall is last "call" that can be a safepoint | 1359 // mcall is last "call" that can be a safepoint |
1360 // record it so we can see if a poll will directly follow it | 1360 // record it so we can see if a poll will directly follow it |
1361 // in which case we'll need a pad to make the PcDesc sites unique | 1361 // in which case we'll need a pad to make the PcDesc sites unique |
1370 // See if this instruction has a delay slot | 1370 // See if this instruction has a delay slot |
1371 if ( valid_bundle_info(n) && node_bundling(n)->use_unconditional_delay()) { | 1371 if ( valid_bundle_info(n) && node_bundling(n)->use_unconditional_delay()) { |
1372 assert(delay_slot != NULL, "expecting delay slot node"); | 1372 assert(delay_slot != NULL, "expecting delay slot node"); |
1373 | 1373 |
1374 // Back up 1 instruction | 1374 // Back up 1 instruction |
1375 cb->set_code_end( | 1375 cb->set_insts_end(cb->insts_end() - Pipeline::instr_unit_size()); |
1376 cb->code_end()-Pipeline::instr_unit_size()); | |
1377 | 1376 |
1378 // Save the offset for the listing | 1377 // Save the offset for the listing |
1379 #ifndef PRODUCT | 1378 #ifndef PRODUCT |
1380 if( node_offsets && delay_slot->_idx < node_offset_limit ) | 1379 if( node_offsets && delay_slot->_idx < node_offset_limit ) |
1381 node_offsets[delay_slot->_idx] = cb->code_size(); | 1380 node_offsets[delay_slot->_idx] = cb->insts_size(); |
1382 #endif | 1381 #endif |
1383 | 1382 |
1384 // Support a SafePoint in the delay slot | 1383 // Support a SafePoint in the delay slot |
1385 if( delay_slot->is_MachSafePoint() ) { | 1384 if( delay_slot->is_MachSafePoint() ) { |
1386 MachNode *mach = delay_slot->as_Mach(); | 1385 MachNode *mach = delay_slot->as_Mach(); |
1418 if( padding > 0 ) { | 1417 if( padding > 0 ) { |
1419 MachNode *nop = new (this) MachNopNode(padding / nop_size); | 1418 MachNode *nop = new (this) MachNopNode(padding / nop_size); |
1420 b->_nodes.insert( b->_nodes.size(), nop ); | 1419 b->_nodes.insert( b->_nodes.size(), nop ); |
1421 _cfg->_bbs.map( nop->_idx, b ); | 1420 _cfg->_bbs.map( nop->_idx, b ); |
1422 nop->emit(*cb, _regalloc); | 1421 nop->emit(*cb, _regalloc); |
1423 current_offset = cb->code_size(); | 1422 current_offset = cb->insts_size(); |
1424 } | 1423 } |
1425 } | 1424 } |
1426 | 1425 |
1427 } // End of for all blocks | 1426 } // End of for all blocks |
1428 | 1427 |
1435 MacroAssembler(cb).bind( blk_labels[_cfg->_num_blocks] ); | 1434 MacroAssembler(cb).bind( blk_labels[_cfg->_num_blocks] ); |
1436 | 1435 |
1437 // Compute the size of the first block | 1436 // Compute the size of the first block |
1438 _first_block_size = blk_labels[1].loc_pos() - blk_labels[0].loc_pos(); | 1437 _first_block_size = blk_labels[1].loc_pos() - blk_labels[0].loc_pos(); |
1439 | 1438 |
1440 assert(cb->code_size() < 500000, "method is unreasonably large"); | 1439 assert(cb->insts_size() < 500000, "method is unreasonably large"); |
1441 | 1440 |
1442 // ------------------ | 1441 // ------------------ |
1443 | 1442 |
1444 #ifndef PRODUCT | 1443 #ifndef PRODUCT |
1445 // Information on the size of the method, without the extraneous code | 1444 // Information on the size of the method, without the extraneous code |
1446 Scheduling::increment_method_size(cb->code_size()); | 1445 Scheduling::increment_method_size(cb->insts_size()); |
1447 #endif | 1446 #endif |
1448 | 1447 |
1449 // ------------------ | 1448 // ------------------ |
1450 // Fill in exception table entries. | 1449 // Fill in exception table entries. |
1451 FillExceptionTables(inct_cnt, call_returns, inct_starts, blk_labels); | 1450 FillExceptionTables(inct_cnt, call_returns, inct_starts, blk_labels); |