src/share/vm/opto/graphKit.cpp

changeset 1687
f516d5d7a019
parent 1601
7b0e9cba0307
child 1692
7b4415a18c8a
     1.1 --- a/src/share/vm/opto/graphKit.cpp	Sun Feb 07 12:15:06 2010 -0800
     1.2 +++ b/src/share/vm/opto/graphKit.cpp	Mon Feb 08 12:20:09 2010 -0800
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright 2001-2009 Sun Microsystems, Inc.  All Rights Reserved.
     1.6 + * Copyright 2001-2010 Sun Microsystems, Inc.  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 @@ -752,12 +752,20 @@
    1.11  
    1.12  // Helper function for enforcing certain bytecodes to reexecute if
    1.13  // deoptimization happens
    1.14 -static bool should_reexecute_implied_by_bytecode(JVMState *jvms) {
    1.15 +static bool should_reexecute_implied_by_bytecode(JVMState *jvms, bool is_anewarray) {
    1.16    ciMethod* cur_method = jvms->method();
    1.17    int       cur_bci   = jvms->bci();
    1.18    if (cur_method != NULL && cur_bci != InvocationEntryBci) {
    1.19      Bytecodes::Code code = cur_method->java_code_at_bci(cur_bci);
    1.20 -    return Interpreter::bytecode_should_reexecute(code);
    1.21 +    return Interpreter::bytecode_should_reexecute(code) ||
    1.22 +           is_anewarray && code == Bytecodes::_multianewarray;
    1.23 +    // Reexecute _multianewarray bytecode which was replaced with
    1.24 +    // sequence of [a]newarray. See Parse::do_multianewarray().
    1.25 +    //
    1.26 +    // Note: interpreter should not have it set since this optimization
    1.27 +    // is limited by dimensions and guarded by flag so in some cases
    1.28 +    // multianewarray() runtime calls will be generated and
    1.29 +    // the bytecode should not be reexecutes (stack will not be reset).
    1.30    } else
    1.31      return false;
    1.32  }
    1.33 @@ -808,7 +816,7 @@
    1.34    // For a known set of bytecodes, the interpreter should reexecute them if
    1.35    // deoptimization happens. We set the reexecute state for them here
    1.36    if (out_jvms->is_reexecute_undefined() && //don't change if already specified
    1.37 -      should_reexecute_implied_by_bytecode(out_jvms)) {
    1.38 +      should_reexecute_implied_by_bytecode(out_jvms, call->is_AllocateArray())) {
    1.39      out_jvms->set_should_reexecute(true); //NOTE: youngest_jvms not changed
    1.40    }
    1.41  

mercurial