Class SymbolDefinition
java.lang.Object
org.ek9lang.compiler.CompilerPhase
org.ek9lang.compiler.phase1.SymbolDefinition
- All Implemented Interfaces:
BiFunction<Workspace, CompilerFlags, CompilationPhaseResult>
SINGLE THREADED. It was multi-threaded, and the parallel machinery was deliberately removed:
every definition goes through the CompilableProgram's exclusive lock, so more threads made it
slower rather than faster. This phase is ~18% of a 1M compile and parallelising it needs the
lock contention solved first, not more threads.
Goes through the now successfully parse source files and uses
a listener to do the first real pass at building the IR - simple Symbol definitions.
This means identifying types and other symbols.
Note that most of the real processing is done in the
DefinitionListener.
This is just the wrapper entry point that is public, so it can be plugged into the
FrontEndSupplier.-
Field Summary
Fields inherited from class CompilerPhase
compilableProgramAccess, listener, modelFrozen, reporter -
Constructor Summary
ConstructorsConstructorDescriptionSymbolDefinition(boolean notBootStrapping, SharedThreadContext<CompilableProgram> compilableProgramAccess, Consumer<CompilationEvent> listener, CompilerReporter reporter) Create a symbol definition instance, stating whether this is a normal compilation or the language bootstrap.SymbolDefinition(SharedThreadContext<CompilableProgram> compilableProgramAccess, Consumer<CompilationEvent> listener, CompilerReporter reporter) Create a new phase 1 symbol definition instance for normal (non-bootstrap) compilation. -
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
-