Skip to content

Commit

Permalink
Merge branch 'master' into truffle-head
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Jan 2, 2015
2 parents a5b1f0a + fb9199f commit 63420d6
Show file tree
Hide file tree
Showing 26 changed files with 365 additions and 332 deletions.
34 changes: 15 additions & 19 deletions core/src/main/java/org/jruby/Ruby.java
Expand Up @@ -41,6 +41,8 @@

import org.jruby.compiler.Constantizable;
import org.jruby.compiler.NotCompilableException;
import org.jruby.ext.jruby.JRubyLibrary;
import org.jruby.ext.thread.ThreadLibrary;
import org.jruby.ir.IRScriptBody;
import org.jruby.parser.StaticScope;
import org.objectweb.asm.util.TraceClassVisitor;
Expand Down Expand Up @@ -73,7 +75,6 @@
import org.jruby.ext.ffi.FFI;
import org.jruby.ext.fiber.ThreadFiber;
import org.jruby.ext.fiber.ThreadFiberLibrary;
import org.jruby.ext.jruby.JRubyConfigLibrary;
import org.jruby.ext.tracepoint.TracePoint;
import org.jruby.internal.runtime.GlobalVariables;
import org.jruby.internal.runtime.ThreadService;
Expand Down Expand Up @@ -1535,12 +1536,12 @@ private void initCore() {
RubyEnumerator.defineEnumerator(this);
}

// Fiber depends on thread library, so we load it here
new ThreadLibrary().load(this, false);

new ThreadFiberLibrary().load(this, false);

TracePoint.createTracePointClass(this);

// Load the JRuby::Config module for accessing configuration settings from Ruby
new JRubyConfigLibrary().load(this, false);
}

public static final int NIL_PREFILLED_ARRAY_SIZE = RubyArray.ARRAY_DEFAULT_SIZE * 8;
Expand Down Expand Up @@ -1722,21 +1723,16 @@ private void initBuiltins() {
addLazyBuiltin("coverage.jar", "coverage", "org.jruby.ext.coverage.CoverageLibrary");

// TODO: implement something for these?
Library dummy = new Library() {
public void load(Ruby runtime, boolean wrap) throws IOException {
// dummy library that does nothing right now
}
};
addBuiltinIfAllowed("continuation.rb", dummy);
addBuiltinIfAllowed("io/nonblock.rb", dummy);

// rb_provide logic, in a roundabout way
addLazyBuiltin("enumerator.jar", "enumerator", "org.jruby.ext.enumerator.EnumeratorLibrary");
loadService.require("enumerator.jar");
addBuiltinIfAllowed("rational.jar", dummy);
loadService.require("rational.jar");
addBuiltinIfAllowed("complex.jar", dummy);
loadService.require("complex.jar");
addBuiltinIfAllowed("continuation.rb", Library.DUMMY);
addBuiltinIfAllowed("io/nonblock.rb", Library.DUMMY);

// for backward compatibility
loadService.provide("enumerator.jar"); // can't be in RubyEnumerator because LoadService isn't ready then
loadService.provide("rational.jar");
loadService.provide("complex.jar");

// we define the classes at boot because we need them
addBuiltinIfAllowed("thread.rb", Library.DUMMY);

if(RubyInstanceConfig.NATIVE_NET_PROTOCOL) {
addLazyBuiltin("net/protocol.rb", "net/protocol", "org.jruby.ext.net.protocol.NetProtocolBufferedIOLibrary");
Expand Down

0 comments on commit 63420d6

Please sign in to comment.