src/share/vm/interpreter/bytecode.cpp

changeset 2462
8012aa3ccede
parent 2314
f95d63e2154a
child 2497
3582bf76420e
     1.1 --- a/src/share/vm/interpreter/bytecode.cpp	Wed Jan 12 13:59:18 2011 -0800
     1.2 +++ b/src/share/vm/interpreter/bytecode.cpp	Thu Jan 13 22:15:41 2011 -0800
     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 @@ -34,30 +34,6 @@
    1.11  
    1.12  // Implementation of Bytecode
    1.13  
    1.14 -bool Bytecode::check_must_rewrite(Bytecodes::Code code) const {
    1.15 -  assert(Bytecodes::can_rewrite(code), "post-check only");
    1.16 -
    1.17 -  // Some codes are conditionally rewriting.  Look closely at them.
    1.18 -  switch (code) {
    1.19 -  case Bytecodes::_aload_0:
    1.20 -    // Even if RewriteFrequentPairs is turned on,
    1.21 -    // the _aload_0 code might delay its rewrite until
    1.22 -    // a following _getfield rewrites itself.
    1.23 -    return false;
    1.24 -
    1.25 -  case Bytecodes::_lookupswitch:
    1.26 -    return false;  // the rewrite is not done by the interpreter
    1.27 -
    1.28 -  case Bytecodes::_new:
    1.29 -    // (Could actually look at the class here, but the profit would be small.)
    1.30 -    return false;  // the rewrite is not always done
    1.31 -  }
    1.32 -
    1.33 -  // No other special cases.
    1.34 -  return true;
    1.35 -}
    1.36 -
    1.37 -
    1.38  #ifdef ASSERT
    1.39  
    1.40  void Bytecode::assert_same_format_as(Bytecodes::Code testbc, bool is_wide) const {
    1.41 @@ -188,17 +164,16 @@
    1.42    // Note:  Rewriter::rewrite changes the Java_u2 of an invokedynamic to a native_u4,
    1.43    // at the same time it allocates per-call-site CP cache entries.
    1.44    Bytecodes::Code rawc = code();
    1.45 -  Bytecode* invoke = bytecode();
    1.46 -  if (invoke->has_index_u4(rawc))
    1.47 -    return invoke->get_index_u4(rawc);
    1.48 +  if (has_index_u4(rawc))
    1.49 +    return get_index_u4(rawc);
    1.50    else
    1.51 -    return invoke->get_index_u2_cpcache(rawc);
    1.52 +    return get_index_u2_cpcache(rawc);
    1.53  }
    1.54  
    1.55  int Bytecode_member_ref::pool_index() const {
    1.56    int index = this->index();
    1.57    DEBUG_ONLY({
    1.58 -      if (!bytecode()->has_index_u4(code()))
    1.59 +      if (!has_index_u4(code()))
    1.60          index -= constantPoolOopDesc::CPCACHE_INDEX_TAG;
    1.61      });
    1.62    return _method->constants()->cache()->entry_at(index)->constant_pool_index();
    1.63 @@ -214,13 +189,12 @@
    1.64  // Implementation of Bytecode_loadconstant
    1.65  
    1.66  int Bytecode_loadconstant::raw_index() const {
    1.67 -  Bytecode* bcp = bytecode();
    1.68 -  Bytecodes::Code rawc = bcp->code();
    1.69 +  Bytecodes::Code rawc = code();
    1.70    assert(rawc != Bytecodes::_wide, "verifier prevents this");
    1.71    if (Bytecodes::java_code(rawc) == Bytecodes::_ldc)
    1.72 -    return bcp->get_index_u1(rawc);
    1.73 +    return get_index_u1(rawc);
    1.74    else
    1.75 -    return bcp->get_index_u2(rawc, false);
    1.76 +    return get_index_u2(rawc, false);
    1.77  }
    1.78  
    1.79  int Bytecode_loadconstant::pool_index() const {
    1.80 @@ -258,7 +232,7 @@
    1.81      case Bytecodes::_lookupswitch:
    1.82        { int i = number_of_pairs() - 1;
    1.83          while (i-- > 0) {
    1.84 -          assert(pair_at(i)->match() < pair_at(i+1)->match(), "unsorted table entries");
    1.85 +          assert(pair_at(i).match() < pair_at(i+1).match(), "unsorted table entries");
    1.86          }
    1.87        }
    1.88        break;

mercurial