本文整理汇总了C++中methodHandle::verifier_max_stack方法的典型用法代码示例。如果您正苦于以下问题:C++ methodHandle::verifier_max_stack方法的具体用法?C++ methodHandle::verifier_max_stack怎么用?C++ methodHandle::verifier_max_stack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类methodHandle
的用法示例。
在下文中一共展示了methodHandle::verifier_max_stack方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write_code_attribute
//.........这里部分代码省略.........
attr_size += 2 + 4 + 2 + line_num_cnt * (2 + 2);
}
}
if (method->has_stackmap_table()) {
stackmap_len = method->stackmap_data()->length();
if (stackmap_len != 0) {
++attr_count;
// Compute the size of the stack map table attribute (VM stores raw):
// StackMapTable_attribute {
// u2 attribute_name_index;
// u4 attribute_length;
// u2 number_of_entries;
// stack_map_frame_entries[number_of_entries];
// }
attr_size += 2 + 4 + stackmap_len;
}
}
if (method->has_localvariable_table()) {
local_variable_table_length = method->localvariable_table_length();
if (local_variable_table_length != 0) {
++attr_count;
// Compute the size of the local variable table attribute (VM stores raw):
// LocalVariableTable_attribute {
// u2 attribute_name_index;
// u4 attribute_length;
// u2 local_variable_table_length;
// {
// u2 start_pc;
// u2 length;
// u2 name_index;
// u2 descriptor_index;
// u2 index;
// }
attr_size += 2 + 4 + 2 + local_variable_table_length * (2 + 2 + 2 + 2 + 2);
// Local variables with generic signatures must have LVTT entries
LocalVariableTableElement *elem = method->localvariable_table_start();
for (int idx = 0; idx < local_variable_table_length; idx++) {
if (elem[idx].signature_cp_index != 0) {
local_variable_type_table_length++;
}
}
if (local_variable_type_table_length != 0) {
++attr_count;
// Compute the size of the local variable type table attribute (VM stores raw):
// LocalVariableTypeTable_attribute {
// u2 attribute_name_index;
// u4 attribute_length;
// u2 local_variable_type_table_length;
// {
// u2 start_pc;
// u2 length;
// u2 name_index;
// u2 signature_index;
// u2 index;
// }
attr_size += 2 + 4 + 2 + local_variable_type_table_length * (2 + 2 + 2 + 2 + 2);
}
}
}
ExceptionTable exception_table(method());
int exception_table_length = exception_table.length();
int code_size = const_method->code_size();
int size =
2+2+4 + // max_stack, max_locals, code_length
code_size + // code
2 + // exception_table_length
(2+2+2+2) * exception_table_length + // exception_table
2 + // attributes_count
attr_size; // attributes
write_attribute_name_index("Code");
write_u4(size);
write_u2(method->verifier_max_stack());
write_u2(method->max_locals());
write_u4(code_size);
copy_bytecodes(method, (unsigned char*)writeable_address(code_size));
write_u2(exception_table_length);
for (int index = 0; index < exception_table_length; index++) {
write_u2(exception_table.start_pc(index));
write_u2(exception_table.end_pc(index));
write_u2(exception_table.handler_pc(index));
write_u2(exception_table.catch_type_index(index));
}
write_u2(attr_count);
if (line_num_cnt != 0) {
write_line_number_table_attribute(method, line_num_cnt);
}
if (stackmap_len != 0) {
write_stackmap_table_attribute(method, stackmap_len);
}
if (local_variable_table_length != 0) {
write_local_variable_table_attribute(method, local_variable_table_length);
}
if (local_variable_type_table_length != 0) {
write_local_variable_type_table_attribute(method, local_variable_type_table_length);
}
}