Changeset 1391 for branches/GNU/src/gcc/libjava/defineclass.cc
- Timestamp:
- Apr 27, 2004, 8:39:34 PM (22 years ago)
- Location:
- branches/GNU/src/gcc
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
libjava/defineclass.cc (modified) (10 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/gcc
- Property svn:ignore
-
old new 26 26 configure.vr 27 27 configure.vrs 28 28 29 Makefile 29 dir.info30 30 lost+found 31 31 update.out
-
- Property svn:ignore
-
branches/GNU/src/gcc/libjava/defineclass.cc
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r1390 r1391 1 1 // defineclass.cc - defining a class from .class format. 2 2 3 /* Copyright (C) 1999, 2000, 2001 Free Software Foundation3 /* Copyright (C) 1999, 2000, 2001 Free Software Foundation 4 4 5 5 This file is part of libgcj. … … 36 36 #include <java/lang/NoClassDefFoundError.h> 37 37 #include <java/lang/ClassCircularityError.h> 38 #include <java/lang/ClassNotFoundException.h>39 38 #include <java/lang/IncompatibleClassChangeError.h> 40 39 #include <java/lang/reflect/Modifier.h> … … 894 893 } 895 894 896 def->accflags = access_flags ;895 def->accflags = access_flags; 897 896 pool_data[this_class].clazz = def; 898 897 pool_tags[this_class] = JV_CONSTANT_ResolvedClass; 899 898 900 if (super_class == 0) 901 { 902 // interfaces have java.lang.Object as super. 903 if (access_flags & Modifier::INTERFACE) 904 { 905 def->superclass = (jclass)&java::lang::Object::class$; 906 } 907 899 if (super_class == 0 && ! (access_flags & Modifier::INTERFACE)) 900 { 908 901 // FIXME: Consider this carefully! 909 else if (!_Jv_equalUtf8Consts (def->name, 910 java::lang::Object::class$.name)) 911 { 912 throw_no_class_def_found_error ("loading java.lang.Object"); 913 } 902 if (! _Jv_equalUtf8Consts (def->name, java::lang::Object::class$.name)) 903 throw_no_class_def_found_error ("loading java.lang.Object"); 914 904 } 915 905 … … 927 917 if (super_class != 0) 928 918 { 929 // load the super class919 // 930 920 check_tag (super_class, JV_CONSTANT_Class); 931 921 _Jv_Utf8Const* super_name = pool_data[super_class].utf8; 932 922 933 // load the super class using our defining loader923 // 934 924 jclass the_super = _Jv_FindClass (super_name, 935 925 def->loader); 936 926 937 927 // This will establish that we are allowed to be a subclass, 938 // and check for class circularity error 928 // and check for class circularity error 939 929 checkExtends (def, the_super); 940 930 941 def->superclass = the_super; 931 // Note: for an interface we will find Object as the 932 // superclass. We still check it above to ensure class file 933 // validity, but we simply assign `null' to the actual field in 934 // this case. 935 def->superclass = (((access_flags & Modifier::INTERFACE)) 936 ? NULL : the_super); 942 937 pool_data[super_class].clazz = the_super; 943 938 pool_tags[super_class] = JV_CONSTANT_ResolvedClass; 944 939 } 945 940 946 // now we've come past the circularity problem, we can947 // now say that we're loading. ..941 // ow we've come past the circularity problem, we can 942 // now say that we're loading. 948 943 949 944 def->state = JV_STATE_LOADING; … … 1192 1187 _Jv_ClassReader::handleMethodsBegin (int count) 1193 1188 { 1194 def->methods = (_Jv_Method*) 1195 _Jv_AllocBytes (sizeof (_Jv_Method)*count); 1189 def->methods = (_Jv_Method *) _Jv_AllocBytes (sizeof (_Jv_Method) * count); 1196 1190 1197 1191 def->interpreted_methods … … 1200 1194 1201 1195 for (int i = 0; i < count; i++) 1202 def->interpreted_methods[i] = 0; 1196 { 1197 def->interpreted_methods[i] = 0; 1198 def->methods[i].index = (_Jv_ushort) -1; 1199 } 1203 1200 1204 1201 def->method_count = count; … … 1265 1262 method->defining_class = def; 1266 1263 method->self = &def->methods[method_index]; 1264 1267 1265 1268 1266 // grab the byte code! … … 1274 1272 } 1275 1273 1276 void _Jv_ClassReader::handleExceptionTableEntry 1274 void _Jv_ClassReader::handleExceptionTableEntry 1277 1275 (int method_index, int exc_index, 1278 1276 int start_pc, int end_pc, int handler_pc, int catch_type) … … 1282 1280 _Jv_InterpException *exc = method->exceptions (); 1283 1281 1284 exc[exc_index].start_pc = start_pc;1285 exc[exc_index].end_pc = end_pc;1286 exc[exc_index].handler_pc = handler_pc;1287 exc[exc_index].handler_type = catch_type;1282 exc[exc_index].start_pc = start_pc; 1283 exc[exc_index].end_pc = end_pc; 1284 exc[exc_index].handler_pc = handler_pc; 1285 exc[exc_index].handler_type = catch_type; 1288 1286 } 1289 1287 … … 1384 1382 } 1385 1383 1386 static void throw_incompatible_class_change_error (jstring msg) 1384 static void 1385 throw_incompatible_class_change_error (jstring msg) 1387 1386 { 1388 1387 throw new java::lang::IncompatibleClassChangeError (msg); 1389 1388 } 1390 1389 1391 static void throw_class_circularity_error (jstring msg) 1390 static void 1391 throw_class_circularity_error (jstring msg) 1392 1392 { 1393 1393 throw new java::lang::ClassCircularityError (msg); -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.
