126 } |
126 } |
127 |
127 |
128 address TemplateInterpreterGenerator::generate_ClassCastException_handler() { |
128 address TemplateInterpreterGenerator::generate_ClassCastException_handler() { |
129 address entry = __ pc(); |
129 address entry = __ pc(); |
130 |
130 |
131 // object is at TOS |
|
132 //FIXME, I am not sure if the object is at TOS as x86 do now @jerome, 04/20,2007 |
|
133 //__ pop(c_rarg1); |
|
134 |
|
135 // expression stack must be empty before entering the VM if an |
131 // expression stack must be empty before entering the VM if an |
136 // exception happened |
132 // exception happened |
137 __ empty_expression_stack(); |
133 __ empty_expression_stack(); |
138 __ empty_FPU_stack(); |
134 __ empty_FPU_stack(); |
139 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_ClassCastException), FSR); |
135 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_ClassCastException), FSR); |
259 "index out of bounds"); |
255 "index out of bounds"); |
260 return i; |
256 return i; |
261 } |
257 } |
262 |
258 |
263 |
259 |
264 // why do not consider float and double , @jerome, 12/27,06, @jerome |
|
265 //FIXME, aoqi |
|
266 address TemplateInterpreterGenerator::generate_result_handler_for( |
260 address TemplateInterpreterGenerator::generate_result_handler_for( |
267 BasicType type) { |
261 BasicType type) { |
268 address entry = __ pc(); |
262 address entry = __ pc(); |
269 switch (type) { |
263 switch (type) { |
270 case T_BOOLEAN: __ c2bool(V0); break; |
264 case T_BOOLEAN: __ c2bool(V0); break; |
449 #else |
443 #else |
450 Register thread = TREG; |
444 Register thread = TREG; |
451 #endif |
445 #endif |
452 |
446 |
453 // locals + overhead, in bytes |
447 // locals + overhead, in bytes |
454 //FIXME aoqi |
|
455 __ dsll(T3, T2, Interpreter::stackElementScale()); |
448 __ dsll(T3, T2, Interpreter::stackElementScale()); |
456 __ daddiu(T3, T3, overhead_size); // locals * 4 + overhead_size --> T3 |
449 __ daddiu(T3, T3, overhead_size); // locals * 4 + overhead_size --> T3 |
457 |
450 |
458 #ifdef ASSERT |
451 #ifdef ASSERT |
459 Label stack_base_okay, stack_size_okay; |
452 Label stack_base_okay, stack_size_okay; |
555 int i = 0; |
548 int i = 0; |
556 __ sd(RA, SP, (-1) * wordSize); // save return address |
549 __ sd(RA, SP, (-1) * wordSize); // save return address |
557 __ sd(FP, SP, (-2) * wordSize); // save sender's fp |
550 __ sd(FP, SP, (-2) * wordSize); // save sender's fp |
558 __ daddiu(FP, SP, (-2) * wordSize); |
551 __ daddiu(FP, SP, (-2) * wordSize); |
559 __ sd(Rsender, FP, (-++i) * wordSize); // save sender's sp |
552 __ sd(Rsender, FP, (-++i) * wordSize); // save sender's sp |
560 __ sd(R0, FP,(-++i)*wordSize); //save last_sp as null, FIXME aoqi |
553 __ sd(R0, FP,(-++i)*wordSize); //save last_sp as null |
561 __ sd(LVP, FP, (-++i) * wordSize); // save locals offset |
554 __ sd(LVP, FP, (-++i) * wordSize); // save locals offset |
562 __ ld(BCP, Rmethod, in_bytes(Method::const_offset())); // get constMethodOop |
555 __ ld(BCP, Rmethod, in_bytes(Method::const_offset())); // get constMethodOop |
563 __ daddiu(BCP, BCP, in_bytes(ConstMethod::codes_offset())); // get codebase |
556 __ daddiu(BCP, BCP, in_bytes(ConstMethod::codes_offset())); // get codebase |
564 __ sd(Rmethod, FP, (-++i) * wordSize); // save Method* |
557 __ sd(Rmethod, FP, (-++i) * wordSize); // save Method* |
565 #ifndef CORE |
558 #ifndef CORE |
1044 __ get_method(method); |
1037 __ get_method(method); |
1045 __ verify_oop(method); |
1038 __ verify_oop(method); |
1046 { |
1039 { |
1047 Label L, Lstatic; |
1040 Label L, Lstatic; |
1048 __ ld(t,method,in_bytes(Method::const_offset())); |
1041 __ ld(t,method,in_bytes(Method::const_offset())); |
1049 __ lhu(t, t, in_bytes(ConstMethod::size_of_parameters_offset())); // Fu: 20130814 |
1042 __ lhu(t, t, in_bytes(ConstMethod::size_of_parameters_offset())); |
1050 // MIPS n64 ABI: caller does not reserve space for the register auguments. |
1043 // MIPS n64 ABI: caller does not reserve space for the register auguments. |
1051 //FIXME, aoqi: A1? |
|
1052 // A0 and A1(if needed) |
1044 // A0 and A1(if needed) |
1053 __ lw(AT, Rmethod, in_bytes(Method::access_flags_offset())); |
1045 __ lw(AT, Rmethod, in_bytes(Method::access_flags_offset())); |
1054 __ andi(AT, AT, JVM_ACC_STATIC); |
1046 __ andi(AT, AT, JVM_ACC_STATIC); |
1055 __ beq(AT, R0, Lstatic); |
1047 __ beq(AT, R0, Lstatic); |
1056 __ delayed()->nop(); |
1048 __ delayed()->nop(); |
1196 // native function in T9 |
1188 // native function in T9 |
1197 #ifndef OPT_THREAD |
1189 #ifndef OPT_THREAD |
1198 __ get_thread(thread); |
1190 __ get_thread(thread); |
1199 #endif |
1191 #endif |
1200 __ daddi(t, thread, in_bytes(JavaThread::jni_environment_offset())); |
1192 __ daddi(t, thread, in_bytes(JavaThread::jni_environment_offset())); |
1201 // stack,but I think it won't work when pass float,double etc @jerome,10/17,2006 |
|
1202 __ move(A0, t); |
1193 __ move(A0, t); |
1203 // [ jni environment ] <--- sp |
1194 // [ jni environment ] <--- sp |
1204 // [ mthd holder mirror ptr ] ---------------------------->| (only for static method) |
1195 // [ mthd holder mirror ptr ] ---------------------------->| (only for static method) |
1205 // [ ] | |
1196 // [ ] | |
1206 // ... size of parameters | |
1197 // ... size of parameters | |
2182 address entry = __ pc(); |
2173 address entry = __ pc(); |
2183 |
2174 |
2184 // prepare expression stack |
2175 // prepare expression stack |
2185 __ push(state); // save tosca |
2176 __ push(state); // save tosca |
2186 |
2177 |
2187 // tos & tos2, added by yjl 7/15/2005 |
2178 // tos & tos2 |
2188 // trace_bytecode need actually 4 args, the last two is tos&tos2 |
2179 // trace_bytecode need actually 4 args, the last two is tos&tos2 |
2189 // this work fine for x86. but mips o32 call convention will store A2-A3 |
2180 // this work fine for x86. but mips o32 call convention will store A2-A3 |
2190 // to the stack position it think is the tos&tos2 |
2181 // to the stack position it think is the tos&tos2 |
2191 // when the expression stack have no more than 2 data, error occur. |
2182 // when the expression stack have no more than 2 data, error occur. |
2192 __ ld(A2, SP, 0); |
2183 __ ld(A2, SP, 0); |