< prev index next >

src/share/vm/opto/library_call.cpp

Print this page
rev 8471 : [mq]: dont_profile.8074551


5998   Node* instofSHA = gen_instanceof(digestBaseObj, makecon(TypeKlassPtr::make(instklass_SHA)));
5999   Node* cmp_instof = _gvn.transform(new CmpINode(instofSHA, intcon(1)));
6000   Node* bool_instof = _gvn.transform(new BoolNode(cmp_instof, BoolTest::ne));
6001   Node* instof_false = generate_guard(bool_instof, NULL, PROB_MIN);
6002 
6003   return instof_false;  // even if it is NULL
6004 }
6005 
6006 bool LibraryCallKit::inline_profileBoolean() {
6007   Node* counts = argument(1);
6008   const TypeAryPtr* ary = NULL;
6009   ciArray* aobj = NULL;
6010   if (counts->is_Con()
6011       && (ary = counts->bottom_type()->isa_aryptr()) != NULL
6012       && (aobj = ary->const_oop()->as_array()) != NULL
6013       && (aobj->length() == 2)) {
6014     // Profile is int[2] where [0] and [1] correspond to false and true value occurrences respectively.
6015     jint false_cnt = aobj->element_value(0).as_int();
6016     jint  true_cnt = aobj->element_value(1).as_int();
6017 
6018     method()->set_injected_profile(true);
6019 
6020     if (C->log() != NULL) {
6021       C->log()->elem("observe source='profileBoolean' false='%d' true='%d'",
6022                      false_cnt, true_cnt);
6023     }
6024 
6025     if (false_cnt + true_cnt == 0) {
6026       // According to profile, never executed.
6027       uncommon_trap_exact(Deoptimization::Reason_intrinsic,
6028                           Deoptimization::Action_reinterpret);
6029       return true;
6030     }
6031 
6032     // result is a boolean (0 or 1) and its profile (false_cnt & true_cnt)
6033     // is a number of each value occurrences.
6034     Node* result = argument(0);
6035     if (false_cnt == 0 || true_cnt == 0) {
6036       // According to profile, one value has been never seen.
6037       int expected_val = (false_cnt == 0) ? 1 : 0;
6038 
6039       Node* cmp  = _gvn.transform(new CmpINode(result, intcon(expected_val)));




5998   Node* instofSHA = gen_instanceof(digestBaseObj, makecon(TypeKlassPtr::make(instklass_SHA)));
5999   Node* cmp_instof = _gvn.transform(new CmpINode(instofSHA, intcon(1)));
6000   Node* bool_instof = _gvn.transform(new BoolNode(cmp_instof, BoolTest::ne));
6001   Node* instof_false = generate_guard(bool_instof, NULL, PROB_MIN);
6002 
6003   return instof_false;  // even if it is NULL
6004 }
6005 
6006 bool LibraryCallKit::inline_profileBoolean() {
6007   Node* counts = argument(1);
6008   const TypeAryPtr* ary = NULL;
6009   ciArray* aobj = NULL;
6010   if (counts->is_Con()
6011       && (ary = counts->bottom_type()->isa_aryptr()) != NULL
6012       && (aobj = ary->const_oop()->as_array()) != NULL
6013       && (aobj->length() == 2)) {
6014     // Profile is int[2] where [0] and [1] correspond to false and true value occurrences respectively.
6015     jint false_cnt = aobj->element_value(0).as_int();
6016     jint  true_cnt = aobj->element_value(1).as_int();
6017 


6018     if (C->log() != NULL) {
6019       C->log()->elem("observe source='profileBoolean' false='%d' true='%d'",
6020                      false_cnt, true_cnt);
6021     }
6022 
6023     if (false_cnt + true_cnt == 0) {
6024       // According to profile, never executed.
6025       uncommon_trap_exact(Deoptimization::Reason_intrinsic,
6026                           Deoptimization::Action_reinterpret);
6027       return true;
6028     }
6029 
6030     // result is a boolean (0 or 1) and its profile (false_cnt & true_cnt)
6031     // is a number of each value occurrences.
6032     Node* result = argument(0);
6033     if (false_cnt == 0 || true_cnt == 0) {
6034       // According to profile, one value has been never seen.
6035       int expected_val = (false_cnt == 0) ? 1 : 0;
6036 
6037       Node* cmp  = _gvn.transform(new CmpINode(result, intcon(expected_val)));


< prev index next >