< prev index next >

src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp

Print this page

2158                                                          address& fep,
2159                                                          address& dep,
2160                                                          address& vep) {
2161   assert(t->is_valid() && t->tos_in() == vtos, "illegal template");
2162   Label L;
2163 
2164   aep = __ pc();  __ push_ptr();  __ b(L);
2165   fep = __ pc();  __ push_f();    __ b(L);
2166   dep = __ pc();  __ push_d();    __ b(L);
2167   lep = __ pc();  __ push_l();    __ b(L);
2168   __ align(32, 12, 24); // align L
2169   bep = cep = sep =
2170   iep = __ pc();  __ push_i();
2171   vep = __ pc();
2172   __ bind(L);
2173   generate_and_dispatch(t);
2174 }
2175 
2176 //-----------------------------------------------------------------------------
2177 














2178 // Non-product code
2179 #ifndef PRODUCT
2180 address TemplateInterpreterGenerator::generate_trace_code(TosState state) {
2181   //__ flush_bundle();
2182   address entry = __ pc();
2183 
2184   const char *bname = nullptr;
2185   uint tsize = 0;
2186   switch(state) {
2187   case ftos:
2188     bname = "trace_code_ftos {";
2189     tsize = 2;
2190     break;
2191   case btos:
2192     bname = "trace_code_btos {";
2193     tsize = 2;
2194     break;
2195   case ztos:
2196     bname = "trace_code_ztos {";
2197     tsize = 2;

2245     __ blt(CCR0, Lskip_vm_call);
2246   }
2247 
2248   __ push(state);
2249   // Load 2 topmost expression stack values.
2250   __ ld(R6_ARG4, tsize*Interpreter::stackElementSize, R15_esp);
2251   __ ld(R5_ARG3, Interpreter::stackElementSize, R15_esp);
2252   __ mflr(R31);
2253   __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::trace_bytecode), /* unused */ R4_ARG2, R5_ARG3, R6_ARG4, false);
2254   __ mtlr(R31);
2255   __ pop(state);
2256 
2257   if (TraceBytecodesAt > 0 && TraceBytecodesAt < max_intx) {
2258     __ bind(Lskip_vm_call);
2259   }
2260   __ blr();
2261   BLOCK_COMMENT("} trace_code");
2262   return entry;
2263 }
2264 
2265 void TemplateInterpreterGenerator::count_bytecode() {
2266   int offs = __ load_const_optimized(R11_scratch1, (address) &BytecodeCounter::_counter_value, R12_scratch2, true);
2267   __ lwz(R12_scratch2, offs, R11_scratch1);
2268   __ addi(R12_scratch2, R12_scratch2, 1);
2269   __ stw(R12_scratch2, offs, R11_scratch1);
2270 }
2271 
2272 void TemplateInterpreterGenerator::histogram_bytecode(Template* t) {
2273   int offs = __ load_const_optimized(R11_scratch1, (address) &BytecodeHistogram::_counters[t->bytecode()], R12_scratch2, true);
2274   __ lwz(R12_scratch2, offs, R11_scratch1);
2275   __ addi(R12_scratch2, R12_scratch2, 1);
2276   __ stw(R12_scratch2, offs, R11_scratch1);
2277 }
2278 
2279 void TemplateInterpreterGenerator::histogram_bytecode_pair(Template* t) {
2280   const Register addr = R11_scratch1,
2281                  tmp  = R12_scratch2;
2282   // Get index, shift out old bytecode, bring in new bytecode, and store it.
2283   // _index = (_index >> log2_number_of_codes) |
2284   //          (bytecode << log2_number_of_codes);
2285   int offs1 = __ load_const_optimized(addr, (address)&BytecodePairHistogram::_index, tmp, true);
2286   __ lwz(tmp, offs1, addr);
2287   __ srwi(tmp, tmp, BytecodePairHistogram::log2_number_of_codes);
2288   __ ori(tmp, tmp, ((int) t->bytecode()) << BytecodePairHistogram::log2_number_of_codes);
2289   __ stw(tmp, offs1, addr);
2290 
2291   // Bump bucket contents.
2292   // _counters[_index] ++;
2293   int offs2 = __ load_const_optimized(addr, (address)&BytecodePairHistogram::_counters, R0, true);
2294   __ sldi(tmp, tmp, LogBytesPerInt);
2295   __ add(addr, tmp, addr);
2296   __ lwz(tmp, offs2, addr);
2297   __ addi(tmp, tmp, 1);
2298   __ stw(tmp, offs2, addr);

2158                                                          address& fep,
2159                                                          address& dep,
2160                                                          address& vep) {
2161   assert(t->is_valid() && t->tos_in() == vtos, "illegal template");
2162   Label L;
2163 
2164   aep = __ pc();  __ push_ptr();  __ b(L);
2165   fep = __ pc();  __ push_f();    __ b(L);
2166   dep = __ pc();  __ push_d();    __ b(L);
2167   lep = __ pc();  __ push_l();    __ b(L);
2168   __ align(32, 12, 24); // align L
2169   bep = cep = sep =
2170   iep = __ pc();  __ push_i();
2171   vep = __ pc();
2172   __ bind(L);
2173   generate_and_dispatch(t);
2174 }
2175 
2176 //-----------------------------------------------------------------------------
2177 
2178 void TemplateInterpreterGenerator::count_bytecode() {
2179   int offs = __ load_const_optimized(R11_scratch1, (address) &BytecodeCounter::_counter_value, R12_scratch2, true);
2180   __ lwz(R12_scratch2, offs, R11_scratch1);
2181   __ addi(R12_scratch2, R12_scratch2, 1);
2182   __ stw(R12_scratch2, offs, R11_scratch1);
2183 }
2184 
2185 void TemplateInterpreterGenerator::histogram_bytecode(Template* t) {
2186   int offs = __ load_const_optimized(R11_scratch1, (address) &BytecodeHistogram::_counters[t->bytecode()], R12_scratch2, true);
2187   __ lwz(R12_scratch2, offs, R11_scratch1);
2188   __ addi(R12_scratch2, R12_scratch2, 1);
2189   __ stw(R12_scratch2, offs, R11_scratch1);
2190 }
2191 
2192 // Non-product code
2193 #ifndef PRODUCT
2194 address TemplateInterpreterGenerator::generate_trace_code(TosState state) {
2195   //__ flush_bundle();
2196   address entry = __ pc();
2197 
2198   const char *bname = nullptr;
2199   uint tsize = 0;
2200   switch(state) {
2201   case ftos:
2202     bname = "trace_code_ftos {";
2203     tsize = 2;
2204     break;
2205   case btos:
2206     bname = "trace_code_btos {";
2207     tsize = 2;
2208     break;
2209   case ztos:
2210     bname = "trace_code_ztos {";
2211     tsize = 2;

2259     __ blt(CCR0, Lskip_vm_call);
2260   }
2261 
2262   __ push(state);
2263   // Load 2 topmost expression stack values.
2264   __ ld(R6_ARG4, tsize*Interpreter::stackElementSize, R15_esp);
2265   __ ld(R5_ARG3, Interpreter::stackElementSize, R15_esp);
2266   __ mflr(R31);
2267   __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::trace_bytecode), /* unused */ R4_ARG2, R5_ARG3, R6_ARG4, false);
2268   __ mtlr(R31);
2269   __ pop(state);
2270 
2271   if (TraceBytecodesAt > 0 && TraceBytecodesAt < max_intx) {
2272     __ bind(Lskip_vm_call);
2273   }
2274   __ blr();
2275   BLOCK_COMMENT("} trace_code");
2276   return entry;
2277 }
2278 














