Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1fccdcfdf2e6
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ca03093602f5
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Apr 15, 2015

  1. 1
    Copy the full SHA
    4020d0a View commit details
  2. Copy the full SHA
    ca03093 View commit details
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/module/method_added_tags.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -153,7 +153,13 @@ public class CoreLibrary {
@CompilerDirectives.CompilationFinal private RubySymbol mapBangSymbol;
@CompilerDirectives.CompilationFinal private RubyHash envHash;

private boolean loadingCoreLibrary;
public static enum State {
INITIALIZING,
LOADING_RUBY_CORE,
LOADED
}

private State state = State.INITIALIZING;

public CoreLibrary(RubyContext context) {
this.context = context;
@@ -505,7 +511,7 @@ public void initializeAfterMethodsAdded() {

if (Options.TRUFFLE_LOAD_CORE.load()) {
try {
loadingCoreLibrary = true;
state = State.LOADING_RUBY_CORE;
loadRubyCore("core.rb");
} catch (RaiseException e) {
final RubyException rubyException = e.getRubyException();
@@ -516,7 +522,7 @@ public void initializeAfterMethodsAdded() {

throw new TruffleFatalException("couldn't load the core library", e);
} finally {
loadingCoreLibrary = false;
state = State.LOADED;
}
}
}
@@ -1269,7 +1275,11 @@ public RubySymbol getMapSymbol() {
return mapSymbol;
}

public boolean isLoadingCoreLibrary() {
return loadingCoreLibrary;
public boolean isLoadingRubyCore() {
return state == State.LOADING_RUBY_CORE;
}

public State getState() {
return state;
}
}
Original file line number Diff line number Diff line change
@@ -200,7 +200,7 @@ public void include(Node currentNode, RubyModule module) {
*/
@TruffleBoundary
public void setConstant(Node currentNode, String name, Object value) {
if (getContext().getCoreLibrary().isLoadingCoreLibrary()) {
if (getContext().getCoreLibrary().isLoadingRubyCore()) {
final RubyConstant currentConstant = constants.get(name);

if (currentConstant != null) {
@@ -271,7 +271,7 @@ public void addMethod(Node currentNode, InternalMethod method) {

assert method != null;

if (getContext().getCoreLibrary().isLoadingCoreLibrary()) {
if (getContext().getCoreLibrary().isLoadingRubyCore()) {
final InternalMethod currentMethod = methods.get(method.getName());

if (currentMethod != null && currentMethod.getSharedMethodInfo().getSourceSection() instanceof CoreSourceSection) {
@@ -282,6 +282,10 @@ public void addMethod(Node currentNode, InternalMethod method) {
checkFrozen(currentNode);
methods.put(method.getName(), method.withDeclaringModule(this));
newVersion();

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

@TruffleBoundary