Changeset 2186 for trunk/ProjectFortress
- Timestamp:
- 07/05/08 04:00:26 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ProjectFortress/src/com/sun/fortress/compiler/environments/TopLevelEnvGen.java
r2185 r2186 159 159 String className = NodeUtil.nameString(apiName); 160 160 className = className + API_ENV_SUFFIX; 161 162 byte[] envClass = generateForCompilationUnit(className, apis.get(apiName), env); 163 compiledApis.put(apiName, envClass); 161 162 try { 163 byte[] envClass = generateForCompilationUnit(className, apis.get(apiName), env); 164 compiledApis.put(apiName, envClass); 165 } catch(StaticError staticError) { 166 errors.add(staticError); 167 } 164 168 } 165 169 … … 231 235 Relation<String, Integer> apiEnvHashCode = new IndexedRelation<String,Integer>(); 232 236 233 writeImportFields(cw, compUnitIndex, apiEnvHashCode); 234 writeFields(cw, compUnitIndex, fValueHashCode, fTypeHashCode); 237 writeFields(cw, compUnitIndex, fValueHashCode, fTypeHashCode, apiEnvHashCode); 235 238 writeMethodInit(cw, className); 236 239 … … 249 252 } 250 253 254 /** 255 * Write the import statments as fields in this compiled environment. 256 * This method will be invoked by writeFields(). 257 */ 251 258 private static void writeImportFields(ClassWriter cw, CompilationUnitIndex compUnitIndex, 252 259 Relation<String,Integer> apiEnvHashCode) { … … 276 283 } 277 284 285 /** 286 * Write all the fields that will be used in this compiled environment 287 */ 278 288 private static void writeFields(ClassWriter cw, CompilationUnitIndex compUnitIndex, 279 289 Relation<String, Integer> fValueHashCode, 280 Relation<String, Integer> fTypeHashCode) { 290 Relation<String, Integer> fTypeHashCode, 291 Relation<String, Integer> apiEnvHashCode) { 281 292 282 293 // Create all variables as fields in the environment … … 303 314 cw.visitField(Opcodes.ACC_PUBLIC, mangleIdentifier(idString), EnvironmentClasses.FTYPE.descriptor(), null, null).visitEnd(); 304 315 } 316 317 writeImportFields(cw, compUnitIndex, apiEnvHashCode); 305 318 } 306 319
