Skip to content

Commit

Permalink
[Truffle] Encapsulate the State of CoreLibrary.
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Apr 15, 2015
1 parent ca03093 commit 543890d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -153,7 +153,7 @@ public class CoreLibrary {
@CompilerDirectives.CompilationFinal private RubySymbol mapBangSymbol;
@CompilerDirectives.CompilationFinal private RubyHash envHash;

public static enum State {
private static enum State {
INITIALIZING,
LOADING_RUBY_CORE,
LOADED
Expand Down Expand Up @@ -1279,7 +1279,7 @@ public boolean isLoadingRubyCore() {
return state == State.LOADING_RUBY_CORE;
}

public State getState() {
return state;
public boolean isLoaded() {
return state == State.LOADED;
}
}
Expand Up @@ -283,7 +283,7 @@ public void addMethod(Node currentNode, InternalMethod method) {
methods.put(method.getName(), method.withDeclaringModule(this));
newVersion();

if (context.getCoreLibrary().getState() == CoreLibrary.State.LOADED) {
if (context.getCoreLibrary().isLoaded()) {
DebugOperations.send(context, this, "method_added", null, context.getSymbolTable().getSymbol(method.getName()));
}
}
Expand Down

0 comments on commit 543890d

Please sign in to comment.