1994 address& iep,
1995 address& lep,
1996 address& fep,
1997 address& dep,
1998 address& vep) {
1999 assert(t->is_valid() && t->tos_in() == vtos, "illegal template");
2000 Label L;
2001 aep = __ pc(); __ push_ptr(); __ b(L);
2002 fep = __ pc(); __ push_f(); __ b(L);
2003 dep = __ pc(); __ push_d(); __ b(L);
2004 lep = __ pc(); __ push_l(); __ b(L);
2005 bep = cep = sep =
2006 iep = __ pc(); __ push_i();
2007 vep = __ pc();
2008 __ bind(L);
2009 generate_and_dispatch(t);
2010 }
2011
2012 //-----------------------------------------------------------------------------
2013
2014 // Non-product code
2015 #ifndef PRODUCT
2016 address TemplateInterpreterGenerator::generate_trace_code(TosState state) {
2017 address entry = __ pc();
2018
2019 __ protect_return_address();
2020 __ push(lr);
2021 __ push(state);
2022 __ push(RegSet::range(r0, r15), sp);
2023 __ mov(c_rarg2, r0); // Pass itos
2024 __ call_VM(noreg,
2025 CAST_FROM_FN_PTR(address, InterpreterRuntime::trace_bytecode),
2026 c_rarg1, c_rarg2, c_rarg3);
2027 __ pop(RegSet::range(r0, r15), sp);
2028 __ pop(state);
2029 __ pop(lr);
2030 __ authenticate_return_address();
2031 __ ret(lr); // return from result handler
2032
2033 return entry;
2034 }
2035
2036 void TemplateInterpreterGenerator::count_bytecode() {
2037 __ mov(r10, (address) &BytecodeCounter::_counter_value);
2038 __ atomic_addw(noreg, 1, r10);
2039 }
2040
2041 void TemplateInterpreterGenerator::histogram_bytecode(Template* t) {
2042 __ mov(r10, (address) &BytecodeHistogram::_counters[t->bytecode()]);
2043 __ atomic_addw(noreg, 1, r10);
2044 }
2045
2046 void TemplateInterpreterGenerator::histogram_bytecode_pair(Template* t) {
2047 // Calculate new index for counter:
2048 // _index = (_index >> log2_number_of_codes) |
2049 // (bytecode << log2_number_of_codes);
2050 Register index_addr = rscratch1;
2051 Register index = rscratch2;
2052 __ mov(index_addr, (address) &BytecodePairHistogram::_index);
2053 __ ldrw(index, index_addr);
2054 __ mov(r10,
2055 ((int)t->bytecode()) << BytecodePairHistogram::log2_number_of_codes);
2056 __ orrw(index, r10, index, Assembler::LSR,
2057 BytecodePairHistogram::log2_number_of_codes);
2058 __ strw(index, index_addr);
2059
2060 // Bump bucket contents:
2061 // _counters[_index] ++;
2062 Register counter_addr = rscratch1;
2063 __ mov(r10, (address) &BytecodePairHistogram::_counters);
2064 __ lea(counter_addr, Address(r10, index, Address::lsl(LogBytesPerInt)));
2065 __ atomic_addw(noreg, 1, counter_addr);
|
1994 address& iep,
1995 address& lep,
1996 address& fep,
1997 address& dep,
1998 address& vep) {
1999 assert(t->is_valid() && t->tos_in() == vtos, "illegal template");
2000 Label L;
2001 aep = __ pc(); __ push_ptr(); __ b(L);
2002 fep = __ pc(); __ push_f(); __ b(L);
2003 dep = __ pc(); __ push_d(); __ b(L);
2004 lep = __ pc(); __ push_l(); __ b(L);
2005 bep = cep = sep =
2006 iep = __ pc(); __ push_i();
2007 vep = __ pc();
2008 __ bind(L);
2009 generate_and_dispatch(t);
2010 }
2011
2012 //-----------------------------------------------------------------------------
2013
2014 void TemplateInterpreterGenerator::count_bytecode() {
2015 if (CountBytecodesPerThread) {
2016 Address bc_counter_addr(rthread, Thread::bc_counter_offset());
2017 __ ldr(r10, bc_counter_addr);
2018 __ add(r10, r10, 1);
2019 __ str(r10, bc_counter_addr);
2020 }
2021 if (CountBytecodes || TraceBytecodes || StopInterpreterAt > 0) {
2022 __ mov(r10, (address) &BytecodeCounter::_counter_value);
2023 __ atomic_add(noreg, 1, r10);
2024 }
2025 }
2026
2027 void TemplateInterpreterGenerator::histogram_bytecode(Template* t) {
2028 __ mov(r10, (address) &BytecodeHistogram::_counters[t->bytecode()]);
2029 __ atomic_addw(noreg, 1, r10);
2030 }
2031
2032 // Non-product code
2033 #ifndef PRODUCT
2034 address TemplateInterpreterGenerator::generate_trace_code(TosState state) {
2035 address entry = __ pc();
2036
2037 __ protect_return_address();
2038 __ push(lr);
2039 __ push(state);
2040 __ push(RegSet::range(r0, r15), sp);
2041 __ mov(c_rarg2, r0); // Pass itos
2042 __ call_VM(noreg,
2043 CAST_FROM_FN_PTR(address, InterpreterRuntime::trace_bytecode),
2044 c_rarg1, c_rarg2, c_rarg3);
2045 __ pop(RegSet::range(r0, r15), sp);
2046 __ pop(state);
2047 __ pop(lr);
2048 __ authenticate_return_address();
2049 __ ret(lr); // return from result handler
2050
2051 return entry;
2052 }
2053
2054 void TemplateInterpreterGenerator::histogram_bytecode_pair(Template* t) {
2055 // Calculate new index for counter:
2056 // _index = (_index >> log2_number_of_codes) |
2057 // (bytecode << log2_number_of_codes);
2058 Register index_addr = rscratch1;
2059 Register index = rscratch2;
2060 __ mov(index_addr, (address) &BytecodePairHistogram::_index);
2061 __ ldrw(index, index_addr);
2062 __ mov(r10,
2063 ((int)t->bytecode()) << BytecodePairHistogram::log2_number_of_codes);
2064 __ orrw(index, r10, index, Assembler::LSR,
2065 BytecodePairHistogram::log2_number_of_codes);
2066 __ strw(index, index_addr);
2067
2068 // Bump bucket contents:
2069 // _counters[_index] ++;
2070 Register counter_addr = rscratch1;
2071 __ mov(r10, (address) &BytecodePairHistogram::_counters);
2072 __ lea(counter_addr, Address(r10, index, Address::lsl(LogBytesPerInt)));
2073 __ atomic_addw(noreg, 1, counter_addr);
|