--- old/src/share/vm/oops/constantPool.hpp Thu Jan 15 20:40:27 2015 +++ new/src/share/vm/oops/constantPool.hpp Thu Jan 15 20:40:27 2015 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -73,6 +73,9 @@ friend class BytecodeInterpreter; // Directly extracts a klass in the pool for fast instanceof/checkcast friend class Universe; // For null constructor private: + static const char* CPH_STR; + static const int CPH_LEN; + private: Array* _tags; // the tag array describing the constant pool's contents ConstantPoolCache* _cache; // the cache holding interpreter runtime information InstanceKlass* _pool_holder; // the corresponding class @@ -405,13 +408,13 @@ // use pseudo-strings to link themselves to related metaobjects. bool is_pseudo_string_at(int which) { - // A pseudo string is a string that doesn't have a symbol in the cpSlot - return unresolved_string_at(which) == NULL; + char* utf8 = unresolved_string_at(which)->as_utf8(); + return strlen(utf8) > CPH_LEN && strncmp(utf8, CPH_STR, CPH_LEN) == 0; } oop pseudo_string_at(int which, int obj_index) { assert(tag_at(which).is_string(), "Corrupted constant pool"); - assert(unresolved_string_at(which) == NULL, "shouldn't have symbol"); + assert(is_pseudo_string_at(which), "must be a pseudo-string"); oop s = resolved_references()->obj_at(obj_index); return s; } @@ -418,7 +421,7 @@ oop pseudo_string_at(int which) { assert(tag_at(which).is_string(), "Corrupted constant pool"); - assert(unresolved_string_at(which) == NULL, "shouldn't have symbol"); + assert(is_pseudo_string_at(which), "must be a pseudo-string"); int obj_index = cp_to_object_index(which); oop s = resolved_references()->obj_at(obj_index); return s; @@ -426,7 +429,6 @@ void pseudo_string_at_put(int which, int obj_index, oop x) { assert(tag_at(which).is_string(), "Corrupted constant pool"); - unresolved_string_at_put(which, NULL); // indicates patched string string_at_put(which, obj_index, x); // this works just fine }