comparison src/share/vm/opto/machnode.cpp @ 4053:e3b0dcc327b9

7104561: UseRDPCForConstantTableBase doesn't work after shorten branches changes Reviewed-by: never, kvn
author twisti
date Mon, 31 Oct 2011 03:06:42 -0700
parents 11211f7cb5a0
children 6729bbc1fcd6
comparison
equal deleted inserted replaced
4052:eba044a722a4 4053:e3b0dcc327b9
482 int MachConstantNode::constant_offset() { 482 int MachConstantNode::constant_offset() {
483 int offset = _constant.offset(); 483 int offset = _constant.offset();
484 // Bind the offset lazily. 484 // Bind the offset lazily.
485 if (offset == -1) { 485 if (offset == -1) {
486 Compile::ConstantTable& constant_table = Compile::current()->constant_table(); 486 Compile::ConstantTable& constant_table = Compile::current()->constant_table();
487 // If called from Compile::scratch_emit_size assume the worst-case
488 // for load offsets: half the constant table size.
489 // NOTE: Don't return or calculate the actual offset (which might
490 // be zero) because that leads to problems with e.g. jumpXtnd on
491 // some architectures (cf. add-optimization in SPARC jumpXtnd).
492 if (Compile::current()->in_scratch_emit_size())
493 return constant_table.size() / 2;
487 offset = constant_table.table_base_offset() + constant_table.find_offset(_constant); 494 offset = constant_table.table_base_offset() + constant_table.find_offset(_constant);
488 _constant.set_offset(offset); 495 _constant.set_offset(offset);
489 } 496 }
490 return offset; 497 return offset;
491 } 498 }