本文整理汇总了C++中ConstantPool::method_at_put方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstantPool::method_at_put方法的具体用法?C++ ConstantPool::method_at_put怎么用?C++ ConstantPool::method_at_put使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConstantPool
的用法示例。
在下文中一共展示了ConstantPool::method_at_put方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create_constant_pool
ConstantPool* BytecodeConstantPool::create_constant_pool(TRAPS) const {
if (_entries.length() == 0) {
return _orig;
}
ConstantPool* cp = ConstantPool::allocate(
_orig->pool_holder()->class_loader_data(),
_orig->length() + _entries.length(), CHECK_NULL);
cp->set_pool_holder(_orig->pool_holder());
_orig->copy_cp_to(1, _orig->length() - 1, cp, 1, CHECK_NULL);
for (int i = 0; i < _entries.length(); ++i) {
BytecodeCPEntry entry = _entries.at(i);
int idx = i + _orig->length();
switch (entry._tag) {
case BytecodeCPEntry::UTF8:
entry._u.utf8->increment_refcount();
cp->symbol_at_put(idx, entry._u.utf8);
break;
case BytecodeCPEntry::KLASS:
cp->unresolved_klass_at_put(
idx, cp->symbol_at(entry._u.klass));
break;
case BytecodeCPEntry::STRING:
cp->unresolved_string_at_put(
idx, cp->symbol_at(entry._u.string));
break;
case BytecodeCPEntry::NAME_AND_TYPE:
cp->name_and_type_at_put(idx,
entry._u.name_and_type.name_index,
entry._u.name_and_type.type_index);
break;
case BytecodeCPEntry::METHODREF:
cp->method_at_put(idx,
entry._u.methodref.class_index,
entry._u.methodref.name_and_type_index);
break;
default:
ShouldNotReachHere();
}
}
return cp;
}