Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/oops/constantPoolOop.hpp
          +++ new/src/share/vm/oops/constantPoolOop.hpp
   1    1  /*
   2      - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
        2 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
   3    3   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4    4   *
   5    5   * This code is free software; you can redistribute it and/or modify it
   6    6   * under the terms of the GNU General Public License version 2 only, as
   7    7   * published by the Free Software Foundation.
   8    8   *
   9    9   * This code is distributed in the hope that it will be useful, but WITHOUT
  10   10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11   11   * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12   12   * version 2 for more details (a copy is included in the LICENSE file that
↓ open down ↓ 409 lines elided ↑ open up ↑
 422  422      return string_at_impl(h_this, which, CHECK_NULL);
 423  423    }
 424  424  
 425  425    oop object_at(int which) {
 426  426      assert(tag_at(which).is_object(), "Corrupted constant pool");
 427  427      return slot_at(which).get_oop();
 428  428    }
 429  429  
 430  430    // A "pseudo-string" is an non-string oop that has found is way into
 431  431    // a String entry.
 432      -  // Under AnonymousClasses this can happen if the user patches a live
      432 +  // Under EnableInvokeDynamic this can happen if the user patches a live
 433  433    // object into a CONSTANT_String entry of an anonymous class.
 434  434    // Method oops internally created for method handles may also
 435  435    // use pseudo-strings to link themselves to related metaobjects.
 436  436  
 437  437    bool is_pseudo_string_at(int which);
 438  438  
 439  439    oop pseudo_string_at(int which) {
 440  440      assert(tag_at(which).is_string(), "Corrupted constant pool");
 441  441      return slot_at(which).get_oop();
 442  442    }
 443  443  
 444  444    void pseudo_string_at_put(int which, oop x) {
 445      -    assert(AnonymousClasses, "");
      445 +    assert(EnableInvokeDynamic, "");
 446  446      set_pseudo_string();        // mark header
 447  447      assert(tag_at(which).is_string() || tag_at(which).is_unresolved_string(), "Corrupted constant pool");
 448  448      string_at_put(which, x);    // this works just fine
 449  449    }
 450  450  
 451  451    // only called when we are sure a string entry is already resolved (via an
 452  452    // earlier string_at call.
 453  453    oop resolved_string_at(int which) {
 454  454      assert(tag_at(which).is_string(), "Corrupted constant pool");
 455  455      // Must do an acquire here in case another thread resolved the klass
↓ open down ↓ 416 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX