Class CodeGenerationAggregates
java.lang.Object
org.ek9lang.compiler.CompilerPhase
org.ek9lang.compiler.phase10.CodeGenerationAggregates
- All Implemented Interfaces:
BiFunction<Workspace, CompilerFlags, CompilationPhaseResult>
Generate all type of aggregates, typically classes, components, records, etc.
See compilationContext.commandLine().targetArchitecture to determine what to prepare to create.
SINGLE THREADED per program. The whole phase runs inside the compilableProgramAccess.accept
lock; code generation of a construct can trigger LAZY symbol resolution (e.g.
getAllEffectiveMethods -> type coercion -> ModuleScope.resolveInThisModuleOnly),
which re-enters that same lock. A parallel stream would run that re-entry on a DIFFERENT thread and
deadlock re-acquiring the (non-cross-thread-reentrant) lock - so output is generated sequentially on
the lock-holding thread where the ReentrantLock IS reentrant. The
lock already serialises all program access, so a second parallel layer here gains nothing.
-
Field Summary
Fields inherited from class CompilerPhase
compilableProgramAccess, listener, reporter -
Constructor Summary
ConstructorsConstructorDescriptionCodeGenerationAggregates(SharedThreadContext<CompilableProgram> compilableProgramAccess, FileHandling fileHandling, Consumer<CompilationEvent> listener, CompilerReporter reporter) -
Method Summary
Modifier and TypeMethodDescriptionbooleandoApply(Workspace workspace, CompilerFlags compilerFlags) Do the compilation phase.Methods inherited from class CompilerPhase
apply, getParsedModuleForSourceMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiFunction
andThen
-
Constructor Details
-
Method Details
-
doApply
Description copied from class:CompilerPhaseDo the compilation phase.- Specified by:
doApplyin classCompilerPhase
-