src/cpu/mips/vm/interp_masm_mips_64.cpp

changeset 8858
e3f4d3592615
parent 7999
b57e01e9f81e
child 8863
5376ce0dc552
equal deleted inserted replaced
8857:69619c96717a 8858:e3f4d3592615
217 break; 217 break;
218 case ltos: 218 case ltos:
219 ld_ptr(V0, val_addr); // fall through 219 ld_ptr(V0, val_addr); // fall through
220 break; 220 break;
221 case btos: // fall through 221 case btos: // fall through
222 case ztos: // fall through
222 case ctos: // fall through 223 case ctos: // fall through
223 case stos: // fall through 224 case stos: // fall through
224 case itos: 225 case itos:
225 lw(V0, val_addr); 226 lw(V0, val_addr);
226 break; 227 break;
464 465
465 void InterpreterMacroAssembler::pop(TosState state) { 466 void InterpreterMacroAssembler::pop(TosState state) {
466 switch (state) { 467 switch (state) {
467 case atos: pop_ptr(); break; 468 case atos: pop_ptr(); break;
468 case btos: 469 case btos:
470 case ztos:
469 case ctos: 471 case ctos:
470 case stos: 472 case stos:
471 case itos: pop_i(); break; 473 case itos: pop_i(); break;
472 case ltos: pop_l(); break; 474 case ltos: pop_l(); break;
473 case ftos: pop_f(); break; 475 case ftos: pop_f(); break;
482 void InterpreterMacroAssembler::push(TosState state) { 484 void InterpreterMacroAssembler::push(TosState state) {
483 verify_oop(FSR, state); 485 verify_oop(FSR, state);
484 switch (state) { 486 switch (state) {
485 case atos: push_ptr(); break; 487 case atos: push_ptr(); break;
486 case btos: 488 case btos:
489 case ztos:
487 case ctos: 490 case ctos:
488 case stos: 491 case stos:
489 case itos: push_i(); break; 492 case itos: push_i(); break;
490 case ltos: push_l(); break; 493 case ltos: push_l(); break;
491 case ftos: push_f(); break; 494 case ftos: push_f(); break;
570 dsll(T2, Rnext, LogBytesPerWord); 573 dsll(T2, Rnext, LogBytesPerWord);
571 574
572 if((long)table >= (long)Interpreter::dispatch_table(btos) && 575 if((long)table >= (long)Interpreter::dispatch_table(btos) &&
573 (long)table <= (long)Interpreter::dispatch_table(vtos) 576 (long)table <= (long)Interpreter::dispatch_table(vtos)
574 ) { 577 ) {
575 int table_size = (long)Interpreter::dispatch_table(ctos) - (long)Interpreter::dispatch_table(btos); 578 int table_size = (long)Interpreter::dispatch_table(itos) - (long)Interpreter::dispatch_table(stos);
576 int table_offset = ((int)state - (int)itos) * table_size; 579 int table_offset = ((int)state - (int)itos) * table_size;
577 580
578 // 2013/12/17 Fu: GP points to the starting address of Interpreter::dispatch_table(itos). 581 // 2013/12/17 Fu: GP points to the starting address of Interpreter::dispatch_table(itos).
579 // See StubGenerator::generate_call_stub(address& return_address) for the initialization of GP. 582 // See StubGenerator::generate_call_stub(address& return_address) for the initialization of GP.
580 if(table_offset != 0) { 583 if(table_offset != 0) {
1624 1627
1625 bind(profile_continue); 1628 bind(profile_continue);
1626 } 1629 }
1627 } 1630 }
1628 1631
1632
1633 void InterpreterMacroAssembler::narrow(Register result) {
1634
1635 // Get method->_constMethod->_result_type
1636 ld(T9, FP, frame::interpreter_frame_method_offset * wordSize);
1637 ld(T9, T9, in_bytes(Method::const_offset()));
1638 lbu(T9, T9, in_bytes(ConstMethod::result_type_offset()));
1639
1640 Label done, notBool, notByte, notChar;
1641
1642 // common case first
1643 addiu(AT, T9, -T_INT);
1644 beq(AT, R0, done);
1645 nop();
1646
1647 // mask integer result to narrower return type.
1648 addiu(AT, T9, -T_BOOLEAN);
1649 bne(AT, R0, notBool);
1650 nop();
1651 andi(result, result, 0x1);
1652 beq(R0, R0, done);
1653 nop();
1654
1655 bind(notBool);
1656 addiu(AT, T9, -T_BYTE);
1657 bne(AT, R0, notByte);
1658 nop();
1659 seb(result, result);
1660 beq(R0, R0, done);
1661 nop();
1662
1663 bind(notByte);
1664 addiu(AT, T9, -T_CHAR);
1665 bne(AT, R0, notChar);
1666 nop();
1667 andi(result, result, 0xFFFF);
1668 beq(R0, R0, done);
1669 nop();
1670
1671 bind(notChar);
1672 seh(result, result);
1673
1674 // Nothing to do for T_INT
1675 bind(done);
1676 }
1677
1678
1629 void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& mdo_addr) { 1679 void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& mdo_addr) {
1630 Label update, next, none; 1680 Label update, next, none;
1631 1681
1632 verify_oop(obj); 1682 verify_oop(obj);
1633 1683

mercurial