< prev index next >
src/cpu/ppc/vm/interp_masm_ppc_64.cpp
Print this page
@@ -1,8 +1,8 @@
/*
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2016 SAP SE. All rights reserved.
+ * Copyright (c) 2012, 2017 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.
@@ -470,10 +470,29 @@
// Add in the index.
add(result, tmp, result);
load_heap_oop(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT), result, is_null);
}
+// load cpool->resolved_klass_at(index)
+void InterpreterMacroAssembler::load_resolved_klass_at_offset(Register Rcpool, Register Roffset, Register Rklass) {
+ // int value = *(Rcpool->int_at_addr(which));
+ // int resolved_klass_index = extract_low_short_from_int(value);
+ add(Roffset, Rcpool, Roffset);
+#if defined(VM_LITTLE_ENDIAN)
+ lhz(Roffset, sizeof(ConstantPool), Roffset); // Roffset = resolved_klass_index
+#else
+ lhz(Roffset, sizeof(ConstantPool) + 2, Roffset); // Roffset = resolved_klass_index
+#endif
+
+ ld(Rklass, ConstantPool::resolved_klasses_offset_in_bytes(), Rcpool); // Rklass = Rcpool->_resolved_klasses
+
+ sldi(Roffset, Roffset, LogBytesPerWord);
+ addi(Roffset, Roffset, Array<Klass*>::base_offset_in_bytes());
+ isync(); // Order load of instance Klass wrt. tags.
+ ldx(Rklass, Rklass, Roffset);
+}
+
// Generate a subtype check: branch to ok_is_subtype if sub_klass is
// a subtype of super_klass. Blows registers Rsub_klass, tmp1, tmp2.
void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass, Register Rsuper_klass, Register Rtmp1,
Register Rtmp2, Register Rtmp3, Label &ok_is_subtype) {
// Profile the not-null value's klass.
< prev index next >