1350 1351 // Emit deopt handler code. 1352 int emit_deopt_handler(CodeBuffer& cbuf) { 1353 1354 // Note that the code buffer's insts_mark is always relative to insts. 1355 // That's why we must use the macroassembler to generate a handler. 1356 MacroAssembler _masm(&cbuf); 1357 address base = 1358 __ start_a_stub(size_exception_handler()); 1359 if (base == NULL) return 0; // CodeBuffer::expand failed 1360 int offset = __ offset(); 1361 InternalAddress here(__ pc()); 1362 __ pushptr(here.addr()); 1363 1364 __ jump(RuntimeAddress(SharedRuntime::deopt_blob()->unpack())); 1365 assert(__ offset() - offset <= (int) size_deopt_handler(), "overflow"); 1366 __ end_a_stub(); 1367 return offset; 1368 } 1369 1370 1371 const bool Matcher::match_rule_supported(int opcode) { 1372 if (!has_match_rule(opcode)) 1373 return false; 1374 1375 switch (opcode) { 1376 case Op_PopCountI: 1377 case Op_PopCountL: 1378 if (!UsePopCountInstruction) 1379 return false; 1380 break; 1381 } 1382 1383 return true; // Per default match rules are supported. 1384 } 1385 1386 int Matcher::regnum_to_fpu_offset(int regnum) { 1387 return regnum - 32; // The FP registers are in the second chunk 1388 } 1389 1390 // This is UltraSparc specific, true just means we have fast l2f conversion 1391 const bool Matcher::convL2FSupported(void) { 1392 return true; 1393 } 1394 1395 // Is this branch offset short enough that a short branch can be used? 1396 // 1397 // NOTE: If the platform does not provide any short branch variants, then 1398 // this method should return false for offset 0. 1399 bool Matcher::is_short_branch_offset(int rule, int br_size, int offset) { 1400 // The passed offset is relative to address of the branch. 1401 // On 86 a branch displacement is calculated relative to address 1402 // of a next instruction. 1403 offset -= br_size; 1404 1405 // the short version of jmpConUCF2 contains multiple branches, | 1350 1351 // Emit deopt handler code. 1352 int emit_deopt_handler(CodeBuffer& cbuf) { 1353 1354 // Note that the code buffer's insts_mark is always relative to insts. 1355 // That's why we must use the macroassembler to generate a handler. 1356 MacroAssembler _masm(&cbuf); 1357 address base = 1358 __ start_a_stub(size_exception_handler()); 1359 if (base == NULL) return 0; // CodeBuffer::expand failed 1360 int offset = __ offset(); 1361 InternalAddress here(__ pc()); 1362 __ pushptr(here.addr()); 1363 1364 __ jump(RuntimeAddress(SharedRuntime::deopt_blob()->unpack())); 1365 assert(__ offset() - offset <= (int) size_deopt_handler(), "overflow"); 1366 __ end_a_stub(); 1367 return offset; 1368 } 1369 1370 int Matcher::regnum_to_fpu_offset(int regnum) { 1371 return regnum - 32; // The FP registers are in the second chunk 1372 } 1373 1374 // This is UltraSparc specific, true just means we have fast l2f conversion 1375 const bool Matcher::convL2FSupported(void) { 1376 return true; 1377 } 1378 1379 // Is this branch offset short enough that a short branch can be used? 1380 // 1381 // NOTE: If the platform does not provide any short branch variants, then 1382 // this method should return false for offset 0. 1383 bool Matcher::is_short_branch_offset(int rule, int br_size, int offset) { 1384 // The passed offset is relative to address of the branch. 1385 // On 86 a branch displacement is calculated relative to address 1386 // of a next instruction. 1387 offset -= br_size; 1388 1389 // the short version of jmpConUCF2 contains multiple branches, |