aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/prims
diff options
context:
space:
mode:
Diffstat (limited to 'src/share/vm/prims')
-rw-r--r--src/share/vm/prims/jvm.cpp13
-rw-r--r--src/share/vm/prims/jvmtiClassFileReconstituter.cpp19
-rw-r--r--src/share/vm/prims/jvmtiRedefineClasses.cpp20
-rw-r--r--src/share/vm/prims/methodHandleWalk.cpp7
4 files changed, 25 insertions, 34 deletions
diff --git a/src/share/vm/prims/jvm.cpp b/src/share/vm/prims/jvm.cpp
index 1dfec11a8..a211004a3 100644
--- a/src/share/vm/prims/jvm.cpp
+++ b/src/share/vm/prims/jvm.cpp
@@ -35,6 +35,7 @@
#include "oops/fieldStreams.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/objArrayKlass.hpp"
+#include "oops/methodOop.hpp"
#include "prims/jvm.h"
#include "prims/jvm_misc.hpp"
#include "prims/jvmtiExport.hpp"
@@ -2183,11 +2184,11 @@ JVM_QUICK_ENTRY(void, JVM_GetMethodIxExceptionTableEntry(JNIEnv *env, jclass cls
klassOop k = java_lang_Class::as_klassOop(JNIHandles::resolve_non_null(cls));
k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
oop method = instanceKlass::cast(k)->methods()->obj_at(method_index);
- typeArrayOop extable = methodOop(method)->exception_table();
- entry->start_pc = extable->int_at(entry_index * 4);
- entry->end_pc = extable->int_at(entry_index * 4 + 1);
- entry->handler_pc = extable->int_at(entry_index * 4 + 2);
- entry->catchType = extable->int_at(entry_index * 4 + 3);
+ ExceptionTable extable((methodOop(method)));
+ entry->start_pc = extable.start_pc(entry_index);
+ entry->end_pc = extable.end_pc(entry_index);
+ entry->handler_pc = extable.handler_pc(entry_index);
+ entry->catchType = extable.catch_type_index(entry_index);
JVM_END
@@ -2196,7 +2197,7 @@ JVM_QUICK_ENTRY(jint, JVM_GetMethodIxExceptionTableLength(JNIEnv *env, jclass cl
klassOop k = java_lang_Class::as_klassOop(JNIHandles::resolve_non_null(cls));
k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
oop method = instanceKlass::cast(k)->methods()->obj_at(method_index);
- return methodOop(method)->exception_table()->length() / 4;
+ return methodOop(method)->exception_table_length();
JVM_END
diff --git a/src/share/vm/prims/jvmtiClassFileReconstituter.cpp b/src/share/vm/prims/jvmtiClassFileReconstituter.cpp
index 60a801213..826556955 100644
--- a/src/share/vm/prims/jvmtiClassFileReconstituter.cpp
+++ b/src/share/vm/prims/jvmtiClassFileReconstituter.cpp
@@ -191,15 +191,14 @@ void JvmtiClassFileReconstituter::write_code_attribute(methodHandle method) {
}
}
- typeArrayHandle exception_table(thread(), const_method->exception_table());
- int exception_table_length = exception_table->length();
- int exception_table_entries = exception_table_length / 4;
+ 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_entries + // exception_table
+ (2+2+2+2) * exception_table_length + // exception_table
2 + // attributes_count
attr_size; // attributes
@@ -209,12 +208,12 @@ void JvmtiClassFileReconstituter::write_code_attribute(methodHandle method) {
write_u2(method->max_locals());
write_u4(code_size);
copy_bytecodes(method, (unsigned char*)writeable_address(code_size));
- write_u2(exception_table_entries);
- for (int index = 0; index < exception_table_length; ) {
- write_u2(exception_table->int_at(index++));
- write_u2(exception_table->int_at(index++));
- write_u2(exception_table->int_at(index++));
- write_u2(exception_table->int_at(index++));
+ 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) {
diff --git a/src/share/vm/prims/jvmtiRedefineClasses.cpp b/src/share/vm/prims/jvmtiRedefineClasses.cpp
index dbab30e43..2c0550e9e 100644
--- a/src/share/vm/prims/jvmtiRedefineClasses.cpp
+++ b/src/share/vm/prims/jvmtiRedefineClasses.cpp
@@ -2478,23 +2478,17 @@ void VM_RedefineClasses::set_new_constant_pool(
// to use new constant pool indices as needed. The exception table
// holds quadruple entries of the form:
// (beg_bci, end_bci, handler_bci, klass_index)
- const int beg_bci_offset = 0;
- const int end_bci_offset = 1;
- const int handler_bci_offset = 2;
- const int klass_index_offset = 3;
- const int entry_size = 4;
-
- typeArrayHandle ex_table (THREAD, method->exception_table());
- int ext_length = ex_table->length();
- assert(ext_length % entry_size == 0, "exception table format has changed");
-
- for (int j = 0; j < ext_length; j += entry_size) {
- int cur_index = ex_table->int_at(j + klass_index_offset);
+
+ ExceptionTable ex_table(method());
+ int ext_length = ex_table.length();
+
+ for (int j = 0; j < ext_length; j ++) {
+ int cur_index = ex_table.catch_type_index(j);
int new_index = find_new_index(cur_index);
if (new_index != 0) {
RC_TRACE_WITH_THREAD(0x00080000, THREAD,
("ext-klass_index change: %d to %d", cur_index, new_index));
- ex_table->int_at_put(j + klass_index_offset, new_index);
+ ex_table.set_catch_type_index(j, new_index);
}
} // end for each exception table entry
diff --git a/src/share/vm/prims/methodHandleWalk.cpp b/src/share/vm/prims/methodHandleWalk.cpp
index d4d9a7130..68e83bdc7 100644
--- a/src/share/vm/prims/methodHandleWalk.cpp
+++ b/src/share/vm/prims/methodHandleWalk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1796,7 +1796,7 @@ methodHandle MethodHandleCompiler::get_method_oop(TRAPS) {
{
methodOop m_oop = oopFactory::new_method(bytecode_length(),
accessFlags_from(flags_bits),
- 0, 0, 0, oopDesc::IsSafeConc, CHECK_(empty));
+ 0, 0, 0, 0, oopDesc::IsSafeConc, CHECK_(empty));
m = methodHandle(THREAD, m_oop);
}
@@ -1812,9 +1812,6 @@ methodHandle MethodHandleCompiler::get_method_oop(TRAPS) {
m->set_max_locals(max_locals());
m->set_size_of_parameters(_num_params);
- typeArrayHandle exception_handlers(THREAD, Universe::the_empty_int_array());
- m->set_exception_table(exception_handlers());
-
// Rewrite the method and set up the constant pool cache.
objArrayOop m_array = oopFactory::new_system_objArray(1, CHECK_(empty));
objArrayHandle methods(THREAD, m_array);