27 #include "classfile/bytecodeAssembler.hpp" 28 #include "interpreter/bytecodes.hpp" 29 #include "memory/oopFactory.hpp" 30 #include "oops/constantPool.hpp" 31 32 #ifdef TARGET_ARCH_x86 33 # include "bytes_x86.hpp" 34 #endif 35 #ifdef TARGET_ARCH_sparc 36 # include "bytes_sparc.hpp" 37 #endif 38 #ifdef TARGET_ARCH_zero 39 # include "bytes_zero.hpp" 40 #endif 41 #ifdef TARGET_ARCH_arm 42 # include "bytes_arm.hpp" 43 #endif 44 #ifdef TARGET_ARCH_ppc 45 # include "bytes_ppc.hpp" 46 #endif 47 48 u2 BytecodeConstantPool::find_or_add(BytecodeCPEntry const& bcpe) { 49 u2 index; 50 u2* probe = _indices.get(bcpe); 51 if (probe == NULL) { 52 index = _entries.length(); 53 _entries.append(bcpe); 54 _indices.put(bcpe, index); 55 } else { 56 index = *probe; 57 } 58 return index + _orig->length(); 59 } 60 61 ConstantPool* BytecodeConstantPool::create_constant_pool(TRAPS) const { 62 if (_entries.length() == 0) { 63 return _orig; 64 } 65 66 ConstantPool* cp = ConstantPool::allocate( | 27 #include "classfile/bytecodeAssembler.hpp" 28 #include "interpreter/bytecodes.hpp" 29 #include "memory/oopFactory.hpp" 30 #include "oops/constantPool.hpp" 31 32 #ifdef TARGET_ARCH_x86 33 # include "bytes_x86.hpp" 34 #endif 35 #ifdef TARGET_ARCH_sparc 36 # include "bytes_sparc.hpp" 37 #endif 38 #ifdef TARGET_ARCH_zero 39 # include "bytes_zero.hpp" 40 #endif 41 #ifdef TARGET_ARCH_arm 42 # include "bytes_arm.hpp" 43 #endif 44 #ifdef TARGET_ARCH_ppc 45 # include "bytes_ppc.hpp" 46 #endif 47 #ifdef TARGET_ARCH_aarch64 48 # include "bytes_aarch64.hpp" 49 #endif 50 51 u2 BytecodeConstantPool::find_or_add(BytecodeCPEntry const& bcpe) { 52 u2 index; 53 u2* probe = _indices.get(bcpe); 54 if (probe == NULL) { 55 index = _entries.length(); 56 _entries.append(bcpe); 57 _indices.put(bcpe, index); 58 } else { 59 index = *probe; 60 } 61 return index + _orig->length(); 62 } 63 64 ConstantPool* BytecodeConstantPool::create_constant_pool(TRAPS) const { 65 if (_entries.length() == 0) { 66 return _orig; 67 } 68 69 ConstantPool* cp = ConstantPool::allocate( |