comparison src/cpu/x86/vm/templateInterpreter_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 b599a4c6c2df
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.
1365 // invocation counter overflow 1365 // invocation counter overflow
1366 if (inc_counter) { 1366 if (inc_counter) {
1367 if (ProfileInterpreter) { 1367 if (ProfileInterpreter) {
1368 // We have decided to profile this method in the interpreter 1368 // We have decided to profile this method in the interpreter
1369 __ bind(profile_method); 1369 __ bind(profile_method);
1370 1370 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method));
1371 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method), rsi, true); 1371 __ set_method_data_pointer_for_bcp();
1372
1373 __ movptr(rbx, Address(rbp, method_offset)); // restore methodOop
1374 __ movptr(rax, Address(rbx, in_bytes(methodOopDesc::method_data_offset())));
1375 __ movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rax);
1376 __ test_method_data_pointer(rax, profile_method_continue);
1377 __ addptr(rax, in_bytes(methodDataOopDesc::data_offset()));
1378 __ movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rax);
1379 __ jmp(profile_method_continue); 1372 __ jmp(profile_method_continue);
1380 } 1373 }
1381 // Handle overflow of counter and compile method 1374 // Handle overflow of counter and compile method
1382 __ bind(invocation_counter_overflow); 1375 __ bind(invocation_counter_overflow);
1383 generate_counter_overflow(&continue_after_compile); 1376 generate_counter_overflow(&continue_after_compile);