java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
6oits.
* Copyright (c) (,Interpreter:() generate_polljava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
ALTER THIS.
*
* This code is free software; you can redistribute it and/or modify,z_ijava_state_neg) )java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
* the of General PublicLicense version2,java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
by SoftwareFoundation.
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
* This(dispatch
* (Z_tmp_1, (addresssfpt_tbl); // Z_tmp_1 = table;
* FITNESS}
* }
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*
* You should have(, LogBytesPerWord)
* (,0 ,Z_tmp_1
* Inc.
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
dispatch_basestateInterpreter(),generate_poll
* or visit
* questions
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/
// Major contributions by AHa, AS, JL, ML.
# precompiled # dispatch_base(,)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 #include"// to perform additional, template interpreter specific tasks before actually #include"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 # " #include"interpreter/interpreter.hpp" #include"interpreter/interpreterRuntime.hpp" #include"oops/arrayOop.hpp" #include"oops/markWord.hpp" #include"oops/methodData.hpp" #include"prims/jvmtiExport.hpp" #include"prims/jvmtiThreadState.hpp" #include"runtime/basicLock.hpp" #include"runtime/frame.inline.hpp" #include"runtime/javaThread.hpp" #include"runtime/safepointMechanism.hpp" #include"runtime/sharedRuntime.hpp" #include"utilities/macros.hpp" #include"utilities/powerOfTwo.hpp"
// Implementation of InterpreterMacroAssembler. // This file specializes the assembler with interpreter-specific macros.
#ifdef PRODUCT #define BLOCK_COMMENT(str # BINDlabel) (label); #else #define java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0 #define / #endif
void InterpreterMacroAssembler:/
( =NULL"Entryhave een y"java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
assertRscratch=,"' addressing;
branch_optimized(Assembleraddress entry_point {
}
// Dispatch code executed in the prolog of a bytecode which does not do it's // own dispatch. void InterpreterMacroAssembler::dispatch_prolog(java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 // On z/Architecture we are short on registers, therefore we do not preload the
v InterpreterMacroAssembler:call_VM_baseRegisteroop_result java.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 88
}
// Dispatch code executed in the epilog of a bytecode which does not do it's // own dispatch.
rMacroAssembler( )java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
dispatch_next(state,)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}
void means this is **popframe -we
z_llgc(Z_bytecode, bcp_incr, Z_R0, Z_bcp); // Load next bytecode.
add2reg(Z_bcp, bcp_incr);
dispatch_base(state,// If (processing and !pending) is an invisible/impossible state,
}
// Common code to dispatch and dispatch_only. // Dispatch value in Lbyte_code and increment Lbcp.
void exact_log2(popframe_pending_bit));
(state)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
#(addressInterpreter:);
address reentry
{ Label OK; // Check if the frame pointer in Z_fp is correct.
z_cg(Z_fp,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
z_bre(OK);
reentry= (reentry, invalidframepointerZ_fp: " FILE_AND_LINE)java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
()java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
} in_bytes::earlyret_value_offset());
{ Label OK; // check if the locals pointer in Z_locals is correct
z_cg(Z_locals, _z_ijava_state_neg(locals), Z_fp);
z_bre(OK;
reentry = stop_chain_staticz_lgRjvmtiState,Z_thread
bindOK;
} #endif
// Dispatch table to use.
load_absolute_address(Z_tmp_1 (AddressRjvmtiState ),0,8 8 Z_R0_scratch;
if (generate_poll) {
address *sfpt_tbl = Interpreter::safept_table(state); ifbreak;
Label dispatch; const Address poll_byte_addr(Z_threadcaseltos: (, , );break;
/java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
z_tm:java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
z_braz(case ftos le(Z_ftos val_offval_off;;
load_absolute_address,address)
bind(dispatch);
}
}
// 0 <= Z_bytecode < 256 => Use a 32 bit shift, because it is shorter than sllg. // Z_bytecode must have been loaded zero-extended for this approach to be correct.
z_sll(Z_bytecode, LogBytesPerWord, Z_R0);sAddress(,val_off L,,,)java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
z_lg
z_brZ_tmp_1)java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
void zbre() / if (thread->jvmti_thread_state() == NULL) exit;thread-jvmti_thread_state)= ) exit;
dispatch_base(state, Interpreter::dispatch_table/ Initiateearlyret if already beingprocessed.
}
// The following call_VM*_base() methods overload and mask the respective // declarations/definitions in class MacroAssembler. They are meant as a "detour" // to perform additional, template interpreter specific tasks before actually // calling their MacroAssembler counterparts.
void InterpreterMacroAssembler::call_VM_leaf_base(address entry_point) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
;/ // interpreter specific // Note: No need to save/restore bcp (Z_R13) pointer since these are callee // saved registers and no blocking/ GC can happen in leaf calls.
// super call
);
}
void InterpreterMacroAssembler::call_VM_leaf_base(address entry_point void InterpreterMacroAssembler::super_call_VM_leaf(address entry_point, Register arg_1, Register arg_2) { // Note: No need to save/restore bcp (Z_R13) pointer since these are callee // saved registers and no blocking/ GC can happen in leaf calls.;
// super call
MacroAssembler::call_VM_leaf_base(entry_pointif= izeof) java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
}
voidInterpreterMacroAssembler:call_VM_baseRegister oop_result last_java_sp,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
allow_relocation=; v variant. code relocated // interpreter specific
voidI::check_and_handle_popframe(Registers) {
JvmtiExport:can_pop_frame)) {
BLOCK_COMMENT("check_and_handle_popframe {");
Label L; // Initiate popframe handling only if it is not already being
/ processed. the hasthepopframe_processing bitset // means that this code is called *during* popframe handling - we // don't want to reenter. // TODO: Check if all four state combinations could be visible. // If (processing and !pending) is an invisible/impossible state, // there is optimization potential by testing both bits at once. // Then, All_Zeroes and All_Ones means skip, Mixed means doit.
((, JavaThreadpopframe_condition_offsetjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
exact_log2(JavaThread::popframe_pending_bit));
z_bfalse()java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
testbit(Address(Z_thread, JavaThread::popframe_condition_offset()),
exact_log2(JavaThreadint bcp_offset,
z_btrue(L);
// Call Interpreter::remove_activation_preserving_args_entry() to get the // address of the same-named entrypoint in the generated interpreter code.
call_VM_leafCAST_FROM_FN_PTRaddress,::)); // The above call should (as its only effect) return the contents of the field // _remove_activation_preserving_args_entry in Z_RET. // We just jump there to have the work done.
z_br locatedat cache + + (-1 (ast in)-(byte_no1). // There is no way for control to fall thru here.
bind(L);
");
}
}
InterpreterMacroAssemblerTosState)
(::bytecode_1_mask =0ff,";
=in_bytes:earlyret_tos_offset() int BLOCK_COMMENT"})java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
(::() int state_off = in_bytes(JavaThread::jvmti_thread_state_offset( assert_different_registers;
z_lgRjvmtiState state_off,Z_thread)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
() case atos: z_lg(Z_tos, oop_off, RjvmtiState);
store_const(Address(RjvmtiState, oop_off), 0L, 8, 8, Z_R0_scratch); break; case ltos: z_lg ltos z_lg,val_offRjvmtiState); ; case btos: // fall through case ztos: // fall through case ctos: // fall through case: // fall through
java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 58 case ftos: z_le(Z_ftos, val_off, RjvmtiState); break# java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 case dtos: z_ld(Z_ftos, val_off, RjvmtiState); break;
:java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 default : ShouldNotReachHere(resolvedreference ",0x09256)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
}
// Clean up tos value in the jvmti thread state.
store_const// load cpool->resolved_klass_at(index) // Set tos state field to illegal value.
store_const( / int value = *(Rcpool->int_at_addr(which));
}
void InterpreterMacroAssembler::check_and_handle_earlyret(/ if (z_llgh(, Addresscpool,, sizeofConstantPool +2) // offset = resolved_klass_index (s390 is big-endian)
BLOCK_COMMENT("z_sllg(, offset, LogBytesPerWord);// Convert 'index' to 'offset'
z_lg(, Address,ConstantPool::esolved_klasses_offset_in_bytes);/java.lang.StringIndexOutOfBoundsException: Index 118 out of bounds for length 118 // arg regs are save, because we are just behind the call in call_VM_base
=; Register tmp = Z_ARG3;
load_and_test_long(jvmti_thread_state, Address(Z_thread, JavaThread::jvmti_thread_state_offset()));
z_bre(L); // if (thread->jvmti_thread_state() == NULL) exit;
// Initiate earlyret handling only if it is not already being processed. // If the flag has the earlyret_processing bit set, it means that this code // is called *during* earlyret handling - we don't want to reenter.
BLOCK_COMMENT" {"; "must fix this check, when changing the values of the earlyret enum");
assert(JvmtiThreadState,in_bytes(ConstantPoolCachebase_offset() tmp cache)java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
load_and_test_intRegister cache,
z_brz(L); // if (thread->jvmti_thread_state()->_earlyret_state != JvmtiThreadState::earlyret_pending) exit;
// Call Interpreter::remove_activation_early_entry() to get the address of the // same-named entrypoint in the generated interpreter code.
assert(sizeof(TosState) == 4, "unexpected size");
z_l(Z_ARG1constint method_offset=in_bytesjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
call_VM_leafCAST_FROM_FN_PTR(address, ::remove_activation_early_entry,ZARG1 // The above call should (as its only effect) return the contents of the field // _remove_activation_preserving_args_entry in Z_RET. // We just jump there to have the work done.
z_br(Z_RET); // There is no way for control to fall thru here.
bind(L// a subtype of super_klass. Blows registers Rsuper_klass, Rsub_klass, tmp1, tmp2.
("}check_and_handle_earlyret";
}
}
java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
assert(bcp_offset > 0, "bcp is still pointing to start of bytecode"); if (tmp1Rtmp2);
load_sized_value(index, param
} elseif (index_size// Useful if consumed previously by access via stackTop().
l(,, ,)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
// Purpose: - Provide address of stack operand to exploit reg-mem operations. // we have to change the following assembler code to calculate the){ // plain index.
assert(::decode_invokedynamic_index(~13)= 12,changeline;
not_((,Interpreter:(0,Z_esp;
} elseif (index_size == sizeof(u1)) {
z_llgc(index, param);
} {
a(,Z_R1_scratch)
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
BLOCK_COMMENT("}");
}
void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Registercpe_offset,
assert_different_registers,Z_R1_scratch; void::(Register)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
(,cpe_offset
get_cache_index_at_bcp(, , );
z_lg
/Convert field in.
z_sllg(cpe_offset,(,Z_esp,Interpreter::(0),);
BLOCK_COMMENT("}");
}
// We want to load (from CP cache) the bytecode that corresponds to the passed-in byte_no. debug_only(verify_esp(Z_esp, Z_R1_scratch)); // Instead of loading, shifting and masking a DW, we just load that one byte of interest with z_llgc (unsigned).
onstintbase_ix_off =(ConstantPoolCache:base_offset) + ConstantPoolCacheEntry:indices_offset)java.lang.StringIndexOutOfBoundsException: Index 112 out of bounds for length 112 constint off_in_DW = (8-1) - (1byte_no;
(ConstantPoolCacheEntry: =ConstantPoolCacheEntry, " ";
assert(ConstantPoolCacheEntry::bytecode_1_mask == 0xff, "");
load_sized_value(bytecode, Address(cache, cpe_offset, base_ix_off+off_in_DW), 1, false/*signed*/);
BLOCK_COMMENT("}");
}
// Load object from cpool->resolved_references(index). void InterpreterMacroAssembler::load_resolved_reference_at_index(Register result,
assert_different_registers(result, TosState state {
get_constant_pool verify_oop, );
// Convert // - from field index to resolved_references() index and // - from word index to byte offset. // Since this is a java object, it is potentially compressed. Register tmp = index; :(; break
z_sllg(indexcase:push_d) ; // Load pointer for resolved_references[] objArray.
z_lgresult :cache_offset_in_bytes() esult;
z_lg(result, ConstantPoolCache::java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 1
resolve_oop_handle(result); atos ();breakjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 #ifdef
NearLabel index_ok;
z_lgf(Z_R0, Address(result, arrayOopDesc:: vtos:
z_sllg( : ();
}
stop verify_oop(, state;
bind(index_ok); #endif
z_agr(result,// Helpers for swap and dup.
result Address(result, ::(T_OBJECT) ,noreg;
}
// load cpool->resolved_klass_at(index) void InterpreterMacroAssembler::load_resolved_klass_at_offset(Register cpool(, (Z_esp ::xpr_offset_in_bytes void::store_ptrintn,Registerval java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 // int resolved_klass_index = extract_low_short_from_int(value);
z_llgh,(cpool ,) );/java.lang.StringIndexOutOfBoundsException: Index 121 out of bounds for length 121
z_sllg(offset, offset, LogBytesPerWord); // Convert 'index' to 'offset'(,_(), )
z_lg(iklass, Address(cpool, ConstantPool::resolved_klasses_offset_in_bytes())); // iklass = cpool->_resolved_klasses
z_lg(iklass, Address(iklass, offset, Array<Klass*>::base_offset_in_bytes()));
}
void z_lgr(Z_method method) // Set Z_method (kills Z_fp!).
// in this thread in which case we must call the i2i entry.
size_t index_size) {
assingle-stepping,areimplemented partlyby avoiding
get_cache_and_index_at_bcp(cache , bcp_offset );
add2reg_with_indexcache n_bytesConstantPoolCache:base_offset, tmp, cache);
COMMENT("});
}
void InterpreterMacroAssembler::load_resolved_method_at_index(int byte_noz_bcrbcondEqual,Z_R1_scratch)
,
,Method:from_interpreted_offset()))java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 Register method) /Aboutto orwriteResp[0]. constint
ConstantPoolCache::base_offset(
((byte_no == TemplateTable::f2_byte)
? (, ,Z_SPjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
:
z_lg(method, Address// i.e. IJAVA_STATE.monitors > Resp.
}
// Generate a subtype check: branch to ok_is_subtype if sub_klass is // a subtype of super_klass. Blows registers Rsuper_klass, Rsub_klass, tmp1, tmp2. void InterpreterMacroAssembler::gen_subtype_check(Registerreentry=stop_chain_staticpops Z_esp intomonitor area;
,
// Do the check.
check_klass_subtype(Rsub_klass, Rsuper_klass, Rtmp1, Rtmp2, ok_is_subtype);
the failure of the check.
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
// Pop topmost element from stack. It just disappears. // Useful if consumed previously by access via stackTop(). void);
add2reg,*:stackElementSize
debug_only(verify_esp(Z_esp, Z_R1_scratch(magic_ok
}
// Get Address object of stack top. No checks. No pop. // Purpose: - Provide address of stack operand to exploit reg-mem operations. // - Avoid RISC-like mem2reg - reg-reg-op sequence.
Address:stackTop){ return Address(Z_esp, Interpreter::expr_offset_in_bytes(0));
}
InterpreterMacroAssembler:pop_l( r java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
asm_assert_ijava_state_magicZ_esp;
add2reg(Z_esp, 2*Interpreter::stackElementSize);
assert_different_registers(r, Z_R1_scratch);
debug_only(Z_esp,Z_R1_scratch
}
void InterpreterMacroAssembler::pop_f(FloatRegister f) {
(,(Z_esp :expr_offset_in_bytes0) false;
add2reg(Z_esp, Interpreter::stackElementSize);
debug_onlyjava.lang.StringIndexOutOfBoundsException: Range [12, 13) out of bounds for length 0
}
voidjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
mem2freg_opt(, (Z_esp ::expr_offset_in_bytes),);
add2reg( z_stgmdp z_ijava_state_neg),Z_fp);
debug_only(verify_esp(Z_esp, Z_R1_scratch
}
void InterpreterMacroAssembler::push_iI::)
sm_assert_ijava_state_magic)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
debug_only( :get_method regjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
z_st(r, Address(Z_esp))
add2reg(Z_esp, -Interpreter:
}
:( java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
z_stg(r, Address(Z_esp
add2regZ_esp -nterpreterstackElementSize
}
void InterpreterMacroAssembler::push_l(Register r) {
assert_different_registers(r, Z_R1_scratch
debug_only(verify_esp(Z_esp, Z_R1_scratch)); int offset = -Interpretercase:
z_stg(, (Z_esp,offset
(() Interpreter:)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
zllgh, bcp_offsetZ_R0Z_bcp)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
}
void InterpreterMacroAssembler
(verify_espZ_esp Z_R1_scratch)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
freg2mem_opt(f, Address(Z_esp), false);
add2regZ_esp, -:stackElementSize)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
}
void InterpreterMacroAssembler::push_d(FloatRegister d) {
debug_only(verify_esp(Z_esp, Z_R1_scratch)); int offset = -Interpreter::stackElementSize;
freg2mem_opt(d, Address
add2reg(Z_esp, 2 * )java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}
void::(TosState) java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
verify_oop(Z_tos, state); switch (() { case atos: push_ptr(); break; case btos: push_i(); break; case ztos: case ctos:
:(; breakjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
: () break case ltos (, AddressRdst:constants_offset)java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 case ftos: push_f(); break; case dtos: push_d(); break; case vtos: /* nothing to do */ break; defaultvoid InterpreterMacroAssembler:(Register , Register) {
}
}
void InterpreterMacroAssembler::pop switch (// Unlock if synchronized method. case atos: pop_ptr(Z_tos// Unlock the receiver if this is a synchronized method. case btos: pop_i// If there are locked Java monitors case ztos:// Else
asectos:
: pop_i) break; case itos: pop_i(Z_tos); break; case ltos: pop_l(Z_tos); break; case ftos: pop_f(Z_ftos); break; case dtos: pop_d(Z_ftos); breakbool install_monitor_exception) { case vtos: /* nothing to do */ break; default : ShouldNotReachHere();
}
verify_oop(Z_tos RegisterR_do_not_unlock_if_synchronized ;
}
// Helpers for swap and dup. void InterpreterMacroAssemblerJavaThread::do_not_unlock_if_synchronized_offset
verify_oop,;
}
InterpreterMacroAssembler( n Register{
z_stg(val, Address(Z_esp, Interpreter::expr_offset_in_bytes(n)));
}
void // Satisfy interpreter calling convention (see generate_normal_entry()).
z_lgr(Z_R10, Z_SP); } // Record top_frame_sp, because the callee might modify it, if it's compiled.
z_stg
save_bcp();
save_esp();
monitorZ_fp, (:z_ijava_state_size () BasicObjectLock);
}
// Jump to from_interpreted entry of a call unless single stepping is possible // in this thread in which case we must call the i2i entry.
InterpreterMacroAssemblerjump_from_interpreted( ,Registertemp){
assert_different_registers(method, Z_R10 /*used for initial_caller_sp*/, temp);
prepare_to_jump_from_interpreted(method);
if (JvmtiExport::can_post_interpreter_events()) { // JVMTI events, such as single-stepping, are implemented partly by avoiding running // compiled code in threads for which the event is enabled. Check here for
/java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
z_lg(Z_R1_scratch, Address( z_lg(Z_R1_scratch, Address(method
MacroAssembler::load_and_test_int(Z_R0_scratch, Address(Z_thread, JavaThread::interp_only_mode_offset(
z_bcr // Run interpreted.)
( (method ::());
z_br(Z_R1_scratch) }
} else { // Run compiled code.
z_lg(
z_br(Z_R1_scratch);
}
}
#ifdefjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 void InterpreterMacroAssembler::verify_esp(Register Resp, Register Rtemp /We use Z_ARG2 if goslowpath will java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
/ // Make sure it is not in the monitors or the TOP_IJAVA_FRAME_ABI.
address reentry = NULL;
{ // Check if the frame pointer in Z_fp is correct. // Points to word before bottom of monitor block.
z_cg(Z_fp, 0, Z_SP);
z_bre(OK);
stop_chain_static(, invalid frame pointerZ_fp)
bind(OK); ()
}
{ // Resp must not point into or below the operand stack, // i.e. IJAVA_STATE.monitors > Resp.
NearLabel OK; RegisterCAST_FROM_FN_PTR(, ::
z_lg(throw_illegal_monitor_state_exception
compareU64_and_branch(Rmonitors, Resp, bcondHigh, OKshould_not_reach_here(;
reentry = stop_chain_static(reentry, "too many pops: Z_esp points into/java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 if (){
}
{ // Resp may point to the last word of TOP_IJAVA_FRAME_ABI, but not below(, // i.e. !(Z_SP + frame::z_top_ijava_frame_abi_size - Interpreter::stackElementSize > Resp).
NearLabel OK; Register Rabi_bottom = Rtemp;
add2regRabi_bottom frame::z_top_ijava_frame_abi_size- ::stackElementSizeZ_SP;
compareU64_and_branch(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
reentry (, toomany:Z_esp points TOP_IJAVA_FRAME_ABI)
bind(OK(exception)
}
java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 1
void InterpreterMacroAssembler:(java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
z_stg(Z_bcp
asm_assert_ijava_state_magic
NOT_PRODUCT(z_lg(Z_bcp, (, )java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
void// Unlock the receiver if this is a synchronized method.
asm_assert_ijava_state_magic(Z_bcp);
z_lg(Z_bcp//
}
void InterpreterMacroAssembler:// Else if install_monitor_exception
// Else
}
void InterpreterMacroAssembler: Registerreturn_pc
asm_assert_ijava_state_magic)
z_lg(Z_espjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
void InterpreterMacroAssembler::get_monitors(Register reg) {if StackReservedPages>0 java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
asm_assert_ijava_state_magic)
;
}
void InterpreterMacroAssembler::save_mdp(Register mdp) {
z_stg(mdp, _z_ijava_state_neg(mdx), (, java.lang.StringIndexOutOfBoundsException: Index 124 out of bounds for length 124
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// Values that are only read (besides initialization). void InterpreterMacroAssembler}
(,state;
v(;
}
void InterpreterMacroAssembler//
signedOrNot is_signed) { // Rdst is an 8-byte return value!!! InterpreterMacroAssemblerlock_object( monitor, ){
// Unaligned loads incur only a small penalty on z/Architecture. The penalty
// boundary. In case of a cache miss, the stall could, of course, be // much longer.
switch (is_signed) } caseSigned:
z_lgh break; case:
z_llgh(Rdst, bcp_offset break; default: // // We stored the monitor address into the object's mark word.
}
/java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
setCCOrNot) java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
Rdst 8bytereturnvalue
// Unaligned loads incur only a small penalty on z/Architecture. The penalty // is a few (2..3) ticks, even when the load crosses a cache line // boundary. In case of a cache miss, the stall could, of course, be // much longer.
// Both variants implement a sign-extending int2long load. if (set_cc == set_CC) {
g(RdstAddress(Z_bcp,intptr_t)bcp_offset)java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
}load_k, object;
mem2reg_signed_opt( Rdst, Address(Z_bcp, (intptr_t)bcp_offset));
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// Unlock if synchronized method. // // Unlock the receiver if this is a synchronized method. // Unlock any Java monitors from synchronized blocks. // // If there are locked Java monitors // If throw_monitor_exception // throws IllegalMonitorStateException
// installs IllegalMonitorStateException // Else // no error processing void InterpreterMacroAssembler/
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 bool install_monitor_exception
NearLabel unlocked, unlock, no_unlock;
{ Register R_method = Z_ARG2; Register// The prior sequence "LGR, NGR, LTGR" can be done better
/java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 const Address do_not_unlock_if_synchronized(Z_thread,
JavaThread::do_not_unlock_if_synchronized_offset
load_sized_value(R_do_not_unlock_if_synchronized, do_not_unlock_if_synchronized, 1, false(low_case;
z_mvi(do_not_unlock_if_synchronized, false); // Reset the flag.
// Don't unlock anything if the _do_not_unlock_if_synchronized flag // is set.
compareU64_and_branch(R_do_not_unlock_if_synchronized, c(, address::) )java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
}
// unlock monitor
// BasicObjectLock will be first in list, since this is a // synchronized method. However, need to check that the object has// Throw IllegalMonitorException if object is not locked by current thread. // not been unlocked by an explicit monitorexit bytecode. const Address monitor(Z_fp, -(frame UseHeavyMonitors) { // We use Z_ARG2 so that if we go slow path it will be the correct // register for unlock_object to pass to VM directly.
load_addressZ_ARG2 monitor) / Address of first monitor.
z_lg(Z_ARG3
compareU64_and_branch(Z_ARG3, // // Recursive unlock. Mark object NULL.
() { // Entry already unlocked need to throw an exception.
MacroAssemblercall_VM(,CAST_FROM_FN_PTRaddress,InterpreterRuntime:throw_illegal_monitor_state_exception)java.lang.StringIndexOutOfBoundsException: Index 121 out of bounds for length 121
should_not_reach_here();
{ // Monitor already unlocked during a stack unroll. Address obj_entry(monitor, BasicObjectLock::obj_offset_in_bytes()); // Continue with stack unrolling.
MacroAssembler::call_VM(noreg, CAST_FROM_FN_PTR( /In interpreter we assure thejava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
z_bru(unlocked);
(,DataLayout
b(nlock
unlock_object(Z_ARG2
(unlocked
/java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
// Check that all monitors are unlocked.Register
{
NearLabel loop, exception, entry, restart; constint entry_size = frame::interpreter_frame_monitor_size / We use Z_ARG2 so that if we go slow path it will be the correct // register for unlock_object to pass to VM directly. Register R_current_monitor = Z_ARG2; Register R_monitor_block_bot = Z_ARG1; const Address monitor_block_top(Z_fp, _z_ijava_state_neg(monitors)); const Address monitor_block_bot(Z_fp, -frame::z_ijava_state_size);
bind(restart); // Starting with top-most entry.
z_lg,monitor_block_top // Points to word before bottom of monitor block.(,constant tmp
load_address(R_monitor_block_bot, monitor_block_bot);
// Entry already locked, need to throw exception.
bind(exception);
if (throw_monitor_exception) { // Throw exception.
MacroAssembler::call_VM(noreg,
CAST_FROM_FN_PTR(address, InterpreterRuntime::
throw_illegal_monitor_state_exception));
should_not_reach_here
} else { // Stack unrolling. Unlock object and install illegal_monitor_exception. // Unlock does not block, so don't have to worry about the frame.( mdp_in // We don't have to preserve c_rarg1 since we are going to throw an exception.
unlock_object(R_current_monitor); if (install_monitor_exception) {
call_VM(noreg, CAST_FROM_FN_PTR(address,
InterpreterRuntime::
new_illegal_monitor_state_exception));
}
z_bru(restart);
}
bind(loop); // Check if current entry is used.
load_and_test_long(Z_R0_scratch, Address(R_current_monitor, BasicObjectLock::obj_offset_in_bytes()));
z_brne(exception);
add2reg(R_current_monitor, entry_size); // Otherwise advance to next entry.
bindentry);
compareU64_and_branch(R_current_monitor, R_monitor_block_bot, bcondNotEqual, loop);
}
// remove activation // // Unlock the receiver if this is a synchronized method. // Unlock any Java monitors from synchronized blocks. // Remove the activation from the stack. // // If there are locked Java monitors // If throw_monitor_exception // throws IllegalMonitorStateException // Else if install_monitor_exception // installs IllegalMonitorStateException // Else // no error processing void InterpreterMacroAssembler::remove_activation(TosState state(, mustbe profilinginterpreter); Register return_pc, bool throw_monitor_exception, bool install_monitor_exception, bool notify_jvmti) {
BLOCK_COMMENT("remove_activation InterpreterMacroAssembler::update_mdp_for_ret( java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
unlock_if_synchronized_method(state, throw_monitor_exception, install_monitor_exception);
// Save result (push state before jvmti call and pop it afterwards) and notify jvmti.
notify_method_exit(false, state, notify_jvmti ? NotifyJVMTI : SkipNotifyJVMTI);
if (StackReservedPages > 0) {
BLOCK_COMMENT("reserved_stack_check:") // Test if reserved zone needs to be enabled.
Label no_reserved_zone_enabling;// We are taking a branch. Increment the taken count.
// Compare frame pointers. There is no good stack pointer, as with stack // frame compression we can get different SPs when we do calls. A subsequent // call could have a smaller SP, so that this compare succeeds for an // inner call of the method annotated with ReservedStack.
z_lg(Z_R0, Address(Z_SP, (intptr_t)_z_abi(callers_sp)));
z_clg(Z_R0, Address(Z_thread, JavaThread::reserved_stack_activation_offset())); // Compare with frame pointer in memory.
z_brl(no_reserved_zone_enabling);
// Enable reserved zone again, throw stack overflow exception.
// 64-bitjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
call_VM, DataLayout:)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
// lock object // // Registers alive // monitor - Address of the BasicObjectLock to be used for locking, // which must be initialized with the object to lock. // object - Address of the object to be locked. void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
if (UseHeavyMonitors) {
Label; return;
}
// template code: // // markWord displaced_header = obj->mark().set_unlocked(); // monitor->lock()->set_displaced_header(displaced_header); // if (Atomic::cmpxchg(/*addr*/obj->mark_addr(), /*cmp*/displaced_header, /*ex=*/monitor) == displaced_header) { // // We stored the monitor address into the object's mark word. // } else if (THREAD->is_lock_owned((address)displaced_header)) // // Simple recursive case. // monitor->lock()->set_displaced_header(NULL); // } else {
/ // InterpreterRuntime::monitorenter(THREAD, monitor); // }
// Load markWord from object into displaced_header.
z_lg(displaced_header, oopDesc::mark_offset_in_bytes(), object);
if (DiagnoseSyncOnValueBasedClasses != 0) {
load_klass}
testbit(Address(Z_R1_scratch, Klassjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
z_btrue(slow_case);
}
// Set displaced_header ( object| ).
z_oill(displaced_header, markWord::unlocked_value);
// Initialize the box (Must happen before we update the object mark!).
z_stg(displaced_header, BasicObjectLock::lock_offset_in_bytes/java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
BasicLock::displaced_header_offset_in_bytes(), monitor);
// Store stack address of the BasicObjectLock (this is monitor) into object.
add2reg(object_mark_addr, oopDesc::mark_offset_in_bytes(), object);
z_csg(displaced_header, monitor, 0, object_mark_addr);
assert(current_header==displaced_header, "must be same register"); // Identified two registers from z/Architecture.
// We did not see an unlocked object so try the fast recursive case.
// Check if owner is self by comparing the value in the markWord of object // (current_header) with the stack pointer.
z_sgr(current_header, Z_SP .
assert(os::vm_page_size() > 0xfff, "page size too small - change the constant")
// The prior sequence "LGR, NGR, LTGR" can be done better // (Z_R1 is temp and not used after here).
load_const_optimized(Z_R0, (~(os::vm_page_size()-1) | markWord::lock_mask_in_place));
z_ngr(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// If condition is true we are done and hence we can store 0 in the displaced // header indicating it is a recursive lock and be done.
z_brne(slow_case);
z_release(); // Membar unnecessary on zarch AND because the above csg does a sync before and after.
z_stg(Z_R0/*==0!*/, BasicObjectLock::lock_offset_in_bytes() +
N ;
z_bru(done);
// } else { // // Slow path. , monitor);
// None of the above fast optimizations worked so we have to get into the // slow case of monitor enter.
();
call_VM(noreg, CAST_FROM_FN_PTR(addressNearLabel ;
/}
bind
}
// Unlocks an object. Used in monitorexit bytecode and remove_activation. // // Registers alive // monitor - address of the BasicObjectLock to be used for locking, // which must be initialized with the object to lock. // // Throw IllegalMonitorException if object is not locked by current thread. void InterpreterMacroAssembler::unlock_object(Register monitor, Register object) {
if (UseHeavyMonitors) {
call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit), monitor); return;
}
// else { // template code: // // if ((displaced_header = monitor->displaced_header()) == NULL) { // // Recursive unlock. Mark the monitor unlocked by setting the object field to NULL. // monitor->set_obj(NULL); // } else if (Atomic::cmpxchg(obj->mark_addr(), monitor, displaced_header) == monitor) {// The machine visits each row (of receiver/count) until the receiver type // // We swapped the unlocked mark in displaced_header into the object's mark word. // monitor->set_obj(NULL); // } else { // // Slow path. // InterpreterRuntime::monitorexit(monitor); // }
It's the interpreter, so we are trading off code space for speed. const// See below for example code.
Addressobj_entry(,:obj_offset_in_bytes);
Label done;
if (object == noreg) { // In the template interpreter, we must assure that the object // entry in the monitor is cleared on all paths. Thus we move // loading up to here, and clear the entry afterwards.
object = Z_ARG3; // Use Z_ARG3 if caller didn't pass object.
z_lg(object, obj_entry); & done boolis_virtual_call) {
}
// if ((displaced_header = monitor->displaced_header()) == NULL) { if (is_virtual_call) { (is_virtual_call) { // monitor->set_obj(NULL);
clear_mem(obj_entry, sizeof(oop));
// Test first if we are in the fast recursive case.
MacroAssembler::load_and_test_long(displaced_header,
Address(monitor, BasicObjectLock::java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
BasicLock::displaced_header_offset_in_bytes()));
z_bre(done); // displaced_header == 0 -> goto done
// } else if (Atomic::cmpxchg(obj->mark_addr(), monitor, displaced_header) == monitor) { // // We swapped the unlocked mark in displaced_header into the object's mark word. // monitor->set_obj(NULL);// 2. found null => keep looking for case 1, maybe allocate this cell
// If we still have a lightweight lock, unlock the object and be done.
// We have the displaced header in displaced_header. If the lock is still // lightweight, it will contain the monitor address and we'll store the
java.lang.StringIndexOutOfBoundsException: Range [2, 0) out of bounds for length 0
z_lgr(current_header, monitor);
z_csg(current_header, displaced_header, 0, object);
z_bre(done);
// The lock has been converted into a heavy lock and hence // we need to get into the slow case.
z_stg(object, obj_entry); // Restore object entry, has been cleared above.
call_VM_leaf(CAST_FROM_FN_PTR)
// Set the method data pointer for the current bcp. void InterpreterMacroAssembler::set_method_data_pointer_for_bcp() {
assert(ProfileInterpreter, "must ()java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
Label set_mdp; Register mdp = Z_ARG4; Register method = Z_ARG5;
get_method(method); // Test MDO to avoid the call if it is NULL.
load_and_test_long(mdp, method2_(method, method_data));
z_brz(set_mdp);
call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::bcp_to_di), method, Z_bcp); // Z_RET: mdi // Mdo is guaranteed to be non-zero here, we checked for it before the call.
assert(method->is_nonvolatile(), "choose nonvolatile reg or reload from frame");
z_lg(mdp, method2_(method, method_data)); // Must reload, mdp is volatile reg.
add2reg_with_index(mdp, in_bytes(MethodData::data_offset()), Z_RET, mdp);
/ If the mdp is valid, it will point to a DataLayout header which is // consistent with the bcp. The converse is highly probable also.
load_sized_value(bcp_expected, Address(mdp, DataLayout::bci_offset()), 2, false/*signed*/);)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
z_ag(bcp_expected, Address(method, Method::const_offset()));
load_address(bcp_expected, Address(
compareU64_and_branch(bcp_expected, Z_bcp, bcondEqual, verify_continue);
call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::verify_mdp), method, Z_bcp, mdp);
bind(verify_continue); #endif// ASSERT
}
void InterpreterMacroAssembler::set_mdp_data_at(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
assert(ProfileInterpreter, "must be profiling interpreter");
z_stg(value, constant, mdp_in);
}
void InterpreterMacroAssembler::set_mdp_flag_at( ,
) {
assert(ProfileInterpreter, "must be profiling interpreter"); // Set the flag.
z_oi(Address(mdp_in, DataLayout::flags_offset()),
}
void InterpreterMacroAssembler::test_mdp_data_at(Register mdp_in, int offset, Register value, Register test_value_out// if (row[0].rec != NULL) {
Label& not_equal_continue) {
assert(ProfileInterpreter, "// if (row[1].rec == rec) { row[1].incr(); goto done; } if (test_value_out == noreg) {
z_cg(value, Address(mdp_in, offset));
z_brne(not_equal_continue);
} else { // Put the test value into a register, so caller can use it:
z_lg(test_value_out, Address(mdp_in, offset));
compareU64_and_branch(test_value_out, value, bcondNotEqual, not_equal_continue);
}
}
void InterpreterMacroAssemblerjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
assert(ProfileInterpreter, "must be profiling interpreter");
add2reg(mdp_inRegister mdp, Register reg2
save_mdp(mdp_in);
}
void InterpreterMacroAssembler::update_mdp_for_ret(Register return_bci)( " be ");
assert(ProfileInterpreter,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
assert(return_bci->is_nonvolatile(), "choose nonvolatile reg or save/restore")
_VMnoreg
CAST_FROM_FN_PTR(address, InterpreterRuntimejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
return_bci);
}
void InterpreterMacroAssembler::profile_taken_branch(Register mdp, Register bumped_count) { if (ProfileInterpreter) {
profile_continue;
// If no method data exists, go to profile_continue. // Otherwise, assign to mdp.
test_method_data_pointer(mdp, profile_continue);
// We are taking a branch. Increment the taken count. // We inline increment_mdp_data_at to return bumped_count in a register //increment_mdp_data_at(mdp, in_bytes(JumpData::taken_offset()));
Address data(mdp, JumpData::taken_offset());
z_lg(bumped_count, data); // 64-bit overflow is very unlikely. Saturation to 32-bit values is // performed when reading the counts.
add2reg(bumped_count, DataLayout::counter_increment);
z_stg(bumped_count,
// The method data pointer needs to be updated to reflect the new target.
update_mdp_by_offset(mdp, in_bytes(JumpData::displacement_offset()));
bind(profile_continue);
}
}
// If no method data exists, go to profile_continue.
test_method_data_pointer(mdp, profile_continue);
branch Increment the .
increment_mdp_data_at(mdp, in_bytes(BranchData::not_taken_offset()), Z_R1_scratch);
// The method data pointer needs to be updated to correspond to // the next bytecode.
update_mdp_by_constant(mdp, in_bytes(BranchData::branch_data_size()));
bind(profile_continue);
}
}
// If no method data exists, go to profile_continue.(mdp in_bytesRetData:bci_displacement_offset
test_method_data_pointer(mdp, profile_continue);
// We are making a call. Increment the count.
increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset()));
// The method data pointer needs to be updated to reflect the new target.
update_mdp_by_constantmdp,in_bytesCounterDatacounter_data_size);
bind(profile_continue);
}
}
void InterpreterMacroAssembler::profile_final_call(Register mdp) { if (ProfileInterpreter) {
Label profile_continue;
// If no method data exists, go to profile_continue.
test_method_data_pointer(
// We are making a call. Increment the count.
increment_mdp_data_at(mdp, ()java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
// The method data pointer needs to be updated to reflect the new target.
update_mdp_by_constant(mdp, in_bytes(VirtualCallData::virtual_call_data_size()));
bind(profile_continue);
}
}
void InterpreterMacroAssembler::profile_virtual_call(Register receiver, Register mdp,
reg2java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67 bool receiver_can_be_null) { if (ProfileInterpreter) { test_method_data_pointer(, );
NearLabel profile_continue;
// If no method data exists, go to profile_continue.
test_method_data_pointer(mdp, profile_continue) // The method data pointer needs to be updated.
NearLabel skip_receiver_profile;
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 31
NearLabel not_null;
compareU64_and_branch(receiver, (intptr_t)0L, bcondNotEqual, not_null); // We are making a call. Increment the count for null receiver.
increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset()))update_mdp_by_constant(mdp );
z_bru(skip_receiver_profile);
bind(not_nullbind();
}
// Record the receiver type.
record_klass_in_profile(receiver, mdp
bind(skip_receiver_profile);
// The method data pointer needs to be updated to reflect the new target.
update_mdp_by_constantmdp,in_bytesVirtualCallData:))java.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
/java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
}
}
// This routine creates a state machine for updating the multi-row // type profile at a virtual call site (or other type-sensitive bytecode). // The machine visits each row (of receiver/count) until the receiver type // is found, or until it runs out of rows. At the same time, it remembers // the location of the first empty row. (An empty row records null for its // receiver, and can be allocated for a newly-observed receiver type.) // Because there are two degrees of freedom in the state, a simple linear // search will not work; it must be a decision tree. Hence this helper // function is recursive, to generate the required tree structured code. // It's the interpreter, so we are trading off code space for speed. // See below for example code. void InterpreterMacroAssembler::record_klass_in_profile_helper( Register receiver, Register mdp, Register reg2, int start_row,
( =) if (is_virtual_call) {
increment_mdp_data_at(mdp, in_bytes(CounterDataifProfileInterpreter{
} return;
}
int last_row = VirtualCallData::row_limit() - 1;
assert(start_row <= last_row, "must be work left to do"); // Test this row for both the receiver and for null. // Take any of three different outcomes: // 1. found receiver => increment count and goto done // 2. found null => keep looking for case 1, maybe allocate this cell
/ // Case 3 is handled by a recursive call.
row =;row <;row+ {
NearLabel next_test; bool test_for_null_also = (row == start_row);
// Record the object type. int recvr_offset (::receiver_offset())
test_mdp_data_at(mdp, recvr_offset, receiver,
(test_for_null_also ? reg2 : noreg), }
update_mdp_by_constant(mdp,); // (Reg2 now contains the receiver from the CallData.)
// The receiver is receiver[n]. Increment count[n]. int count_offset = in_bytes(VirtualCallData::receiver_count_offset(row));
increment_mdp_data_at(mdp, count_offset);
z_bru(done);
bind(next_test);
if (test_for_null_also) {
Label found_null; // Failed the equality check on receiver[n]... Test for null.
z_ltgr(reg2, reg2); if (start_row == last_row) { // The only thing left to do is handle the null case. if (is_virtual_call) {
z_brz(found_null)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 // Receiver did not match any saved receiver and there is no empty row for it. // Increment total counter to indicate polymorphic case.
increment_mdp_data_at(mdp, in_bytes(CounterData:
z_bru(done);
bind(found_null);
} else {
z_brnz(done);
} break;
} // Since null is rare, make it be the branch-taken case.
z_brz);
// Put all the "Case 3" tests here.
record_klass_in_profile_helper(receiver, mdp, reg2, start_row + 1, done, is_virtual_call);
// Found a null. Keep searching for a matching receiver, // but remember that this is an empty (unused) slot.
bind(found_null);
}
}
// In the fall-through case, we found no matching receiver, but we // observed the receiver[start_row] is NULL.
// Fill in the receiver field and increment the count. int recvr_offset = in_bytes(VirtualCallData::receiver_offset(start_row));
set_mdp_data_at(mdp, recvr_offset, receiver); int count_offset = in_bytes(VirtualCallData
load_const_optimized(reg2 // If no method data exists, go to profile_continue.
set_mdp_data_at(mdp, count_offset, reg2); if (start_row > 0) {
z_brudone
}
}
// Example state machine code for three profile rows: // // main copy of decision tree, rooted at row[1] // if (row[0].rec == rec) { row[0].incr(); goto done; } // if (row[0].rec != NULL) { // // inner copy of decision tree, rooted at row[1] // if (row[1].rec == rec) { row[1].incr(); goto done; } // if (row[1].rec != NULL) { // // degenerate decision tree, rooted at row[2] // if (row[2].rec == rec) { row[2].incr(); goto done; } // if (row[2].rec != NULL) { count.incr(); goto done; } // overflow // row[2].init(rec); goto done; // } else { // // remember row[1] is empty // if (row[2].rec == rec) { row[2].incr(); goto done; } // row[1].init(rec); goto done; // } // } else { // // remember row[0] is empty // if (row[1].rec == rec) { row[1].incr(); goto done; } // if (row[2].rec == rec) { row[2].incr(); goto done; } // row[0].init(rec); goto done; // } // done:
void InterpreterMacroAssembler::profile_ret(Register return_bci, Register mdp) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (ProfileInterpreter) {
NearLabel profile_continue;
uint row;
// If no method data exists, go to profile_continue.
java.lang.StringIndexOutOfBoundsException: Range [101, 4) out of bounds for length 52
// Update the total ret count.
increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset()));
for row=0 RetData:row_limit) ++ java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
NearLabel next_test;
// See if return_bci is equal to bci[n]:
test_mdp_data_at(mdp,
in_bytes(RetData::bci_offset(row)),
return_bci, noreg,
next_test);
// Return_bci is equal to bci[n]. Increment the count.
increment_mdp_data_at(mdp, in_bytes(RetData::bci_count_offset(row)));
// The method data pointer needs to be updated to reflect the new target.
update_mdp_by_offset(mdp, in_bytes(RetData::bci_displacement_offset(row)));
z_bru(profile_continue);
bind(next_test);
}
update_mdp_for_ret(return_bci);
bind(profile_continue);
}
}
void InterpreterMacroAssembler::profile_null_seen(Register mdp) { if (ProfileInterpreter) {
Label profile_continue;
// If no method data exists, go to profile_continue.
test_method_data_pointer(mdp, profile_continue);
// The method data pointer needs to be updated. int mdp_delta = in_bytes(BitData::bit_data_size()); if (TypeProfileCasts) {
mdp_delta = in_bytes(VirtualCallData::virtual_call_data_size());
}
update_mdp_by_constant(mdp, mdp_delta);
// If no method data exists, go to profile_continue.
test_method_data_pointer(mdp, profile_continue);
int count_offset = in_bytes(CounterData::count_offset()); // Back up the address, since we have already bumped the mdp.
count_offset -= in_bytes(VirtualCallData::virtual_call_data_size());
// *Decrement* the counter. We expect to see zero or small negatives.
increment_mdp_data_at(mdp, count_offset, tmp, true);
// If no method data exists, go to profile_continue.
test_method_data_pointer(mdp, profile_continue);
// The method data pointer needs to be updated. int mdp_delta = in_bytes(BitData::bit_data_size()); if (TypeProfileCasts) {
mdp_delta = in_bytes(VirtualCallData::virtual_call_data_size());
// Record the object type.
record_klass_in_profile(klass, mdp, reg2, false);
}
update_mdp_by_constant(mdp, mdp_delta);
bind(profile_continue);
}
}
void InterpreterMacroAssembler::profile_switch_default(Register mdp) { if (ProfileInterpreter) {
Label profile_continue;
// If no method data exists, go to profile_continue.
test_method_data_pointer(mdp, profile_continue);
// Update the default case count.
increment_mdp_data_at(mdp, in_bytes(MultiBranchData::default_count_offset()));
// The method data pointer needs to be updated.
update_mdp_by_offset(mdp, in_bytes(MultiBranchData::default_displacement_offset()));
// If no method data exists, go to profile_continue.
test_method_data_pointer(mdp, profile_continue);
// Build the base (index * per_case_size_in_bytes()) + // case_array_offset_in_bytes().
z_sllg(index, index, exact_log2(in_bytes(MultiBranchData::per_case_size())));
add2reg(index, in_bytes(MultiBranchData::case_array_offset()));
// Add the calculated base to the mdp -> address of the case' data.
Address case_data_addr(mdp, index); Register case_data = scratch1;
load_address(case_data, case_data_addr);
// Update the case count.
increment_mdp_data_at(case_data,
in_bytes(MultiBranchData::relative_count_offset()),
scratch2);
// The method data pointer needs to be updated.
update_mdp_by_offset(mdp,
index,
in_bytes(MultiBranchData::relative_displacement_offset()));
bind(profile_continue);
}
}
// kills: R0, R1, flags, loads klass from obj (if not null) void InterpreterMacroAssembler::profile_obj_type(Register obj, Address mdo_addr, Register klass, bool cmp_done) {
NearLabel null_seen, init_klass, do_nothing, do_update;
// Klass = obj is allowed. constRegister tmp = Z_R1;
assert_different_registers(obj, mdo_addr.base(), tmp, Z_R0);
--> --------------------
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.