Class BackgroundCompileQueue

java.lang.Object
com.oracle.truffle.runtime.BackgroundCompileQueue

public class BackgroundCompileQueue extends Object
The compilation queue accepts compilation requests, and schedules compilations. The current queuing policy is to first schedule all the first tier compilation requests, and only handle second tier compilation requests when there are no first tier compilations left. Between the compilation requests of the same optimization tier, the queuing policy is FIFO (first-in-first-out). Note that all the compilation requests are second tier when the multi-tier option is turned off.
  • Field Details

  • Constructor Details

  • Method Details

    • newThreadFactory

      protected ThreadFactory newThreadFactory(String threadNamePrefix, OptimizedCallTarget callTarget)
    • submitCompilation

      public CompilationTask submitCompilation(com.oracle.truffle.runtime.BackgroundCompileQueue.Priority priority, OptimizedCallTarget target)
    • submitInitialization

      public CompilationTask submitInitialization(OptimizedCallTarget target, Consumer<CompilationTask> action)
    • flush

      public final void flush(EngineData engine)
      Flushes and cancels all compilations in the queue at the next opportunity. This also includes currently active compilations.
    • getQueueSize

      public int getQueueSize()
    • getQueuedTargets

      public Collection<OptimizedCallTarget> getQueuedTargets(EngineData engine)
      Return call targets waiting in queue. This does not include call targets currently being compiled. If engine is null, the call targets for all engines are returned, otherwise only the call targets belonging to engine will be returned.
    • getAllTargets

      public Collection<OptimizedCallTarget> getAllTargets(EngineData engine)
      Return all call targets currently active or in the queue. This does also include all call targets being compiled. This method guarantees that all call targets either active or queued are returned and no targets are missed that are currently about to be compiled. If engine is null, the call targets for all engines are returned, otherwise only the call targets belonging to engine will be returned.
    • shutdownAndAwaitTermination

      public void shutdownAndAwaitTermination(long timeout)
      Flushes all compilations, shuts the compilation queue down and awaits its termination with the given timeout.
    • notifyIdleCompilerThread

      protected void notifyIdleCompilerThread()
      Called when a compiler thread becomes idle for more than delayMillis.