equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
1204 current_offset == last_avoid_back_to_back_offset) { |
1204 current_offset == last_avoid_back_to_back_offset) { |
1205 // Avoid back to back some instructions. |
1205 // Avoid back to back some instructions. |
1206 padding = nop_size; |
1206 padding = nop_size; |
1207 } |
1207 } |
1208 |
1208 |
1209 if(padding > 0) { |
1209 if (padding > 0) { |
1210 assert((padding % nop_size) == 0, "padding is not a multiple of NOP size"); |
1210 assert((padding % nop_size) == 0, "padding is not a multiple of NOP size"); |
1211 int nops_cnt = padding / nop_size; |
1211 int nops_cnt = padding / nop_size; |
1212 MachNode *nop = new MachNopNode(nops_cnt); |
1212 MachNode *nop = new MachNopNode(nops_cnt); |
1213 block->insert_node(nop, j++); |
1213 block->insert_node(nop, j++); |
1214 last_inst++; |
1214 last_inst++; |
1215 _cfg->map_node_to_block(nop, block); |
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 return; |
|
1221 } |
1216 nop->emit(*cb, _regalloc); |
1222 nop->emit(*cb, _regalloc); |
1217 cb->flush_bundle(true); |
1223 cb->flush_bundle(true); |
1218 current_offset = cb->insts_size(); |
1224 current_offset = cb->insts_size(); |
1219 } |
1225 } |
1220 |
1226 |