/* * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016 SAP SE. 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. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
// TSO ensures that loads are blocking and ordered with respect to // to earlier loads, so we don't need LoadLoad membars.
#define __ masm->
#define BUFFER_SIZE 30*sizeof(jint)
// Common register usage: // Z_RET/Z_FRET: result // Z_ARG1: jni env // Z_ARG2: obj // Z_ARG3: jfield id
address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) { constchar *name; switch (type) { case T_BOOLEAN: name = "jni_fast_GetBooleanField"; break; case T_BYTE: name = "jni_fast_GetByteField"; break; case T_CHAR: name = "jni_fast_GetCharField"; break; case T_SHORT: name = "jni_fast_GetShortField"; break; case T_INT: name = "jni_fast_GetIntField"; break; case T_LONG: name = "jni_fast_GetLongField"; break; case T_FLOAT: name = "jni_fast_GetFloatField"; break; case T_DOUBLE: name = "jni_fast_GetDoubleField"; break; default: ShouldNotReachHere();
name = NULL; // unreachable
}
ResourceMark rm;
BufferBlob* blob = BufferBlob::create(name, BUFFER_SIZE);
CodeBuffer cbuf(blob);
MacroAssembler* masm = new MacroAssembler(&cbuf);
address fast_entry = __ pc();
Label slow;
// We can only kill the remaining volatile registers. constRegister Rcounter = Z_ARG4,
Robj = Z_R1_scratch,
Rtmp = Z_R0_scratch;
__ load_const_optimized(Robj, SafepointSynchronize::safepoint_counter_addr());
__ z_lg(Rcounter, Address(Robj));
__ z_tmll(Rcounter, 1);
__ z_brnaz(slow);
if (JvmtiExport::can_post_field_access()) { // Check to see if a field access watch has been set before we // take the fast path.
__ load_const_optimized(Robj, JvmtiExport::get_field_access_count_addr());
__ z_lt(Robj, Address(Robj));
__ z_brne(slow);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.