2279 void TemplateInterpreterGenerator::histogram_bytecode_pair(Template* t) {
2280   const Register addr = R11_scratch1,
2281                  tmp  = R12_scratch2;
2282   // Get index, shift out old bytecode, bring in new bytecode, and store it.
2283   // _index = (_index >> log2_number_of_codes) |
2284   //          (bytecode << log2_number_of_codes);
2285   int offs1 = __ load_const_optimized(addr, (address)&BytecodePairHistogram::_index, tmp, true);
2286   __ lwz(tmp, offs1, addr);
2287   __ srwi(tmp, tmp, BytecodePairHistogram::log2_number_of_codes);
2288   __ ori(tmp, tmp, ((int) t->bytecode()) << BytecodePairHistogram::log2_number_of_codes);
2289   __ stw(tmp, offs1, addr);
2290 
2291   // Bump bucket contents.
2292   // _counters[_index] ++;
2293   int offs2 = __ load_const_optimized(addr, (address)&BytecodePairHistogram::_counters, R0, true);
2294   __ sldi(tmp, tmp, LogBytesPerInt);
2295   __ add(addr, tmp, addr);
2296   __ lwz(tmp, offs2, addr);
2297   __ addi(tmp, tmp, 1);
2298   __ stw(tmp, offs2, addr);
< prev index next >