Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/prims/methodHandleWalk.cpp
          +++ new/src/share/vm/prims/methodHandleWalk.cpp
↓ open down ↓ 1379 lines elided ↑ open up ↑
1380 1380        java_lang_invoke_CountingMethodHandle::is_instance(arg1.object()())) {
1381 1381      count1 = java_lang_invoke_CountingMethodHandle::vmcount(arg1.object()());
1382 1382    }
1383 1383    if (arg2.token_type() == tt_constant && arg2.basic_type() == T_OBJECT &&
1384 1384        java_lang_invoke_CountingMethodHandle::is_instance(arg2.object()())) {
1385 1385      count2 = java_lang_invoke_CountingMethodHandle::vmcount(arg2.object()());
1386 1386    }
1387 1387    int total = count1 + count2;
1388 1388    if (count1 != -1 && count2 != -1 && total != 0) {
1389 1389      // Normalize the collect counts to the invoke_count
1390      -    tty->print("counts %d %d scaled by %d = ", count2, count1, _invoke_count);
1391 1390      if (count1 != 0) _not_taken_count = (int)(_invoke_count * count1 / (double)total);
1392 1391      if (count2 != 0) _taken_count = (int)(_invoke_count * count2 / (double)total);
1393      -    tty->print_cr("%d %d", _taken_count, _not_taken_count);
1394 1392      return true;
1395 1393    }
1396 1394    return false;
1397 1395  }
1398 1396  
1399 1397  // Emit bytecodes for the given invoke instruction.
1400 1398  MethodHandleWalker::ArgToken
1401 1399  MethodHandleCompiler::make_invoke(methodHandle m, vmIntrinsics::ID iid,
1402 1400                                    Bytecodes::Code op, bool tailcall,
1403 1401                                    int argc, MethodHandleWalker::ArgToken* argv,
↓ open down ↓ 688 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX