Merge

Thu, 18 Feb 2010 10:44:14 -0800

author
twisti
date
Thu, 18 Feb 2010 10:44:14 -0800
changeset 1702
72f1840531a4
parent 1697
58add740c4ee
parent 1701
3b687c53c266
child 1703
1f341bb67b5b
child 1708
877a14af58e1
child 1722
8911d8c0596f

Merge

     1.1 --- a/src/cpu/zero/vm/globals_zero.hpp	Tue Feb 16 14:11:44 2010 -0800
     1.2 +++ b/src/cpu/zero/vm/globals_zero.hpp	Thu Feb 18 10:44:14 2010 -0800
     1.3 @@ -1,6 +1,6 @@
     1.4  /*
     1.5   * Copyright 2000-2006 Sun Microsystems, Inc.  All Rights Reserved.
     1.6 - * Copyright 2007, 2008, 2009 Red Hat, Inc.
     1.7 + * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
     1.8   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.9   *
    1.10   * This code is free software; you can redistribute it and/or modify it
    1.11 @@ -40,7 +40,7 @@
    1.12  
    1.13  define_pd_global(intx,  StackYellowPages,     2);
    1.14  define_pd_global(intx,  StackRedPages,        1);
    1.15 -define_pd_global(intx,  StackShadowPages,     3 LP64_ONLY(+3) DEBUG_ONLY(+3));
    1.16 +define_pd_global(intx,  StackShadowPages,     5 LP64_ONLY(+1) DEBUG_ONLY(+3));
    1.17  
    1.18  define_pd_global(bool,  RewriteBytecodes,     true);
    1.19  define_pd_global(bool,  RewriteFrequentPairs, true);
     2.1 --- a/src/os_cpu/linux_zero/vm/os_linux_zero.hpp	Tue Feb 16 14:11:44 2010 -0800
     2.2 +++ b/src/os_cpu/linux_zero/vm/os_linux_zero.hpp	Thu Feb 18 10:44:14 2010 -0800
     2.3 @@ -1,6 +1,6 @@
     2.4  /*
     2.5   * Copyright 2003-2004 Sun Microsystems, Inc.  All Rights Reserved.
     2.6 - * Copyright 2007, 2008 Red Hat, Inc.
     2.7 + * Copyright 2007, 2008, 2010 Red Hat, Inc.
     2.8   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.9   *
    2.10   * This code is free software; you can redistribute it and/or modify it
    2.11 @@ -39,7 +39,13 @@
    2.12                    "stfd %0, 0(%2)\n"
    2.13                    : "=f"(tmp)
    2.14                    : "b"(src), "b"(dst));
    2.15 +#elif defined(S390) && !defined(_LP64)
    2.16 +    double tmp;
    2.17 +    asm volatile ("ld  %0, 0(%1)\n"
    2.18 +                  "std %0, 0(%2)\n"
    2.19 +                  : "=r"(tmp)
    2.20 +                  : "a"(src), "a"(dst));
    2.21  #else
    2.22      *(jlong *) dst = *(jlong *) src;
    2.23 -#endif // PPC && !_LP64
    2.24 +#endif
    2.25    }
     3.1 --- a/src/share/vm/opto/callGenerator.cpp	Tue Feb 16 14:11:44 2010 -0800
     3.2 +++ b/src/share/vm/opto/callGenerator.cpp	Thu Feb 18 10:44:14 2010 -0800
     3.3 @@ -1,5 +1,5 @@
     3.4  /*
     3.5 - * Copyright 2000-2009 Sun Microsystems, Inc.  All Rights Reserved.
     3.6 + * Copyright 2000-2010 Sun Microsystems, Inc.  All Rights Reserved.
     3.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.8   *
     3.9   * This code is free software; you can redistribute it and/or modify it
    3.10 @@ -136,8 +136,10 @@
    3.11      }
    3.12      // Mark the call node as virtual, sort of:
    3.13      call->set_optimized_virtual(true);
    3.14 -    if (method()->is_method_handle_invoke())
    3.15 +    if (method()->is_method_handle_invoke()) {
    3.16        call->set_method_handle_invoke(true);
    3.17 +      kit.C->set_has_method_handle_invokes(true);
    3.18 +    }
    3.19    }
    3.20    kit.set_arguments_for_java_call(call);
    3.21    kit.set_edges_for_java_call(call, false, _separate_io_proj);
    3.22 @@ -194,6 +196,7 @@
    3.23    call->set_optimized_virtual(true);
    3.24    // Take extra care (in the presence of argument motion) not to trash the SP:
    3.25    call->set_method_handle_invoke(true);
    3.26 +  kit.C->set_has_method_handle_invokes(true);
    3.27  
    3.28    // Pass the target MethodHandle as first argument and shift the
    3.29    // other arguments.
     4.1 --- a/src/share/vm/opto/compile.cpp	Tue Feb 16 14:11:44 2010 -0800
     4.2 +++ b/src/share/vm/opto/compile.cpp	Thu Feb 18 10:44:14 2010 -0800
     4.3 @@ -1,5 +1,5 @@
     4.4  /*
     4.5 - * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     4.6 + * Copyright 1997-2010 Sun Microsystems, Inc.  All Rights Reserved.
     4.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.8   *
     4.9   * This code is free software; you can redistribute it and/or modify it
    4.10 @@ -465,6 +465,7 @@
    4.11                    _code_buffer("Compile::Fill_buffer"),
    4.12                    _orig_pc_slot(0),
    4.13                    _orig_pc_slot_offset_in_bytes(0),
    4.14 +                  _has_method_handle_invokes(false),
    4.15                    _node_bundling_limit(0),
    4.16                    _node_bundling_base(NULL),
    4.17                    _java_calls(0),
    4.18 @@ -759,6 +760,7 @@
    4.19      _do_escape_analysis(false),
    4.20      _failure_reason(NULL),
    4.21      _code_buffer("Compile::Fill_buffer"),
    4.22 +    _has_method_handle_invokes(false),
    4.23      _node_bundling_limit(0),
    4.24      _node_bundling_base(NULL),
    4.25      _java_calls(0),
     5.1 --- a/src/share/vm/opto/compile.hpp	Tue Feb 16 14:11:44 2010 -0800
     5.2 +++ b/src/share/vm/opto/compile.hpp	Thu Feb 18 10:44:14 2010 -0800
     5.3 @@ -1,5 +1,5 @@
     5.4  /*
     5.5 - * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     5.6 + * Copyright 1997-2010 Sun Microsystems, Inc.  All Rights Reserved.
     5.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5.8   *
     5.9   * This code is free software; you can redistribute it and/or modify it
    5.10 @@ -166,6 +166,9 @@
    5.11    bool                  _parsed_irreducible_loop; // True if ciTypeFlow detected irreducible loops during parsing
    5.12  #endif
    5.13  
    5.14 +  // JSR 292
    5.15 +  bool                  _has_method_handle_invokes; // True if this method has MethodHandle invokes.
    5.16 +
    5.17    // Compilation environment.
    5.18    Arena                 _comp_arena;            // Arena with lifetime equivalent to Compile
    5.19    ciEnv*                _env;                   // CI interface
    5.20 @@ -336,6 +339,10 @@
    5.21    void          set_parsed_irreducible_loop(bool z) { _parsed_irreducible_loop = z; }
    5.22  #endif
    5.23  
    5.24 +  // JSR 292
    5.25 +  bool              has_method_handle_invokes() const { return _has_method_handle_invokes;     }
    5.26 +  void          set_has_method_handle_invokes(bool z) {        _has_method_handle_invokes = z; }
    5.27 +
    5.28    void begin_method() {
    5.29  #ifndef PRODUCT
    5.30      if (_printer) _printer->begin_method(this);
     6.1 --- a/src/share/vm/opto/output.cpp	Tue Feb 16 14:11:44 2010 -0800
     6.2 +++ b/src/share/vm/opto/output.cpp	Thu Feb 18 10:44:14 2010 -0800
     6.3 @@ -805,8 +805,12 @@
     6.4      mcall = mach->as_MachCall();
     6.5  
     6.6      // Is the call a MethodHandle call?
     6.7 -    if (mcall->is_MachCallJava())
     6.8 -      is_method_handle_invoke = mcall->as_MachCallJava()->_method_handle_invoke;
     6.9 +    if (mcall->is_MachCallJava()) {
    6.10 +      if (mcall->as_MachCallJava()->_method_handle_invoke) {
    6.11 +        assert(has_method_handle_invokes(), "must have been set during call generation");
    6.12 +        is_method_handle_invoke = true;
    6.13 +      }
    6.14 +    }
    6.15  
    6.16      // Check if a call returns an object.
    6.17      if (mcall->return_value_is_used() &&
    6.18 @@ -1092,9 +1096,21 @@
    6.19    deopt_handler_req += MAX_stubs_size; // add marginal slop for handler
    6.20    stub_req += MAX_stubs_size;   // ensure per-stub margin
    6.21    code_req += MAX_inst_size;    // ensure per-instruction margin
    6.22 +
    6.23    if (StressCodeBuffers)
    6.24      code_req = const_req = stub_req = exception_handler_req = deopt_handler_req = 0x10;  // force expansion
    6.25 -  int total_req = code_req + pad_req + stub_req + exception_handler_req + deopt_handler_req + const_req;
    6.26 +
    6.27 +  int total_req =
    6.28 +    code_req +
    6.29 +    pad_req +
    6.30 +    stub_req +
    6.31 +    exception_handler_req +
    6.32 +    deopt_handler_req +              // deopt handler
    6.33 +    const_req;
    6.34 +
    6.35 +  if (has_method_handle_invokes())
    6.36 +    total_req += deopt_handler_req;  // deopt MH handler
    6.37 +
    6.38    CodeBuffer* cb = code_buffer();
    6.39    cb->initialize(total_req, locs_req);
    6.40  
    6.41 @@ -1436,10 +1452,13 @@
    6.42      _code_offsets.set_value(CodeOffsets::Exceptions, emit_exception_handler(*cb));
    6.43      // Emit the deopt handler code.
    6.44      _code_offsets.set_value(CodeOffsets::Deopt, emit_deopt_handler(*cb));
    6.45 -    // Emit the MethodHandle deopt handler code.  We can use the same
    6.46 -    // code as for the normal deopt handler, we just need a different
    6.47 -    // entry point address.
    6.48 -    _code_offsets.set_value(CodeOffsets::DeoptMH, emit_deopt_handler(*cb));
    6.49 +
    6.50 +    // Emit the MethodHandle deopt handler code (if required).
    6.51 +    if (has_method_handle_invokes()) {
    6.52 +      // We can use the same code as for the normal deopt handler, we
    6.53 +      // just need a different entry point address.
    6.54 +      _code_offsets.set_value(CodeOffsets::DeoptMH, emit_deopt_handler(*cb));
    6.55 +    }
    6.56    }
    6.57  
    6.58    // One last check for failed CodeBuffer::expand:
     7.1 --- a/src/share/vm/opto/parse1.cpp	Tue Feb 16 14:11:44 2010 -0800
     7.2 +++ b/src/share/vm/opto/parse1.cpp	Thu Feb 18 10:44:14 2010 -0800
     7.3 @@ -824,7 +824,6 @@
     7.4    case Bytecodes::_ddiv:
     7.5    case Bytecodes::_checkcast:
     7.6    case Bytecodes::_instanceof:
     7.7 -  case Bytecodes::_athrow:
     7.8    case Bytecodes::_anewarray:
     7.9    case Bytecodes::_newarray:
    7.10    case Bytecodes::_multianewarray:
    7.11 @@ -834,6 +833,8 @@
    7.12      return true;
    7.13      break;
    7.14  
    7.15 +  // Don't rerun athrow since it's part of the exception path.
    7.16 +  case Bytecodes::_athrow:
    7.17    case Bytecodes::_invokestatic:
    7.18    case Bytecodes::_invokedynamic:
    7.19    case Bytecodes::_invokespecial:
     8.1 --- a/src/share/vm/runtime/sharedRuntime.cpp	Tue Feb 16 14:11:44 2010 -0800
     8.2 +++ b/src/share/vm/runtime/sharedRuntime.cpp	Thu Feb 18 10:44:14 2010 -0800
     8.3 @@ -1947,7 +1947,7 @@
     8.4  
     8.5   private:
     8.6  
     8.7 -#ifdef ASSERT
     8.8 +#ifndef PRODUCT
     8.9    static int _lookups; // number of calls to lookup
    8.10    static int _buckets; // number of buckets checked
    8.11    static int _equals;  // number of buckets checked with matching hash
    8.12 @@ -1983,16 +1983,16 @@
    8.13  
    8.14    // Find a entry with the same fingerprint if it exists
    8.15    AdapterHandlerEntry* lookup(int total_args_passed, BasicType* sig_bt) {
    8.16 -    debug_only(_lookups++);
    8.17 +    NOT_PRODUCT(_lookups++);
    8.18      AdapterFingerPrint fp(total_args_passed, sig_bt);
    8.19      unsigned int hash = fp.compute_hash();
    8.20      int index = hash_to_index(hash);
    8.21      for (AdapterHandlerEntry* e = bucket(index); e != NULL; e = e->next()) {
    8.22 -      debug_only(_buckets++);
    8.23 +      NOT_PRODUCT(_buckets++);
    8.24        if (e->hash() == hash) {
    8.25 -        debug_only(_equals++);
    8.26 +        NOT_PRODUCT(_equals++);
    8.27          if (fp.equals(e->fingerprint())) {
    8.28 -#ifdef ASSERT
    8.29 +#ifndef PRODUCT
    8.30            if (fp.is_compact()) _compact++;
    8.31            _hits++;
    8.32  #endif
    8.33 @@ -2003,6 +2003,7 @@
    8.34      return NULL;
    8.35    }
    8.36  
    8.37 +#ifndef PRODUCT
    8.38    void print_statistics() {
    8.39      ResourceMark rm;
    8.40      int longest = 0;
    8.41 @@ -2021,15 +2022,14 @@
    8.42      }
    8.43      tty->print_cr("AdapterHandlerTable: empty %d longest %d total %d average %f",
    8.44                    empty, longest, total, total / (double)nonempty);
    8.45 -#ifdef ASSERT
    8.46      tty->print_cr("AdapterHandlerTable: lookups %d buckets %d equals %d hits %d compact %d",
    8.47                    _lookups, _buckets, _equals, _hits, _compact);
    8.48 +  }
    8.49  #endif
    8.50 -  }
    8.51  };
    8.52  
    8.53  
    8.54 -#ifdef ASSERT
    8.55 +#ifndef PRODUCT
    8.56  
    8.57  int AdapterHandlerTable::_lookups;
    8.58  int AdapterHandlerTable::_buckets;

mercurial