# HG changeset patch # User Doug Simon # Date 1353585412 -3600 # Node ID 74f0207b82f5f2152c4c8cae06b6b0ec5b77d7c3 # Parent 46bec43bdfc3522c40fe614c284f752fffc8bf8c fixed bug in bytecode reconstitution diff -r 46bec43bdfc3 -r 74f0207b82f5 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantPool.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantPool.java Wed Nov 21 23:36:06 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantPool.java Thu Nov 22 12:56:52 2012 +0100 @@ -40,6 +40,7 @@ @Override public Object lookupConstant(int cpi) { + assert cpi != 0; Object constant = HotSpotGraalRuntime.getInstance().getCompilerToVM().lookupConstantInPool(type, cpi); return constant; } diff -r 46bec43bdfc3 -r 74f0207b82f5 src/share/vm/graal/graalCompilerToVM.cpp --- a/src/share/vm/graal/graalCompilerToVM.cpp Wed Nov 21 23:36:06 2012 +0100 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Thu Nov 22 12:56:52 2012 +0100 @@ -99,7 +99,7 @@ assert(i < method->constants()->length(), "sanity check"); Bytes::put_Java_u2((address) reconstituted_code + bci + 1, (u2)i); } else if (opcode == Bytecodes::_fast_aldc) { - int cpci = reconstituted_code[bci + 1]; + int cpci = reconstituted_code[bci + 1] & 0xff; int i = method->constants()->object_to_cp_index(cpci); assert(i < method->constants()->length(), "sanity check"); reconstituted_code[bci + 1] = (jbyte)i; @@ -398,8 +398,7 @@ assert(obj->is_instance(), "must be an instance"); result = VMToCompiler::createConstantObject(obj, CHECK_NULL); } else { - tty->print("unknown constant pool tag at cpi %d in %s: ", index, cp->pool_holder()->name()->as_C_string()); - tag.print_on(tty); + tty->print("unknown constant pool tag (%s) at cpi %d in %s: ", tag.internal_name(), index, cp->pool_holder()->name()->as_C_string()); ShouldNotReachHere(); }