[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Re: DTraceAllocProbes bug in interpreter
From:       Mikael Gerdin <mikael.gerdin () oracle ! com>
Date:       2015-02-16 8:35:25
Message-ID: 54E1ABCD.5010308 () oracle ! com
[Download RAW message or body]

Hi Jungwoo,

The DTrace probes are part of the serviceability support, bcc:ing gc-dev 
and redirecting to serviceability-dev.

/Mikael

On 2015-02-14 02:21, Jungwoo Ha wrote:
> I am not sure if DTraceAllocProbes is a live code, but I think this is a
> bug.
> dtrace_object_alloc has changed to receive size argument in JDK8.
> This code only passes oop to dtrace_object_alloc. RDX has the size but
> it needs to be saved.
> I don't use DTrace, but it looks broken. If someone sponsor this is a
> right fix, I'll create a webrev.
>
> diff -r f06c7b654d63 src/cpu/x86/vm/templateTable_x86_32.cpp
> --- a/src/cpu/x86/vm/templateTable_x86_32.cppThu Jul 31 09:58:53 2014 +0100
> +++ b/src/cpu/x86/vm/templateTable_x86_32.cppFri Feb 13 17:14:57 2015 -0800
> @@ -3288,6 +3288,7 @@
>       // The object is initialized before the header.  If the object size is
>       // zero, go directly to the header initialization.
>       __ bind(initialize_object);
> +    __ push(rdx);  // save object size
>       __ decrement(rdx, sizeof(oopDesc));
>       __ jcc(Assembler::zero, initialize_header);
> @@ -3328,13 +3329,14 @@
>         __ pop(rcx);   // get saved klass back in the register.
>       }
>       __ store_klass(rax, rcx);  // klass
> +    __ pop(rdx);  // restore object size to rdx
>       {
>         SkipIfEqual skip_if(_masm, &DTraceAllocProbes, 0);
>         // Trigger dtrace event for fastpath
>         __ push(atos);
>         __ call_VM_leaf(
> -           CAST_FROM_FN_PTR(address,
> SharedRuntime::dtrace_object_alloc), rax);
> +           CAST_FROM_FN_PTR(address,
> SharedRuntime::dtrace_object_alloc), rax, rdx);
>         __ pop(atos);
>       }
> diff -r f06c7b654d63 src/cpu/x86/vm/templateTable_x86_64.cpp
> --- a/src/cpu/x86/vm/templateTable_x86_64.cppThu Jul 31 09:58:53 2014 +0100
> +++ b/src/cpu/x86/vm/templateTable_x86_64.cppFri Feb 13 17:14:57 2015 -0800
> @@ -3352,6 +3352,7 @@
>       // The object is initialized before the header.  If the object size is
>       // zero, go directly to the header initialization.
>       __ bind(initialize_object);
> +    __ movl(rbx, rdx);  // save object size to rbx
>       __ decrementl(rdx, sizeof(oopDesc));
>       __ jcc(Assembler::zero, initialize_header);
> @@ -3386,7 +3387,7 @@
>         // Trigger dtrace event for fastpath
>         __ push(atos); // save the return value
>         __ call_VM_leaf(
> -           CAST_FROM_FN_PTR(address,
> SharedRuntime::dtrace_object_alloc), rax);
> +           CAST_FROM_FN_PTR(address,
> SharedRuntime::dtrace_object_alloc), rax, rbx);
>         __ pop(atos); // restore the return value
>       }
>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic