1184 uint scratch_emit_size(const Node* n); |
1182 uint scratch_emit_size(const Node* n); |
1185 void set_in_scratch_emit_size(bool x) { _in_scratch_emit_size = x; } |
1183 void set_in_scratch_emit_size(bool x) { _in_scratch_emit_size = x; } |
1186 bool in_scratch_emit_size() const { return _in_scratch_emit_size; } |
1184 bool in_scratch_emit_size() const { return _in_scratch_emit_size; } |
1187 |
1185 |
1188 enum ScratchBufferBlob { |
1186 enum ScratchBufferBlob { |
1189 #if defined(PPC64) |
|
1190 MAX_inst_size = 2048, |
1187 MAX_inst_size = 2048, |
1191 #else |
|
1192 MAX_inst_size = 1024, |
|
1193 #endif |
|
1194 MAX_locs_size = 128, // number of relocInfo elements |
1188 MAX_locs_size = 128, // number of relocInfo elements |
1195 MAX_const_size = 128, |
1189 MAX_const_size = 128, |
1196 MAX_stubs_size = 128 |
1190 MAX_stubs_size = 128 |
1197 }; |
1191 }; |
1198 |
1192 |
1263 ObjectValue* sv ); |
1257 ObjectValue* sv ); |
1264 |
1258 |
1265 // Process an OopMap Element while emitting nodes |
1259 // Process an OopMap Element while emitting nodes |
1266 void Process_OopMap_Node(MachNode *mach, int code_offset); |
1260 void Process_OopMap_Node(MachNode *mach, int code_offset); |
1267 |
1261 |
|
1262 class BufferSizingData { |
|
1263 public: |
|
1264 int _stub; |
|
1265 int _code; |
|
1266 int _const; |
|
1267 int _reloc; |
|
1268 |
|
1269 BufferSizingData() : |
|
1270 _stub(0), |
|
1271 _code(0), |
|
1272 _const(0), |
|
1273 _reloc(0) |
|
1274 { }; |
|
1275 }; |
|
1276 |
1268 // Initialize code buffer |
1277 // Initialize code buffer |
1269 CodeBuffer* init_buffer(uint* blk_starts); |
1278 void estimate_buffer_size(int& const_req); |
|
1279 CodeBuffer* init_buffer(BufferSizingData& buf_sizes); |
1270 |
1280 |
1271 // Write out basic block data to code buffer |
1281 // Write out basic block data to code buffer |
1272 void fill_buffer(CodeBuffer* cb, uint* blk_starts); |
1282 void fill_buffer(CodeBuffer* cb, uint* blk_starts); |
1273 |
1283 |
1274 // Determine which variable sized branches can be shortened |
1284 // Determine which variable sized branches can be shortened |
1275 void shorten_branches(uint* blk_starts, int& code_size, int& reloc_size, int& stub_size); |
1285 void shorten_branches(uint* blk_starts, BufferSizingData& buf_sizes); |
1276 |
1286 |
1277 // Compute the size of first NumberOfLoopInstrToAlign instructions |
1287 // Compute the size of first NumberOfLoopInstrToAlign instructions |
1278 // at the head of a loop. |
1288 // at the head of a loop. |
1279 void compute_loop_first_inst_sizes(); |
1289 void compute_loop_first_inst_sizes(); |
1280 |
1290 |