comparison src/share/vm/graal/graalCompilerToVM.cpp @ 5544:20e390e09717

Convert ExceptionHandler class from interface to final data class. Remove CiExceptionHandler and HotSpotExceptionHandler classes and replace usages with ExceptionHandler class.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 09 Jun 2012 17:35:43 +0200
parents b4c406861c33
children b6617d13ea44
comparison
equal deleted inserted replaced
5543:25d561cfdcfa 5544:20e390e09717
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 // exception handlers are stored as four integers: start bci, end bci, handler bci, catch class constant pool index
111 int base = i * 4; 111 int base = i * 4;
112 Handle entry = instanceKlass::cast(HotSpotExceptionHandler::klass())->allocate_instance(CHECK_NULL); 112 Handle entry = instanceKlass::cast(HotSpotExceptionHandler::klass())->allocate_instance(CHECK_NULL);
113 HotSpotExceptionHandler::set_startBci(entry, handlers->int_at(base + 0)); 113 HotSpotExceptionHandler::set_startBCI(entry, handlers->int_at(base + 0));
114 HotSpotExceptionHandler::set_endBci(entry, handlers->int_at(base + 1)); 114 HotSpotExceptionHandler::set_endBCI(entry, handlers->int_at(base + 1));
115 HotSpotExceptionHandler::set_handlerBci(entry, handlers->int_at(base + 2)); 115 HotSpotExceptionHandler::set_handlerBCI(entry, handlers->int_at(base + 2));
116 int catch_class_index = handlers->int_at(base + 3); 116 int catch_class_index = handlers->int_at(base + 3);
117 HotSpotExceptionHandler::set_catchClassIndex(entry, catch_class_index); 117 HotSpotExceptionHandler::set_catchTypeCPI(entry, catch_class_index);
118 118
119 if (catch_class_index == 0) { 119 if (catch_class_index == 0) {
120 HotSpotExceptionHandler::set_catchClass(entry, NULL); 120 HotSpotExceptionHandler::set_catchType(entry, NULL);
121 } else { 121 } else {
122 constantPoolOop cp = instanceKlass::cast(method->method_holder())->constants(); 122 constantPoolOop cp = instanceKlass::cast(method->method_holder())->constants();
123 KlassHandle loading_klass = method->method_holder(); 123 KlassHandle loading_klass = method->method_holder();
124 Handle catch_class = GraalCompiler::get_RiType(cp, catch_class_index, loading_klass, CHECK_NULL); 124 Handle catch_class = GraalCompiler::get_RiType(cp, catch_class_index, loading_klass, CHECK_NULL);
125 if (catch_class->klass() == HotSpotTypeResolved::klass() && java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(catch_class)) == SystemDictionary::Throwable_klass()) { 125 if (catch_class->klass() == HotSpotTypeResolved::klass() && java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(catch_class)) == SystemDictionary::Throwable_klass()) {
126 HotSpotExceptionHandler::set_catchClass(entry, NULL); 126 HotSpotExceptionHandler::set_catchType(entry, NULL);
127 HotSpotExceptionHandler::set_catchClassIndex(entry, 0); 127 HotSpotExceptionHandler::set_catchTypeCPI(entry, 0);
128 } else { 128 } else {
129 HotSpotExceptionHandler::set_catchClass(entry, catch_class()); 129 HotSpotExceptionHandler::set_catchType(entry, catch_class());
130 } 130 }
131 } 131 }
132 array->obj_at_put(i, entry()); 132 array->obj_at_put(i, entry());
133 } 133 }
134 134