comparison src/cpu/x86/vm/templateTable_x86_32.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 f95d63e2154a
children bb8e3b66bde6
comparison
equal deleted inserted replaced
2117:70427f06ea47 2118:dd031b2226de
1 /* 1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 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.
1663 1663
1664 if (UseLoopCounter) { 1664 if (UseLoopCounter) {
1665 if (ProfileInterpreter) { 1665 if (ProfileInterpreter) {
1666 // Out-of-line code to allocate method data oop. 1666 // Out-of-line code to allocate method data oop.
1667 __ bind(profile_method); 1667 __ bind(profile_method);
1668 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method), rsi); 1668 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method));
1669 __ load_unsigned_byte(rbx, Address(rsi, 0)); // restore target bytecode 1669 __ load_unsigned_byte(rbx, Address(rsi, 0)); // restore target bytecode
1670 __ movptr(rcx, Address(rbp, method_offset)); 1670 __ set_method_data_pointer_for_bcp();
1671 __ movptr(rcx, Address(rcx, in_bytes(methodOopDesc::method_data_offset())));
1672 __ movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rcx);
1673 __ test_method_data_pointer(rcx, dispatch);
1674 // offset non-null mdp by MDO::data_offset() + IR::profile_method()
1675 __ addptr(rcx, in_bytes(methodDataOopDesc::data_offset()));
1676 __ addptr(rcx, rax);
1677 __ movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rcx);
1678 __ jmp(dispatch); 1671 __ jmp(dispatch);
1679 } 1672 }
1680 1673
1681 if (UseOnStackReplacement) { 1674 if (UseOnStackReplacement) {
1682 1675