equal
deleted
inserted
replaced
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 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
427 return slot_at(which).get_oop(); |
427 return slot_at(which).get_oop(); |
428 } |
428 } |
429 |
429 |
430 // A "pseudo-string" is an non-string oop that has found is way into |
430 // A "pseudo-string" is an non-string oop that has found is way into |
431 // a String entry. |
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 // object into a CONSTANT_String entry of an anonymous class. |
433 // object into a CONSTANT_String entry of an anonymous class. |
434 // Method oops internally created for method handles may also |
434 // Method oops internally created for method handles may also |
435 // use pseudo-strings to link themselves to related metaobjects. |
435 // use pseudo-strings to link themselves to related metaobjects. |
436 |
436 |
437 bool is_pseudo_string_at(int which); |
437 bool is_pseudo_string_at(int which); |
440 assert(tag_at(which).is_string(), "Corrupted constant pool"); |
440 assert(tag_at(which).is_string(), "Corrupted constant pool"); |
441 return slot_at(which).get_oop(); |
441 return slot_at(which).get_oop(); |
442 } |
442 } |
443 |
443 |
444 void pseudo_string_at_put(int which, oop x) { |
444 void pseudo_string_at_put(int which, oop x) { |
445 assert(AnonymousClasses, ""); |
445 assert(EnableInvokeDynamic, ""); |
446 set_pseudo_string(); // mark header |
446 set_pseudo_string(); // mark header |
447 assert(tag_at(which).is_string() || tag_at(which).is_unresolved_string(), "Corrupted constant pool"); |
447 assert(tag_at(which).is_string() || tag_at(which).is_unresolved_string(), "Corrupted constant pool"); |
448 string_at_put(which, x); // this works just fine |
448 string_at_put(which, x); // this works just fine |
449 } |
449 } |
450 |
450 |