< prev index next >
src/hotspot/cpu/x86/jniFastGetField_x86_32.cpp
Print this page
rev 55759 : 8227680: FastJNIAccessors: Check for JVMTI field access event requests at runtime
Summary: Check JvmtiExport::_field_access_count != 0 at runtime
Reviewed-by:
*** 1,7 ****
/*
! * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 73,82 ****
--- 73,91 ----
ExternalAddress counter(SafepointSynchronize::safepoint_counter_addr());
__ mov32 (rcx, counter);
__ testb (rcx, 1);
__ jcc (Assembler::notZero, slow);
+
+ if (JvmtiExport::can_post_field_access()) {
+ // Check to see if a field access watch has been set before we
+ // take the fast path.
+ __ mov32(rax, ExternalAddress((address) JvmtiExport::get_field_access_count_addr()));
+ __ testl(rax, rax);
+ __ jcc(Assembler::notZero, slow);
+ }
+
__ mov(rax, rcx);
__ andptr(rax, 1); // rax, must end up 0
__ movptr(rdx, Address(rsp, rax, Address::times_1, 2*wordSize));
// obj, notice rax, is 0.
// rdx is data dependent on rcx.
*** 186,195 ****
--- 195,213 ----
__ push (rsi);
__ mov32 (rcx, counter);
__ testb (rcx, 1);
__ jcc (Assembler::notZero, slow);
+
+ if (JvmtiExport::can_post_field_access()) {
+ // Check to see if a field access watch has been set before we
+ // take the fast path.
+ __ mov32(rax, ExternalAddress((address) JvmtiExport::get_field_access_count_addr()));
+ __ testl(rax, rax);
+ __ jcc(Assembler::notZero, slow);
+ }
+
__ mov(rax, rcx);
__ andptr(rax, 1); // rax, must end up 0
__ movptr(rdx, Address(rsp, rax, Address::times_1, 3*wordSize));
// obj, notice rax, is 0.
// rdx is data dependent on rcx.
*** 270,279 ****
--- 288,306 ----
ExternalAddress counter(SafepointSynchronize::safepoint_counter_addr());
__ mov32 (rcx, counter);
__ testb (rcx, 1);
__ jcc (Assembler::notZero, slow);
+
+ if (JvmtiExport::can_post_field_access()) {
+ // Check to see if a field access watch has been set before we
+ // take the fast path.
+ __ mov32(rax, ExternalAddress((address) JvmtiExport::get_field_access_count_addr()));
+ __ testl(rax, rax);
+ __ jcc(Assembler::notZero, slow);
+ }
+
__ mov(rax, rcx);
__ andptr(rax, 1); // rax, must end up 0
__ movptr(rdx, Address(rsp, rax, Address::times_1, 2*wordSize));
// obj, notice rax, is 0.
// rdx is data dependent on rcx.
< prev index next >