mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 10:04:42 +02:00
7104561: UseRDPCForConstantTableBase doesn't work after shorten branches changes
Reviewed-by: never, kvn
This commit is contained in:
parent
6bcf877494
commit
5ffce97ffc
2 changed files with 9 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -211,7 +211,7 @@ void VM_Version::initialize() {
|
||||||
#ifdef COMPILER2
|
#ifdef COMPILER2
|
||||||
// T4 and newer Sparc cpus have fast RDPC.
|
// T4 and newer Sparc cpus have fast RDPC.
|
||||||
if (has_fast_rdpc() && FLAG_IS_DEFAULT(UseRDPCForConstantTableBase)) {
|
if (has_fast_rdpc() && FLAG_IS_DEFAULT(UseRDPCForConstantTableBase)) {
|
||||||
// FLAG_SET_DEFAULT(UseRDPCForConstantTableBase, true);
|
FLAG_SET_DEFAULT(UseRDPCForConstantTableBase, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Currently not supported anywhere.
|
// Currently not supported anywhere.
|
||||||
|
|
|
@ -484,6 +484,13 @@ int MachConstantNode::constant_offset() {
|
||||||
// Bind the offset lazily.
|
// Bind the offset lazily.
|
||||||
if (offset == -1) {
|
if (offset == -1) {
|
||||||
Compile::ConstantTable& constant_table = Compile::current()->constant_table();
|
Compile::ConstantTable& constant_table = Compile::current()->constant_table();
|
||||||
|
// If called from Compile::scratch_emit_size assume the worst-case
|
||||||
|
// for load offsets: half the constant table size.
|
||||||
|
// NOTE: Don't return or calculate the actual offset (which might
|
||||||
|
// be zero) because that leads to problems with e.g. jumpXtnd on
|
||||||
|
// some architectures (cf. add-optimization in SPARC jumpXtnd).
|
||||||
|
if (Compile::current()->in_scratch_emit_size())
|
||||||
|
return constant_table.size() / 2;
|
||||||
offset = constant_table.table_base_offset() + constant_table.find_offset(_constant);
|
offset = constant_table.table_base_offset() + constant_table.find_offset(_constant);
|
||||||
_constant.set_offset(offset);
|
_constant.set_offset(offset);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue