16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 #include "precompiled.hpp"
27 #include "asm/codeBuffer.hpp"
28 #include "asm/macroAssembler.inline.hpp"
29 #include "compiler/disassembler.hpp"
30 #include "gc/shared/cardTable.hpp"
31 #include "gc/shared/collectedHeap.inline.hpp"
32 #include "interpreter/interpreter.hpp"
33 #include "gc/shared/cardTableModRefBS.hpp"
34 #include "memory/resourceArea.hpp"
35 #include "memory/universe.hpp"
36 #include "oops/klass.inline.hpp"
37 #include "opto/compile.hpp"
38 #include "opto/intrinsicnode.hpp"
39 #include "opto/matcher.hpp"
40 #include "prims/methodHandles.hpp"
41 #include "registerSaver_s390.hpp"
42 #include "runtime/biasedLocking.hpp"
43 #include "runtime/icache.hpp"
44 #include "runtime/interfaceSupport.inline.hpp"
45 #include "runtime/objectMonitor.hpp"
46 #include "runtime/os.hpp"
47 #include "runtime/safepoint.hpp"
48 #include "runtime/safepointMechanism.hpp"
49 #include "runtime/sharedRuntime.hpp"
50 #include "runtime/stubRoutines.hpp"
51 #include "utilities/events.hpp"
52 #include "utilities/macros.hpp"
53 #if INCLUDE_ALL_GCS
54 #include "gc/g1/g1BarrierSet.hpp"
55 #include "gc/g1/g1CardTable.hpp"
1269 assert(is_load_const_32to64(pos), "not a load of a narrow ptr (oop or klass)");
1270
1271 set_imm32(pos, np);
1272 return 6;
1273 }
1274
1275 // Patching the value of CPU version dependent compare_immediate_narrow sequence.
1276 // The passed ptr MUST be in compressed format!
1277 int MacroAssembler::patch_compare_immediate_32(address pos, int64_t np) {
1278 assert(is_compare_immediate32(pos), "not a compressed ptr compare");
1279
1280 set_imm32(pos, np);
1281 return 6;
1282 }
1283
1284 // Patching the immediate value of CPU version dependent load_narrow_oop sequence.
1285 // The passed ptr must NOT be in compressed format!
1286 int MacroAssembler::patch_load_narrow_oop(address pos, oop o) {
1287 assert(UseCompressedOops, "Can only patch compressed oops");
1288
1289 narrowOop no = oopDesc::encode_heap_oop(o);
1290 return patch_load_const_32to64(pos, no);
1291 }
1292
1293 // Patching the immediate value of CPU version dependent load_narrow_klass sequence.
1294 // The passed ptr must NOT be in compressed format!
1295 int MacroAssembler::patch_load_narrow_klass(address pos, Klass* k) {
1296 assert(UseCompressedClassPointers, "Can only patch compressed klass pointers");
1297
1298 narrowKlass nk = Klass::encode_klass(k);
1299 return patch_load_const_32to64(pos, nk);
1300 }
1301
1302 // Patching the immediate value of CPU version dependent compare_immediate_narrow_oop sequence.
1303 // The passed ptr must NOT be in compressed format!
1304 int MacroAssembler::patch_compare_immediate_narrow_oop(address pos, oop o) {
1305 assert(UseCompressedOops, "Can only patch compressed oops");
1306
1307 narrowOop no = oopDesc::encode_heap_oop(o);
1308 return patch_compare_immediate_32(pos, no);
1309 }
1310
1311 // Patching the immediate value of CPU version dependent compare_immediate_narrow_klass sequence.
1312 // The passed ptr must NOT be in compressed format!
1313 int MacroAssembler::patch_compare_immediate_narrow_klass(address pos, Klass* k) {
1314 assert(UseCompressedClassPointers, "Can only patch compressed klass pointers");
1315
1316 narrowKlass nk = Klass::encode_klass(k);
1317 return patch_compare_immediate_32(pos, nk);
1318 }
1319
1320 //------------------------------------------------------------------------
1321 // Extract the constant from a load_constant instruction stream.
1322 //------------------------------------------------------------------------
1323
1324 // Get constant from a load_const sequence.
1325 long MacroAssembler::get_const(address a) {
1326 assert(is_load_const(a), "not a load of a constant");
1327 unsigned long x;
|
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 #include "precompiled.hpp"
27 #include "asm/codeBuffer.hpp"
28 #include "asm/macroAssembler.inline.hpp"
29 #include "compiler/disassembler.hpp"
30 #include "gc/shared/cardTable.hpp"
31 #include "gc/shared/collectedHeap.inline.hpp"
32 #include "interpreter/interpreter.hpp"
33 #include "gc/shared/cardTableModRefBS.hpp"
34 #include "memory/resourceArea.hpp"
35 #include "memory/universe.hpp"
36 #include "oops/compressedOops.inline.hpp"
37 #include "oops/klass.inline.hpp"
38 #include "opto/compile.hpp"
39 #include "opto/intrinsicnode.hpp"
40 #include "opto/matcher.hpp"
41 #include "prims/methodHandles.hpp"
42 #include "registerSaver_s390.hpp"
43 #include "runtime/biasedLocking.hpp"
44 #include "runtime/icache.hpp"
45 #include "runtime/interfaceSupport.inline.hpp"
46 #include "runtime/objectMonitor.hpp"
47 #include "runtime/os.hpp"
48 #include "runtime/safepoint.hpp"
49 #include "runtime/safepointMechanism.hpp"
50 #include "runtime/sharedRuntime.hpp"
51 #include "runtime/stubRoutines.hpp"
52 #include "utilities/events.hpp"
53 #include "utilities/macros.hpp"
54 #if INCLUDE_ALL_GCS
55 #include "gc/g1/g1BarrierSet.hpp"
56 #include "gc/g1/g1CardTable.hpp"
1270 assert(is_load_const_32to64(pos), "not a load of a narrow ptr (oop or klass)");
1271
1272 set_imm32(pos, np);
1273 return 6;
1274 }
1275
1276 // Patching the value of CPU version dependent compare_immediate_narrow sequence.
1277 // The passed ptr MUST be in compressed format!
1278 int MacroAssembler::patch_compare_immediate_32(address pos, int64_t np) {
1279 assert(is_compare_immediate32(pos), "not a compressed ptr compare");
1280
1281 set_imm32(pos, np);
1282 return 6;
1283 }
1284
1285 // Patching the immediate value of CPU version dependent load_narrow_oop sequence.
1286 // The passed ptr must NOT be in compressed format!
1287 int MacroAssembler::patch_load_narrow_oop(address pos, oop o) {
1288 assert(UseCompressedOops, "Can only patch compressed oops");
1289
1290 narrowOop no = CompressedOops::encode(o);
1291 return patch_load_const_32to64(pos, no);
1292 }
1293
1294 // Patching the immediate value of CPU version dependent load_narrow_klass sequence.
1295 // The passed ptr must NOT be in compressed format!
1296 int MacroAssembler::patch_load_narrow_klass(address pos, Klass* k) {
1297 assert(UseCompressedClassPointers, "Can only patch compressed klass pointers");
1298
1299 narrowKlass nk = Klass::encode_klass(k);
1300 return patch_load_const_32to64(pos, nk);
1301 }
1302
1303 // Patching the immediate value of CPU version dependent compare_immediate_narrow_oop sequence.
1304 // The passed ptr must NOT be in compressed format!
1305 int MacroAssembler::patch_compare_immediate_narrow_oop(address pos, oop o) {
1306 assert(UseCompressedOops, "Can only patch compressed oops");
1307
1308 narrowOop no = CompressedOops::encode(o);
1309 return patch_compare_immediate_32(pos, no);
1310 }
1311
1312 // Patching the immediate value of CPU version dependent compare_immediate_narrow_klass sequence.
1313 // The passed ptr must NOT be in compressed format!
1314 int MacroAssembler::patch_compare_immediate_narrow_klass(address pos, Klass* k) {
1315 assert(UseCompressedClassPointers, "Can only patch compressed klass pointers");
1316
1317 narrowKlass nk = Klass::encode_klass(k);
1318 return patch_compare_immediate_32(pos, nk);
1319 }
1320
1321 //------------------------------------------------------------------------
1322 // Extract the constant from a load_constant instruction stream.
1323 //------------------------------------------------------------------------
1324
1325 // Get constant from a load_const sequence.
1326 long MacroAssembler::get_const(address a) {
1327 assert(is_load_const(a), "not a load of a constant");
1328 unsigned long x;
|