Mercurial > hg > truffle
comparison src/share/vm/graal/graalCompilerToVM.cpp @ 7002:74f0207b82f5
fixed bug in bytecode reconstitution
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 22 Nov 2012 12:56:52 +0100 |
parents | bf2ea3ed3bce |
children | 6838696d54ac |
comparison
equal
deleted
inserted
replaced
7001:46bec43bdfc3 | 7002:74f0207b82f5 |
---|---|
97 int cpci = Bytes::get_native_u2((address) reconstituted_code + bci + 1); | 97 int cpci = Bytes::get_native_u2((address) reconstituted_code + bci + 1); |
98 int i = method->constants()->object_to_cp_index(cpci); | 98 int i = method->constants()->object_to_cp_index(cpci); |
99 assert(i < method->constants()->length(), "sanity check"); | 99 assert(i < method->constants()->length(), "sanity check"); |
100 Bytes::put_Java_u2((address) reconstituted_code + bci + 1, (u2)i); | 100 Bytes::put_Java_u2((address) reconstituted_code + bci + 1, (u2)i); |
101 } else if (opcode == Bytecodes::_fast_aldc) { | 101 } else if (opcode == Bytecodes::_fast_aldc) { |
102 int cpci = reconstituted_code[bci + 1]; | 102 int cpci = reconstituted_code[bci + 1] & 0xff; |
103 int i = method->constants()->object_to_cp_index(cpci); | 103 int i = method->constants()->object_to_cp_index(cpci); |
104 assert(i < method->constants()->length(), "sanity check"); | 104 assert(i < method->constants()->length(), "sanity check"); |
105 reconstituted_code[bci + 1] = (jbyte)i; | 105 reconstituted_code[bci + 1] = (jbyte)i; |
106 } | 106 } |
107 } | 107 } |
396 } else if (tag.is_object()) { | 396 } else if (tag.is_object()) { |
397 oop obj = cp->object_at(index); | 397 oop obj = cp->object_at(index); |
398 assert(obj->is_instance(), "must be an instance"); | 398 assert(obj->is_instance(), "must be an instance"); |
399 result = VMToCompiler::createConstantObject(obj, CHECK_NULL); | 399 result = VMToCompiler::createConstantObject(obj, CHECK_NULL); |
400 } else { | 400 } else { |
401 tty->print("unknown constant pool tag at cpi %d in %s: ", index, cp->pool_holder()->name()->as_C_string()); | 401 tty->print("unknown constant pool tag (%s) at cpi %d in %s: ", tag.internal_name(), index, cp->pool_holder()->name()->as_C_string()); |
402 tag.print_on(tty); | |
403 ShouldNotReachHere(); | 402 ShouldNotReachHere(); |
404 } | 403 } |
405 | 404 |
406 return JNIHandles::make_local(THREAD, result); | 405 return JNIHandles::make_local(THREAD, result); |
407 C2V_END | 406 C2V_END |