Mercurial > hg > truffle
comparison src/share/vm/oops/methodOop.hpp @ 6227:dd785aabe02b
Merge
author | kvn |
---|---|
date | Tue, 17 Jul 2012 11:16:13 -0700 |
parents | 9c9fb30d2b3b e74da3c2b827 |
children | 1d7922586cf6 |
comparison
equal
deleted
inserted
replaced
6226:9c9fb30d2b3b | 6227:dd785aabe02b |
---|---|
281 void set_stackmap_data(typeArrayOop sd) { | 281 void set_stackmap_data(typeArrayOop sd) { |
282 constMethod()->set_stackmap_data(sd); | 282 constMethod()->set_stackmap_data(sd); |
283 } | 283 } |
284 | 284 |
285 // exception handler table | 285 // exception handler table |
286 typeArrayOop exception_table() const | |
287 { return constMethod()->exception_table(); } | |
288 void set_exception_table(typeArrayOop e) | |
289 { constMethod()->set_exception_table(e); } | |
290 bool has_exception_handler() const | 286 bool has_exception_handler() const |
291 { return constMethod()->has_exception_handler(); } | 287 { return constMethod()->has_exception_handler(); } |
288 int exception_table_length() const | |
289 { return constMethod()->exception_table_length(); } | |
290 ExceptionTableElement* exception_table_start() const | |
291 { return constMethod()->exception_table_start(); } | |
292 | 292 |
293 // Finds the first entry point bci of an exception handler for an | 293 // Finds the first entry point bci of an exception handler for an |
294 // exception of klass ex_klass thrown at throw_bci. A value of NULL | 294 // exception of klass ex_klass thrown at throw_bci. A value of NULL |
295 // for ex_klass indicates that the exception klass is not known; in | 295 // for ex_klass indicates that the exception klass is not known; in |
296 // this case it matches any constraint class. Returns -1 if the | 296 // this case it matches any constraint class. Returns -1 if the |
837 | 837 |
838 void set(methodOop method); | 838 void set(methodOop method); |
839 void clear(methodOop method); | 839 void clear(methodOop method); |
840 }; | 840 }; |
841 | 841 |
842 // Utility class for access exception handlers | |
843 class ExceptionTable : public StackObj { | |
844 private: | |
845 ExceptionTableElement* _table; | |
846 u2 _length; | |
847 | |
848 public: | |
849 ExceptionTable(methodOop m) { | |
850 if (m->has_exception_handler()) { | |
851 _table = m->exception_table_start(); | |
852 _length = m->exception_table_length(); | |
853 } else { | |
854 _table = NULL; | |
855 _length = 0; | |
856 } | |
857 } | |
858 | |
859 int length() const { | |
860 return _length; | |
861 } | |
862 | |
863 u2 start_pc(int idx) const { | |
864 assert(idx < _length, "out of bounds"); | |
865 return _table[idx].start_pc; | |
866 } | |
867 | |
868 void set_start_pc(int idx, u2 value) { | |
869 assert(idx < _length, "out of bounds"); | |
870 _table[idx].start_pc = value; | |
871 } | |
872 | |
873 u2 end_pc(int idx) const { | |
874 assert(idx < _length, "out of bounds"); | |
875 return _table[idx].end_pc; | |
876 } | |
877 | |
878 void set_end_pc(int idx, u2 value) { | |
879 assert(idx < _length, "out of bounds"); | |
880 _table[idx].end_pc = value; | |
881 } | |
882 | |
883 u2 handler_pc(int idx) const { | |
884 assert(idx < _length, "out of bounds"); | |
885 return _table[idx].handler_pc; | |
886 } | |
887 | |
888 void set_handler_pc(int idx, u2 value) { | |
889 assert(idx < _length, "out of bounds"); | |
890 _table[idx].handler_pc = value; | |
891 } | |
892 | |
893 u2 catch_type_index(int idx) const { | |
894 assert(idx < _length, "out of bounds"); | |
895 return _table[idx].catch_type_index; | |
896 } | |
897 | |
898 void set_catch_type_index(int idx, u2 value) { | |
899 assert(idx < _length, "out of bounds"); | |
900 _table[idx].catch_type_index = value; | |
901 } | |
902 }; | |
903 | |
842 #endif // SHARE_VM_OOPS_METHODOOP_HPP | 904 #endif // SHARE_VM_OOPS_METHODOOP_HPP |