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 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_rewriter.cpp.incl" 27 28 // Computes a CPC map (new_index -> original_index) for constant pool entries 29 // that are referred to by the interpreter at runtime via the constant pool cache. 30 // Also computes a CP map (original_index -> new_index). 31 // Marks entries in CP which require additional processing. 32 void Rewriter::compute_index_maps() { 33 const int length = _pool->length(); 34 init_cp_map(length); 35 jint tag_mask = 0; 36 for (int i = 0; i < length; i++) { 37 int tag = _pool->tag_at(i).value(); 38 tag_mask |= (1 << tag); 39 switch (tag) { 40 case JVM_CONSTANT_InterfaceMethodref: 41 case JVM_CONSTANT_Fieldref : // fall through 42 case JVM_CONSTANT_Methodref : // fall through 43 case JVM_CONSTANT_MethodHandle : // fall through 44 case JVM_CONSTANT_MethodType : // fall through 45 case JVM_CONSTANT_InvokeDynamic : // fall through 46 add_cp_cache_entry(i); | 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 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "interpreter/bytecodes.hpp" 27 #include "interpreter/interpreter.hpp" 28 #include "interpreter/rewriter.hpp" 29 #include "memory/gcLocker.hpp" 30 #include "memory/oopFactory.hpp" 31 #include "memory/resourceArea.hpp" 32 #include "oops/generateOopMap.hpp" 33 #include "oops/objArrayOop.hpp" 34 #include "oops/oop.inline.hpp" 35 #include "prims/methodComparator.hpp" 36 37 // Computes a CPC map (new_index -> original_index) for constant pool entries 38 // that are referred to by the interpreter at runtime via the constant pool cache. 39 // Also computes a CP map (original_index -> new_index). 40 // Marks entries in CP which require additional processing. 41 void Rewriter::compute_index_maps() { 42 const int length = _pool->length(); 43 init_cp_map(length); 44 jint tag_mask = 0; 45 for (int i = 0; i < length; i++) { 46 int tag = _pool->tag_at(i).value(); 47 tag_mask |= (1 << tag); 48 switch (tag) { 49 case JVM_CONSTANT_InterfaceMethodref: 50 case JVM_CONSTANT_Fieldref : // fall through 51 case JVM_CONSTANT_Methodref : // fall through 52 case JVM_CONSTANT_MethodHandle : // fall through 53 case JVM_CONSTANT_MethodType : // fall through 54 case JVM_CONSTANT_InvokeDynamic : // fall through 55 add_cp_cache_entry(i); |