src/cpu/sparc/vm/sparc.ad

changeset 2441
c17b998c5926
parent 2403
c04052fd6ae1
child 2561
ab42c7e1cf83
     1.1 --- a/src/cpu/sparc/vm/sparc.ad	Tue Jan 11 20:26:13 2011 -0800
     1.2 +++ b/src/cpu/sparc/vm/sparc.ad	Wed Jan 12 18:33:25 2011 -0800
     1.3 @@ -1,5 +1,5 @@
     1.4  //
     1.5 -// Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
     1.6 +// Copyright (c) 1998, 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 @@ -575,7 +575,11 @@
    1.11  
    1.12  int MachCallRuntimeNode::ret_addr_offset() {
    1.13  #ifdef _LP64
    1.14 -  return NativeFarCall::instruction_size;  // farcall; delay slot
    1.15 +  if (MacroAssembler::is_far_target(entry_point())) {
    1.16 +    return NativeFarCall::instruction_size;
    1.17 +  } else {
    1.18 +    return NativeCall::instruction_size;
    1.19 +  }
    1.20  #else
    1.21    return NativeCall::instruction_size;  // call; delay slot
    1.22  #endif
    1.23 @@ -941,7 +945,7 @@
    1.24  #endif
    1.25  }
    1.26  
    1.27 -void emit_call_reloc(CodeBuffer &cbuf, intptr_t entry_point, relocInfo::relocType rtype, bool preserve_g2 = false, bool force_far_call = false) {
    1.28 +void emit_call_reloc(CodeBuffer &cbuf, intptr_t entry_point, relocInfo::relocType rtype, bool preserve_g2 = false) {
    1.29    // The method which records debug information at every safepoint
    1.30    // expects the call to be the first instruction in the snippet as
    1.31    // it creates a PcDesc structure which tracks the offset of a call
    1.32 @@ -963,20 +967,7 @@
    1.33    int startpos = __ offset();
    1.34  #endif /* ASSERT */
    1.35  
    1.36 -#ifdef _LP64
    1.37 -  // Calls to the runtime or native may not be reachable from compiled code,
    1.38 -  // so we generate the far call sequence on 64 bit sparc.
    1.39 -  // This code sequence is relocatable to any address, even on LP64.
    1.40 -  if ( force_far_call ) {
    1.41 -    __ relocate(rtype);
    1.42 -    AddressLiteral dest(entry_point);
    1.43 -    __ jumpl_to(dest, O7, O7);
    1.44 -  }
    1.45 -  else
    1.46 -#endif
    1.47 -  {
    1.48 -     __ call((address)entry_point, rtype);
    1.49 -  }
    1.50 +  __ call((address)entry_point, rtype);
    1.51  
    1.52    if (preserve_g2)   __ delayed()->mov(G2, L7);
    1.53    else __ delayed()->nop();
    1.54 @@ -2507,7 +2498,7 @@
    1.55      // CALL directly to the runtime
    1.56      // The user of this is responsible for ensuring that R_L7 is empty (killed).
    1.57      emit_call_reloc(cbuf, $meth$$method, relocInfo::runtime_call_type,
    1.58 -                    /*preserve_g2=*/true, /*force far call*/true);
    1.59 +                    /*preserve_g2=*/true);
    1.60    %}
    1.61  
    1.62    enc_class preserve_SP %{

mercurial