comparison src/share/vm/graal/graalCompilerToVM.cpp @ 6275:957c266d8bc5

Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author Doug Simon <doug.simon@oracle.com>
date Tue, 21 Aug 2012 10:39:19 +0200
parents 58a607307306
children dddcdb7ae209
comparison
equal deleted inserted replaced
5891:fd8832ae511d 6275:957c266d8bc5
98 JNIEXPORT jobjectArray JNICALL Java_com_oracle_graal_hotspot_bridge_CompilerToVMImpl_JavaMethod_1exceptionHandlers(JNIEnv *, jobject, jobject hotspot_method) { 98 JNIEXPORT jobjectArray JNICALL Java_com_oracle_graal_hotspot_bridge_CompilerToVMImpl_JavaMethod_1exceptionHandlers(JNIEnv *, jobject, jobject hotspot_method) {
99 TRACE_graal_3("CompilerToVM::JavaMethod_exceptionHandlers"); 99 TRACE_graal_3("CompilerToVM::JavaMethod_exceptionHandlers");
100 VM_ENTRY_MARK 100 VM_ENTRY_MARK
101 ResourceMark rm; 101 ResourceMark rm;
102 methodHandle method = getMethodFromHotSpotMethod(hotspot_method); 102 methodHandle method = getMethodFromHotSpotMethod(hotspot_method);
103 typeArrayHandle handlers = method->exception_table(); 103 int handler_count = method->exception_table_length();
104 int handler_count = handlers.is_null() ? 0 : handlers->length() / 4; 104 ExceptionTableElement* handlers = handler_count == 0 ? NULL : method->exception_table_start();
105 105
106 instanceKlass::cast(ExceptionHandler::klass())->initialize(CHECK_NULL); 106 instanceKlass::cast(ExceptionHandler::klass())->initialize(CHECK_NULL);
107 objArrayHandle array = oopFactory::new_objArray(SystemDictionary::ExceptionHandler_klass(), handler_count, CHECK_NULL); 107 objArrayHandle array = oopFactory::new_objArray(SystemDictionary::ExceptionHandler_klass(), handler_count, CHECK_NULL);
108 108
109 for (int i = 0; i < handler_count; i++) { 109 for (int i = 0; i < handler_count; i++) {
110 // exception handlers are stored as four integers: start bci, end bci, handler bci, catch class constant pool index 110 ExceptionTableElement* handler = handlers + i;
111 int base = i * 4;
112 Handle entry = instanceKlass::cast(ExceptionHandler::klass())->allocate_instance(CHECK_NULL); 111 Handle entry = instanceKlass::cast(ExceptionHandler::klass())->allocate_instance(CHECK_NULL);
113 ExceptionHandler::set_startBCI(entry, handlers->int_at(base + 0)); 112 ExceptionHandler::set_startBCI(entry, handler->start_pc);
114 ExceptionHandler::set_endBCI(entry, handlers->int_at(base + 1)); 113 ExceptionHandler::set_endBCI(entry, handler->end_pc);
115 ExceptionHandler::set_handlerBCI(entry, handlers->int_at(base + 2)); 114 ExceptionHandler::set_handlerBCI(entry, handler->handler_pc);
116 int catch_class_index = handlers->int_at(base + 3); 115 int catch_class_index = handler->catch_type_index;
117 ExceptionHandler::set_catchTypeCPI(entry, catch_class_index); 116 ExceptionHandler::set_catchTypeCPI(entry, catch_class_index);
118 117
119 if (catch_class_index == 0) { 118 if (catch_class_index == 0) {
120 ExceptionHandler::set_catchType(entry, NULL); 119 ExceptionHandler::set_catchType(entry, NULL);
121 } else { 120 } else {