7104561: UseRDPCForConstantTableBase doesn't work after shorten branches changes

Mon, 31 Oct 2011 03:06:42 -0700

author
twisti
date
Mon, 31 Oct 2011 03:06:42 -0700
changeset 3249
e3b0dcc327b9
parent 3248
eba044a722a4
child 3250
71699e9d8673

7104561: UseRDPCForConstantTableBase doesn't work after shorten branches changes
Reviewed-by: never, kvn

src/cpu/sparc/vm/vm_version_sparc.cpp file | annotate | diff | comparison | revisions
src/share/vm/opto/machnode.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/cpu/sparc/vm/vm_version_sparc.cpp	Fri Oct 28 14:44:52 2011 -0700
     1.2 +++ b/src/cpu/sparc/vm/vm_version_sparc.cpp	Mon Oct 31 03:06:42 2011 -0700
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -211,7 +211,7 @@
    1.11  #ifdef COMPILER2
    1.12    // T4 and newer Sparc cpus have fast RDPC.
    1.13    if (has_fast_rdpc() && FLAG_IS_DEFAULT(UseRDPCForConstantTableBase)) {
    1.14 -//    FLAG_SET_DEFAULT(UseRDPCForConstantTableBase, true);
    1.15 +    FLAG_SET_DEFAULT(UseRDPCForConstantTableBase, true);
    1.16    }
    1.17  
    1.18    // Currently not supported anywhere.
     2.1 --- a/src/share/vm/opto/machnode.cpp	Fri Oct 28 14:44:52 2011 -0700
     2.2 +++ b/src/share/vm/opto/machnode.cpp	Mon Oct 31 03:06:42 2011 -0700
     2.3 @@ -484,6 +484,13 @@
     2.4    // Bind the offset lazily.
     2.5    if (offset == -1) {
     2.6      Compile::ConstantTable& constant_table = Compile::current()->constant_table();
     2.7 +    // If called from Compile::scratch_emit_size assume the worst-case
     2.8 +    // for load offsets: half the constant table size.
     2.9 +    // NOTE: Don't return or calculate the actual offset (which might
    2.10 +    // be zero) because that leads to problems with e.g. jumpXtnd on
    2.11 +    // some architectures (cf. add-optimization in SPARC jumpXtnd).
    2.12 +    if (Compile::current()->in_scratch_emit_size())
    2.13 +      return constant_table.size() / 2;
    2.14      offset = constant_table.table_base_offset() + constant_table.find_offset(_constant);
    2.15      _constant.set_offset(offset);
    2.16    }

mercurial