| Summary: | [compiler] cannot compile multiple toplevel teams in the same compilation unit | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] Objectteams | Reporter: | Stephan Herrmann <stephan.herrmann> | ||||
| Component: | OTJ | Assignee: | Stephan Herrmann <stephan.herrmann> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | ||||||
| Version: | 0.7 | ||||||
| Target Milestone: | 0.7 M3 | ||||||
| Hardware: | Other | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Stephan Herrmann
Created attachment 170236 [details]
several fixes
Test CompilationOrder.testB22_twoToplevelTeams2() witnesses some problems,
but the AIOOBE could only be reproduced in the IDE.
Fixes are based on the following findings:
- MethodModel could use inconsistent pair of (constant pool) offsets
and bytes. This happened when the array of offsets was reused from another
class with more constant pool entries. Thus the bytes array was indexed with
a too large index -> AIOOBE.
Fixed by always respecting ConstantPool.currentIndex as the length of offsets
- RoleModel could try to retrieve a class file from disk in a state where
the ClassFile was created but not yet written to disk.
Fixed by retrieving class bytes via the CompilationResult
(this also an optimization).
- I observed attempts to generateCode types from the same CU out of order,
due to re-entrance via Dependencies.
Fixed by marking the translation state at the end of
TypeDeclaration.generatedCode. This fixes the ICE.
- additional issues in BytecodeTransformer:
- if dstType is already a team don't travel to enclosing type
- ensure srcModel & method.declaringClass match
Patch has been committed as r379. verified for M3 using 201005282024 |