7034967: C1: assert(false) failed: error (assembler_sparc.cpp:2043)
Summary: Fix -XX:+VerifyOops
Reviewed-by: kvn, never
--- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp Thu Apr 07 21:32:23 2011 -0700
+++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp Fri Apr 08 17:03:31 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, 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
@@ -387,7 +387,7 @@
void C1_MacroAssembler::verify_not_null_oop(Register r) {
Label not_null;
- br_zero(Assembler::notEqual, false, Assembler::pt, r, not_null);
+ br_notnull(r, false, Assembler::pt, not_null);
delayed()->nop();
stop("non-null oop required");
bind(not_null);
--- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp Thu Apr 07 21:32:23 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp Fri Apr 08 17:03:31 2011 -0700
@@ -7941,12 +7941,12 @@
#endif
push(rax); // save rax,
// addr may contain rsp so we will have to adjust it based on the push
- // we just did
+ // we just did (and on 64 bit we do two pushes)
// NOTE: 64bit seemed to have had a bug in that it did movq(addr, rax); which
// stores rax into addr which is backwards of what was intended.
if (addr.uses(rsp)) {
lea(rax, addr);
- pushptr(Address(rax, BytesPerWord));
+ pushptr(Address(rax, LP64_ONLY(2 *) BytesPerWord));
} else {
pushptr(addr);
}
@@ -8396,6 +8396,17 @@
movptr(dst, src);
}
+// Doesn't do verfication, generates fixed size code
+void MacroAssembler::load_heap_oop_not_null(Register dst, Address src) {
+#ifdef _LP64
+ if (UseCompressedOops) {
+ movl(dst, src);
+ decode_heap_oop_not_null(dst);
+ } else
+#endif
+ movptr(dst, src);
+}
+
void MacroAssembler::store_heap_oop(Address dst, Register src) {
#ifdef _LP64
if (UseCompressedOops) {
--- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp Thu Apr 07 21:32:23 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp Fri Apr 08 17:03:31 2011 -0700
@@ -1709,6 +1709,7 @@
void store_klass(Register dst, Register src);
void load_heap_oop(Register dst, Address src);
+ void load_heap_oop_not_null(Register dst, Address src);
void store_heap_oop(Address dst, Register src);
// Used for storing NULL. All other oop constants should be
--- a/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp Thu Apr 07 21:32:23 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp Fri Apr 08 17:03:31 2011 -0700
@@ -316,7 +316,9 @@
Register tmp2 = rbx;
__ push(tmp);
__ push(tmp2);
- __ load_heap_oop(tmp2, Address(_obj, java_lang_Class::klass_offset_in_bytes()));
+ // Load without verification to keep code size small. We need it because
+ // begin_initialized_entry_offset has to fit in a byte. Also, we know it's not null.
+ __ load_heap_oop_not_null(tmp2, Address(_obj, java_lang_Class::klass_offset_in_bytes()));
__ get_thread(tmp);
__ cmpptr(tmp, Address(tmp2, instanceKlass::init_thread_offset_in_bytes() + sizeof(klassOopDesc)));
__ pop(tmp2);
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp Thu Apr 07 21:32:23 2011 -0700
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp Fri Apr 08 17:03:31 2011 -0700
@@ -1456,7 +1456,7 @@
if (addr->is_address()) {
LIR_Address* address = addr->as_address_ptr();
- LIR_Opr ptr = new_register(T_OBJECT);
+ LIR_Opr ptr = new_pointer_register();
if (!address->index()->is_valid() && address->disp() == 0) {
__ move(address->base(), ptr);
} else {
@@ -1508,7 +1508,9 @@
LIR_Const* card_table_base = new LIR_Const(((CardTableModRefBS*)_bs)->byte_map_base);
if (addr->is_address()) {
LIR_Address* address = addr->as_address_ptr();
- LIR_Opr ptr = new_register(T_OBJECT);
+ // ptr cannot be an object because we use this barrier for array card marks
+ // and addr can point in the middle of an array.
+ LIR_Opr ptr = new_pointer_register();
if (!address->index()->is_valid() && address->disp() == 0) {
__ move(address->base(), ptr);
} else {