提交 bef03700 编写于 作者: R roland

6932496: c1: deoptimization of jsr subroutine fails on sparcv9

Summary: store jsr ret bci as intptr constant in c1 debug info
Reviewed-by: never
上级 38ede31f
......@@ -1072,7 +1072,8 @@ void LIR_Assembler::const2stack(LIR_Opr src, LIR_Opr dest) {
LIR_Const* c = src->as_constant_ptr();
switch (c->type()) {
case T_INT:
case T_FLOAT: {
case T_FLOAT:
case T_ADDRESS: {
Register src_reg = O7;
int value = c->as_jint_bits();
if (value == 0) {
......@@ -1128,7 +1129,8 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi
}
switch (c->type()) {
case T_INT:
case T_FLOAT: {
case T_FLOAT:
case T_ADDRESS: {
LIR_Opr tmp = FrameMap::O7_opr;
int value = c->as_jint_bits();
if (value == 0) {
......@@ -1200,6 +1202,7 @@ void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_cod
switch (c->type()) {
case T_INT:
case T_ADDRESS:
{
jint con = c->as_jint();
if (to_reg->is_single_cpu()) {
......
......@@ -628,7 +628,8 @@ void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_cod
LIR_Const* c = src->as_constant_ptr();
switch (c->type()) {
case T_INT: {
case T_INT:
case T_ADDRESS: {
assert(patch_code == lir_patch_none, "no patching handled here");
__ movl(dest->as_register(), c->as_jint());
break;
......@@ -711,6 +712,7 @@ void LIR_Assembler::const2stack(LIR_Opr src, LIR_Opr dest) {
switch (c->type()) {
case T_INT: // fall through
case T_FLOAT:
case T_ADDRESS:
__ movl(frame_map()->address_for_slot(dest->single_stack_ix()), c->as_jint_bits());
break;
......@@ -746,6 +748,7 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi
switch (type) {
case T_INT: // fall through
case T_FLOAT:
case T_ADDRESS:
__ movl(as_Address(addr), c->as_jint_bits());
break;
......
......@@ -76,7 +76,7 @@ LIR_Opr LIR_OprFact::value_type(ValueType* type) {
return LIR_OprFact::oopConst(type->as_ObjectType()->encoding());
}
}
case addressTag: return LIR_OprFact::intConst(type->as_AddressConstant()->value());
case addressTag: return LIR_OprFact::addressConst(type->as_AddressConstant()->value());
case intTag : return LIR_OprFact::intConst(type->as_IntConstant()->value());
case floatTag : return LIR_OprFact::floatConst(type->as_FloatConstant()->value());
case longTag : return LIR_OprFact::longConst(type->as_LongConstant()->value());
......@@ -89,7 +89,7 @@ LIR_Opr LIR_OprFact::value_type(ValueType* type) {
LIR_Opr LIR_OprFact::dummy_value_type(ValueType* type) {
switch (type->tag()) {
case objectTag: return LIR_OprFact::oopConst(NULL);
case addressTag:
case addressTag:return LIR_OprFact::addressConst(0);
case intTag: return LIR_OprFact::intConst(0);
case floatTag: return LIR_OprFact::floatConst(0.0);
case longTag: return LIR_OprFact::longConst(0);
......@@ -1411,6 +1411,7 @@ void LIR_OprDesc::print(outputStream* out) const {
// LIR_Address
void LIR_Const::print_value_on(outputStream* out) const {
switch (type()) {
case T_ADDRESS:out->print("address:%d",as_jint()); break;
case T_INT: out->print("int:%d", as_jint()); break;
case T_LONG: out->print("lng:%lld", as_jlong()); break;
case T_FLOAT: out->print("flt:%f", as_jfloat()); break;
......
......@@ -85,9 +85,10 @@ class LIR_Const: public LIR_OprPtr {
void type_check(BasicType t) const { assert(type() == t, "type check"); }
void type_check(BasicType t1, BasicType t2) const { assert(type() == t1 || type() == t2, "type check"); }
void type_check(BasicType t1, BasicType t2, BasicType t3) const { assert(type() == t1 || type() == t2 || type() == t3, "type check"); }
public:
LIR_Const(jint i) { _value.set_type(T_INT); _value.set_jint(i); }
LIR_Const(jint i, bool is_address=false) { _value.set_type(is_address?T_ADDRESS:T_INT); _value.set_jint(i); }
LIR_Const(jlong l) { _value.set_type(T_LONG); _value.set_jlong(l); }
LIR_Const(jfloat f) { _value.set_type(T_FLOAT); _value.set_jfloat(f); }
LIR_Const(jdouble d) { _value.set_type(T_DOUBLE); _value.set_jdouble(d); }
......@@ -105,7 +106,7 @@ class LIR_Const: public LIR_OprPtr {
virtual BasicType type() const { return _value.get_type(); }
virtual LIR_Const* as_constant() { return this; }
jint as_jint() const { type_check(T_INT ); return _value.get_jint(); }
jint as_jint() const { type_check(T_INT, T_ADDRESS); return _value.get_jint(); }
jlong as_jlong() const { type_check(T_LONG ); return _value.get_jlong(); }
jfloat as_jfloat() const { type_check(T_FLOAT ); return _value.get_jfloat(); }
jdouble as_jdouble() const { type_check(T_DOUBLE); return _value.get_jdouble(); }
......@@ -120,7 +121,7 @@ class LIR_Const: public LIR_OprPtr {
#endif
jint as_jint_bits() const { type_check(T_FLOAT, T_INT); return _value.get_jint(); }
jint as_jint_bits() const { type_check(T_FLOAT, T_INT, T_ADDRESS); return _value.get_jint(); }
jint as_jint_lo_bits() const {
if (type() == T_DOUBLE) {
return low(jlong_cast(_value.get_jdouble()));
......@@ -718,6 +719,7 @@ class LIR_OprFact: public AllStatic {
static LIR_Opr intptrConst(void* p) { return (LIR_Opr)(new LIR_Const(p)); }
static LIR_Opr intptrConst(intptr_t v) { return (LIR_Opr)(new LIR_Const((void*)v)); }
static LIR_Opr illegal() { return (LIR_Opr)-1; }
static LIR_Opr addressConst(jint i) { return (LIR_Opr)(new LIR_Const(i, true)); }
static LIR_Opr value_type(ValueType* type);
static LIR_Opr dummy_value_type(ValueType* type);
......
......@@ -2479,6 +2479,15 @@ int LinearScan::append_scope_value_for_constant(LIR_Opr opr, GrowableArray<Scope
return 2;
}
case T_ADDRESS: {
#ifdef _LP64
scope_values->append(new ConstantLongValue(c->as_jint()));
#else
scope_values->append(new ConstantIntValue(c->as_jint()));
#endif
return 1;
}
default:
ShouldNotReachHere();
return -1;
......
/*
* Copyright 2010 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
/**
* @test
* @bug 6932496
* @summary incorrect deopt of jsr subroutine on 64 bit c1
*
* @compile -source 1.5 -target 1.5 -XDjsrlimit=0 Test6932496.java
* @run main/othervm -Xcomp -XX:CompileOnly=Test6932496.m Test6932496
*/
public class Test6932496 {
static class A {
volatile boolean flag = false;
}
static void m() {
try {
} finally {
A a = new A();
a.flag = true;
}
}
static public void main(String[] args) {
m();
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册