src/share/vm/opto/parse2.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/opto/parse2.cpp Wed Jan 28 11:51:29 2015
--- new/src/share/vm/opto/parse2.cpp Wed Jan 28 11:51:29 2015
*** 763,802 ****
--- 763,785 ----
int pnum = target->next_path_num();
merge_common(target, pnum);
}
static bool has_injected_profile(BoolTest::mask btest, Node* test, int& taken, int& not_taken) {
ProfileBooleanNode* profile = NULL;
if (btest != BoolTest::eq && btest != BoolTest::ne) {
// Only ::eq and ::ne are supported for profile injection.
return false;
}
! if (test->is_Cmp()) {
! Node* n = test->in(1);
switch (n->Opcode()) {
case Op_ProfileBoolean:
profile = (ProfileBooleanNode*) n;
break;
case Op_AndI:
// Look for the following shape: AndI (ProfileBoolean) (ConI 1))
const TypeInt* t = NULL;
if (n->in(1)->Opcode() == Op_ProfileBoolean &&
n->in(2)->is_Con() &&
(t = n->in(2)->bottom_type()->isa_int()) != NULL &&
t->get_con() == 1) {
profile = (ProfileBooleanNode*) n->in(1);
}
break;
}
}
if (profile != NULL) {
+ if (test->is_Cmp() &&
! test->in(1)->Opcode() == Op_ProfileBoolean) {
! ProfileBooleanNode* profile = (ProfileBooleanNode*)test->in(1);
int false_cnt = profile->false_count();
int true_cnt = profile->true_count();
// Counts matching depends on the actual test operation (::eq or ::ne).
+ // No need to scale the counts because profile injection was designed
+ // to feed exact counts into VM.
taken = (btest == BoolTest::eq) ? false_cnt : true_cnt;
not_taken = (btest == BoolTest::eq) ? true_cnt : false_cnt;
profile->consume();
return true;
src/share/vm/opto/parse2.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File