Mercurial > hg > graal-jvmci-8
comparison src/cpu/x86/vm/interp_masm_x86_64.cpp @ 2118:dd031b2226de
4930919: race condition in MDO creation at back branch locations
Summary: Reuse set_method_data_for_bcp() to setup mdp after MDO creation.
Reviewed-by: kvn, never
author | iveresov |
---|---|
date | Mon, 10 Jan 2011 18:46:29 -0800 |
parents | 0fc262af204f |
children | 38fea01eb669 |
comparison
equal
deleted
inserted
replaced
2117:70427f06ea47 | 2118:dd031b2226de |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
853 | 853 |
854 | 854 |
855 // Set the method data pointer for the current bcp. | 855 // Set the method data pointer for the current bcp. |
856 void InterpreterMacroAssembler::set_method_data_pointer_for_bcp() { | 856 void InterpreterMacroAssembler::set_method_data_pointer_for_bcp() { |
857 assert(ProfileInterpreter, "must be profiling interpreter"); | 857 assert(ProfileInterpreter, "must be profiling interpreter"); |
858 Label zero_continue; | 858 Label set_mdp; |
859 push(rax); | 859 push(rax); |
860 push(rbx); | 860 push(rbx); |
861 | 861 |
862 get_method(rbx); | 862 get_method(rbx); |
863 // Test MDO to avoid the call if it is NULL. | 863 // Test MDO to avoid the call if it is NULL. |
864 movptr(rax, Address(rbx, in_bytes(methodOopDesc::method_data_offset()))); | 864 movptr(rax, Address(rbx, in_bytes(methodOopDesc::method_data_offset()))); |
865 testptr(rax, rax); | 865 testptr(rax, rax); |
866 jcc(Assembler::zero, zero_continue); | 866 jcc(Assembler::zero, set_mdp); |
867 | |
868 // rbx: method | 867 // rbx: method |
869 // r13: bcp | 868 // r13: bcp |
870 call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::bcp_to_di), rbx, r13); | 869 call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::bcp_to_di), rbx, r13); |
871 // rax: mdi | 870 // rax: mdi |
872 | 871 // mdo is guaranteed to be non-zero here, we checked for it before the call. |
873 movptr(rbx, Address(rbx, in_bytes(methodOopDesc::method_data_offset()))); | 872 movptr(rbx, Address(rbx, in_bytes(methodOopDesc::method_data_offset()))); |
874 testptr(rbx, rbx); | |
875 jcc(Assembler::zero, zero_continue); | |
876 addptr(rbx, in_bytes(methodDataOopDesc::data_offset())); | 873 addptr(rbx, in_bytes(methodDataOopDesc::data_offset())); |
877 addptr(rbx, rax); | 874 addptr(rax, rbx); |
878 movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rbx); | 875 bind(set_mdp); |
879 | 876 movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rax); |
880 bind(zero_continue); | |
881 pop(rbx); | 877 pop(rbx); |
882 pop(rax); | 878 pop(rax); |
883 } | 879 } |
884 | 880 |
885 void InterpreterMacroAssembler::verify_method_data_pointer() { | 881 void InterpreterMacroAssembler::verify_method_data_pointer() { |