< prev index next >

src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp

Print this page

1122 
1123   // Restore FP/LR, sender_sp and return
1124   __ mov(Rtemp, FP);
1125   __ ldmia(FP, RegisterSet(FP) | RegisterSet(LR));
1126   __ ldr(SP, Address(Rtemp, frame::interpreter_frame_sender_sp_offset * wordSize));
1127 
1128   __ ret();
1129 
1130   if (inc_counter) {
1131     // Handle overflow of counter and compile method
1132     __ bind(invocation_counter_overflow);
1133     generate_counter_overflow(continue_after_compile);
1134   }
1135 
1136   return entry_point;
1137 }
1138 
1139 //
1140 // Generic interpreted method entry to (asm) interpreter
1141 //
1142 address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
1143   // determine code generation flags
1144   bool inc_counter  = UseCompiler || CountCompiledCalls;
1145 
1146   // Rmethod: Method*
1147   // Rthread: thread
1148   // Rsender_sp: sender sp (could differ from SP if we were called via c2i)
1149   // Rparams: pointer to the last parameter in the stack
1150 
1151   address entry_point = __ pc();
1152 
1153   const Register RconstMethod = R3;
1154 
1155 
1156   __ ldr(RconstMethod, Address(Rmethod, Method::const_offset()));
1157 
1158   __ ldrh(R2, Address(RconstMethod, ConstMethod::size_of_parameters_offset()));
1159   __ ldrh(R3, Address(RconstMethod, ConstMethod::size_of_locals_offset()));
1160 
1161   // setup Rlocals
1162   __ sub(Rlocals, Rparams, wordSize);

1237 
1238   // check for synchronized methods
1239   // Must happen AFTER invocation_counter check and stack overflow check,
1240   // so method is not locked if overflows.
1241   //
1242   if (synchronized) {
1243     // Allocate monitor and lock method
1244     lock_method();
1245   } else {
1246     // no synchronization necessary
1247 #ifdef ASSERT
1248       { Label L;
1249         __ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
1250         __ tbz(Rtemp, JVM_ACC_SYNCHRONIZED_BIT, L);
1251         __ stop("method needs synchronization");
1252         __ bind(L);
1253       }
1254 #endif
1255   }
1256 






1257   // start execution
1258 #ifdef ASSERT
1259   { Label L;
1260     __ ldr(Rtemp, Address(FP, frame::interpreter_frame_monitor_block_top_offset * wordSize));
1261     __ cmp(Rtemp, Rstack_top);
1262     __ b(L, eq);
1263     __ stop("broken stack frame setup in interpreter 4");
1264     __ bind(L);
1265   }
1266 #endif
1267   __ check_extended_sp(Rtemp);
1268 
1269   // jvmti support
1270   __ notify_method_entry();
1271 #if R9_IS_SCRATCHED
1272   __ restore_method();
1273 #endif
1274 
1275   __ dispatch_next(vtos);
1276 

1122 
1123   // Restore FP/LR, sender_sp and return
1124   __ mov(Rtemp, FP);
1125   __ ldmia(FP, RegisterSet(FP) | RegisterSet(LR));
1126   __ ldr(SP, Address(Rtemp, frame::interpreter_frame_sender_sp_offset * wordSize));
1127 
1128   __ ret();
1129 
1130   if (inc_counter) {
1131     // Handle overflow of counter and compile method
1132     __ bind(invocation_counter_overflow);
1133     generate_counter_overflow(continue_after_compile);
1134   }
1135 
1136   return entry_point;
1137 }
1138 
1139 //
1140 // Generic interpreted method entry to (asm) interpreter
1141 //
1142 address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized, bool object_init) {
1143   // determine code generation flags
1144   bool inc_counter  = UseCompiler || CountCompiledCalls;
1145 
1146   // Rmethod: Method*
1147   // Rthread: thread
1148   // Rsender_sp: sender sp (could differ from SP if we were called via c2i)
1149   // Rparams: pointer to the last parameter in the stack
1150 
1151   address entry_point = __ pc();
1152 
1153   const Register RconstMethod = R3;
1154 
1155 
1156   __ ldr(RconstMethod, Address(Rmethod, Method::const_offset()));
1157 
1158   __ ldrh(R2, Address(RconstMethod, ConstMethod::size_of_parameters_offset()));
1159   __ ldrh(R3, Address(RconstMethod, ConstMethod::size_of_locals_offset()));
1160 
1161   // setup Rlocals
1162   __ sub(Rlocals, Rparams, wordSize);

1237 
1238   // check for synchronized methods
1239   // Must happen AFTER invocation_counter check and stack overflow check,
1240   // so method is not locked if overflows.
1241   //
1242   if (synchronized) {
1243     // Allocate monitor and lock method
1244     lock_method();
1245   } else {
1246     // no synchronization necessary
1247 #ifdef ASSERT
1248       { Label L;
1249         __ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
1250         __ tbz(Rtemp, JVM_ACC_SYNCHRONIZED_BIT, L);
1251         __ stop("method needs synchronization");
1252         __ bind(L);
1253       }
1254 #endif
1255   }
1256 
1257   // Issue a StoreStore barrier on entry to Object_init if the
1258   // class has strict field fields.  Be lazy, always do it.
1259   if (object_init) {
1260     __ membar(MacroAssembler::StoreStore, R1_tmp);
1261   }
1262 
1263   // start execution
1264 #ifdef ASSERT
1265   { Label L;
1266     __ ldr(Rtemp, Address(FP, frame::interpreter_frame_monitor_block_top_offset * wordSize));
1267     __ cmp(Rtemp, Rstack_top);
1268     __ b(L, eq);
1269     __ stop("broken stack frame setup in interpreter 4");
1270     __ bind(L);
1271   }
1272 #endif
1273   __ check_extended_sp(Rtemp);
1274 
1275   // jvmti support
1276   __ notify_method_entry();
1277 #if R9_IS_SCRATCHED
1278   __ restore_method();
1279 #endif
1280 
1281   __ dispatch_next(vtos);
1282 
< prev index next >