comparison src/cpu/x86/vm/templateTable_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 bb8e3b66bde6
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.
1693 1693
1694 if (UseLoopCounter) { 1694 if (UseLoopCounter) {
1695 if (ProfileInterpreter) { 1695 if (ProfileInterpreter) {
1696 // Out-of-line code to allocate method data oop. 1696 // Out-of-line code to allocate method data oop.
1697 __ bind(profile_method); 1697 __ bind(profile_method);
1698 __ call_VM(noreg, 1698 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method));
1699 CAST_FROM_FN_PTR(address,
1700 InterpreterRuntime::profile_method), r13);
1701 __ load_unsigned_byte(rbx, Address(r13, 0)); // restore target bytecode 1699 __ load_unsigned_byte(rbx, Address(r13, 0)); // restore target bytecode
1702 __ movptr(rcx, Address(rbp, method_offset)); 1700 __ set_method_data_pointer_for_bcp();
1703 __ movptr(rcx, Address(rcx,
1704 in_bytes(methodOopDesc::method_data_offset())));
1705 __ movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize),
1706 rcx);
1707 __ test_method_data_pointer(rcx, dispatch);
1708 // offset non-null mdp by MDO::data_offset() + IR::profile_method()
1709 __ addptr(rcx, in_bytes(methodDataOopDesc::data_offset()));
1710 __ addptr(rcx, rax);
1711 __ movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize),
1712 rcx);
1713 __ jmp(dispatch); 1701 __ jmp(dispatch);
1714 } 1702 }
1715 1703
1716 if (UseOnStackReplacement) { 1704 if (UseOnStackReplacement) {
1717 // invocation counter overflow 1705 // invocation counter overflow