Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8133557

Missing test before a branch when checking for MethodCounters in TemplateTable::branch() on x86

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • hotspot
    • None
    • b81
    • x86

         TemplateTable::branch() on x86 has the following code for checking if the MethodCounters exist:

           // check if MethodCounters exists
            Label has_counters;
            __ movptr(rax, Address(rcx, Method::method_counters_offset()));
            __ testptr(rax, rax);
            __ jcc(Assembler::notZero, has_counters);
            __ push(rdx);
            __ push(rcx);
            __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::build_method_counters),
                       rcx);
            __ pop(rcx);
            __ pop(rdx);
            __ movptr(rax, Address(rcx, Method::method_counters_offset()));
            __ jcc(Assembler::zero, dispatch);
            __ bind(has_counters);

        After calling InterpreterRuntime::build_method_counters() and reloading Method::_method_counters there's no test of the loaded value before the branch to 'dispatch'.

              simonis Volker Simonis
              simonis Volker Simonis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: