comparison src/cpu/sparc/vm/interp_masm_sparc.cpp @ 23660:b5f3a471e646

Merge.
author Doug Simon <doug.simon@oracle.com>
date Wed, 01 Jun 2016 00:11:44 +0200
parents f84a5ac3be22 32b682649973
children
comparison
equal deleted inserted replaced
23411:d7cf78885a3a 23660:b5f3a471e646
1 /* 1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 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.
209 switch (state) { 209 switch (state) {
210 case ltos: ld_long(val_addr, Otos_l); break; 210 case ltos: ld_long(val_addr, Otos_l); break;
211 case atos: ld_ptr(oop_addr, Otos_l); 211 case atos: ld_ptr(oop_addr, Otos_l);
212 st_ptr(G0, oop_addr); break; 212 st_ptr(G0, oop_addr); break;
213 case btos: // fall through 213 case btos: // fall through
214 case ztos: // fall through
214 case ctos: // fall through 215 case ctos: // fall through
215 case stos: // fall through 216 case stos: // fall through
216 case itos: ld(val_addr, Otos_l1); break; 217 case itos: ld(val_addr, Otos_l1); break;
217 case ftos: ldf(FloatRegisterImpl::S, val_addr, Ftos_f); break; 218 case ftos: ldf(FloatRegisterImpl::S, val_addr, Ftos_f); break;
218 case dtos: ldf(FloatRegisterImpl::D, val_addr, Ftos_d); break; 219 case dtos: ldf(FloatRegisterImpl::D, val_addr, Ftos_d); break;
457 458
458 void InterpreterMacroAssembler::push(TosState state) { 459 void InterpreterMacroAssembler::push(TosState state) {
459 interp_verify_oop(Otos_i, state, __FILE__, __LINE__); 460 interp_verify_oop(Otos_i, state, __FILE__, __LINE__);
460 switch (state) { 461 switch (state) {
461 case atos: push_ptr(); break; 462 case atos: push_ptr(); break;
462 case btos: push_i(); break; 463 case btos: // fall through
463 case ctos: 464 case ztos: // fall through
464 case stos: push_i(); break; 465 case ctos: // fall through
466 case stos: // fall through
465 case itos: push_i(); break; 467 case itos: push_i(); break;
466 case ltos: push_l(); break; 468 case ltos: push_l(); break;
467 case ftos: push_f(); break; 469 case ftos: push_f(); break;
468 case dtos: push_d(); break; 470 case dtos: push_d(); break;
469 case vtos: /* nothing to do */ break; 471 case vtos: /* nothing to do */ break;
473 475
474 476
475 void InterpreterMacroAssembler::pop(TosState state) { 477 void InterpreterMacroAssembler::pop(TosState state) {
476 switch (state) { 478 switch (state) {
477 case atos: pop_ptr(); break; 479 case atos: pop_ptr(); break;
478 case btos: pop_i(); break; 480 case btos: // fall through
479 case ctos: 481 case ztos: // fall through
480 case stos: pop_i(); break; 482 case ctos: // fall through
483 case stos: // fall through
481 case itos: pop_i(); break; 484 case itos: pop_i(); break;
482 case ltos: pop_l(); break; 485 case ltos: pop_l(); break;
483 case ftos: pop_f(); break; 486 case ftos: pop_f(); break;
484 case dtos: pop_d(); break; 487 case dtos: pop_d(); break;
485 case vtos: /* nothing to do */ break; 488 case vtos: /* nothing to do */ break;
1109 bind(no_unlock); 1112 bind(no_unlock);
1110 pop(state); 1113 pop(state);
1111 interp_verify_oop(Otos_i, state, __FILE__, __LINE__); 1114 interp_verify_oop(Otos_i, state, __FILE__, __LINE__);
1112 } 1115 }
1113 1116
1117 void InterpreterMacroAssembler::narrow(Register result) {
1118
1119 ld_ptr(Address(Lmethod, Method::const_offset()), G3_scratch);
1120 ldub(G3_scratch, in_bytes(ConstMethod::result_type_offset()), G3_scratch);
1121
1122 Label notBool, notByte, notChar, done;
1123
1124 // common case first
1125 cmp(G3_scratch, T_INT);
1126 br(Assembler::equal, true, pn, done);
1127 delayed()->nop();
1128
1129 cmp(G3_scratch, T_BOOLEAN);
1130 br(Assembler::notEqual, true, pn, notBool);
1131 delayed()->cmp(G3_scratch, T_BYTE);
1132 and3(result, 1, result);
1133 ba(done);
1134 delayed()->nop();
1135
1136 bind(notBool);
1137 // cmp(G3_scratch, T_BYTE);
1138 br(Assembler::notEqual, true, pn, notByte);
1139 delayed()->cmp(G3_scratch, T_CHAR);
1140 sll(result, 24, result);
1141 sra(result, 24, result);
1142 ba(done);
1143 delayed()->nop();
1144
1145 bind(notByte);
1146 // cmp(G3_scratch, T_CHAR);
1147 sll(result, 16, result);
1148 br(Assembler::notEqual, true, pn, done);
1149 delayed()->sra(result, 16, result);
1150 // sll(result, 16, result);
1151 srl(result, 16, result);
1152
1153 // bind(notChar);
1154 // must be short, instructions already executed in delay slot
1155 // sll(result, 16, result);
1156 // sra(result, 16, result);
1157
1158 bind(done);
1159 }
1114 1160
1115 // remove activation 1161 // remove activation
1116 // 1162 //
1117 // Unlock the receiver if this is a synchronized method. 1163 // Unlock the receiver if this is a synchronized method.
1118 // Unlock any Java monitors from syncronized blocks. 1164 // Unlock any Java monitors from syncronized blocks.
1144 case ltos: mov(Otos_l, Otos_l->after_save()); break; // O0 -> I0 1190 case ltos: mov(Otos_l, Otos_l->after_save()); break; // O0 -> I0
1145 #else 1191 #else
1146 case ltos: mov(Otos_l2, Otos_l2->after_save()); // fall through // O1 -> I1 1192 case ltos: mov(Otos_l2, Otos_l2->after_save()); // fall through // O1 -> I1
1147 #endif 1193 #endif
1148 case btos: // fall through 1194 case btos: // fall through
1195 case ztos: // fall through
1149 case ctos: 1196 case ctos:
1150 case stos: // fall through 1197 case stos: // fall through
1151 case atos: // fall through 1198 case atos: // fall through
1152 case itos: mov(Otos_l1, Otos_l1->after_save()); break; // O0 -> I0 1199 case itos: mov(Otos_l1, Otos_l1->after_save()); break; // O0 -> I0
1153 case ftos: // fall through 1200 case ftos: // fall through