src/share/vm/c1/c1_GraphBuilder.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff src/share/vm/c1/c1_GraphBuilder.cpp
src/share/vm/c1/c1_GraphBuilder.cpp
Print this page
rev 5349 : 8023657: New type profiling points: arguments to call
Summary: x86 interpreter and c1 type profiling for arguments at calls
Reviewed-by:
rev 5350 : 8026054: New type profiling points: type of return values at calls
Summary: x86 interpreter and c1 type profiling for return values at calls
Reviewed-by:
*** 1464,1476 ****
--- 1464,1490 ----
}
// State at end of inlined method is the state of the caller
// without the method parameters on stack, including the
// return value, if any, of the inlined method on operand stack.
+ int invoke_bci = state()->caller_state()->bci();
set_state(state()->caller_state()->copy_for_parsing());
if (x != NULL) {
state()->push(x->type(), x);
+ if (profile_calls() && MethodData::profile_return() && x->type()->is_object_kind()) {
+ ciMethod* caller = state()->scope()->method();
+ int bci = invoke_bci;
+ ciMethodData* md = caller->method_data_or_null();
+ ciProfileData* data = md->bci_to_data(bci);
+ if (data->is_CallTypeData() || data->is_VirtualCallTypeData()) {
+ ciTypeEntriesAtCall* args_and_ret = data->is_CallTypeData() ? ((ciCallTypeData*)data)->args_and_ret() : ((ciVirtualCallTypeData*)data)->args_and_ret();
+ // May not be true in case of an inlined call through a method handle intrinsic.
+ if (args_and_ret->has_return()) {
+ profile_return_type(x, method(), caller, bci);
+ }
+ }
+ }
}
Goto* goto_callee = new Goto(continuation(), false);
// See whether this is the first return; if so, store off some
// of the state for later examination
*** 2006,2015 ****
--- 2020,2032 ----
push(result_type, round_fp(result));
} else {
push(result_type, result);
}
}
+ if (profile_calls() && MethodData::profile_return() && result_type->is_object_kind()) {
+ profile_return_type(result, target);
+ }
}
void GraphBuilder::new_instance(int klass_index) {
ValueStack* state_before = copy_state_exhandling();
*** 3554,3563 ****
--- 3571,3584 ----
preserves_state, cantrap);
// append instruction & push result
Value value = append_split(result);
if (result_type != voidType) push(result_type, value);
+ if (callee != method() && profile_calls() && MethodData::profile_return() && result_type->is_object_kind()) {
+ profile_return_type(result, callee);
+ }
+
// done
return true;
}
*** 4310,4317 ****
--- 4331,4353 ----
void GraphBuilder::profile_call(ciMethod* callee, Value recv, ciKlass* known_holder, Values* obj_args, bool inlined) {
append(new ProfileCall(method(), bci(), callee, recv, known_holder, obj_args, inlined));
}
+ void GraphBuilder::profile_return_type(Value ret, ciMethod* callee, ciMethod* m, int invoke_bci) {
+ assert((m == NULL) == (invoke_bci < 0), "invalid method and invalid bci together");
+ if (m == NULL) {
+ m = method();
+ }
+ if (invoke_bci < 0) {
+ invoke_bci = bci();
+ }
+ ciMethodData* md = m->method_data_or_null();
+ ciProfileData* data = md->bci_to_data(invoke_bci);
+ if (data->is_CallTypeData() || data->is_VirtualCallTypeData()) {
+ append(new ProfileReturnType(m , invoke_bci, callee, ret));
+ }
+ }
+
void GraphBuilder::profile_invocation(ciMethod* callee, ValueStack* state) {
append(new ProfileInvoke(callee, state));
}
src/share/vm/c1/c1_GraphBuilder.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File