Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'truffle-head' into truffle-new-instrumentation
Browse files Browse the repository at this point in the history
# Conflicts:
#	truffle/pom.rb
#	truffle/pom.xml
#	truffle/src/main/java/org/jruby/truffle/language/translator/BodyTranslator.java
#	truffle/src/main/java/org/jruby/truffle/runtime/RubyLanguage.java
#	truffle/src/main/java/org/jruby/truffle/runtime/subsystems/AttachmentsManager.java
chrisseaton committed Feb 4, 2016
2 parents 2786a43 + b14e1cc commit fe72d62
Showing 949 changed files with 17,186 additions and 10,161 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ branches:
- /^ha-feature/

script: tool/travis_runner.sh
install: travis_retry ./mvnw -Pbootstrap clean install -Dinvoker.skip -Dmaven.test.skip
install: travis_retry ./mvnw -Pbootstrap clean install -B -Dinvoker.skip -Dmaven.test.skip

notifications:
irc:
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.0.5.0-SNAPSHOT
9.1.0.0-SNAPSHOT
4 changes: 2 additions & 2 deletions bin/ast
Original file line number Diff line number Diff line change
@@ -169,7 +169,7 @@ def print_passes_on(scope, passes)
end

scope.lexical_scopes.each do |child_scope|
child_scope.prepare_for_initial_compilation
child_scope.prepare_for_compilation
print_passes_on(child_scope, passes)
end
end
@@ -195,7 +195,7 @@ def ir_setup(root)
builder = org.jruby.ir.IRBuilder

scope = builder.build_root(manager, root).scope
scope.prepare_for_initial_compilation
scope.prepare_for_compilation
passes = manager.get_compiler_passes(scope)
[scope, passes]
end
2 changes: 1 addition & 1 deletion bin/jruby.bash
Original file line number Diff line number Diff line change
@@ -383,7 +383,7 @@ if [ "$VERIFY_JRUBY" != "" ]; then
"-Djruby.home=$JRUBY_HOME" \
"-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
"-Djruby.shell=$JRUBY_SHELL" \
$java_class $JRUBY_OPTS "$@"
$java_class $mode "$@"

# Record the exit status immediately, or it will be overridden.
JRUBY_STATUS=$?
4 changes: 2 additions & 2 deletions core/pom.rb
Original file line number Diff line number Diff line change
@@ -45,15 +45,15 @@
jar 'com.github.jnr:jnr-enxio:0.10', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-x86asm:1.0.2', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-unixsocket:0.10', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-posix:3.0.23', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-posix:3.0.28-SNAPSHOT', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-constants:0.9.0', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-ffi:2.0.7'
jar 'com.github.jnr:jffi:${jffi.version}'
jar 'com.github.jnr:jffi:${jffi.version}:native'

jar 'org.jruby.joni:joni:2.1.9'
jar 'org.jruby.extras:bytelist:1.0.13'
jar 'org.jruby.jcodings:jcodings:1.0.16'
jar 'org.jruby.jcodings:jcodings:1.0.17'
jar 'org.jruby:dirgra:0.3'

jar 'com.headius:invokebinder:1.7'
6 changes: 3 additions & 3 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ DO NOT MODIFIY - GENERATED CODE
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-parent</artifactId>
<version>9.0.5.0-SNAPSHOT</version>
<version>9.1.0.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-core</artifactId>
<name>JRuby Core</name>
@@ -136,7 +136,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-posix</artifactId>
<version>3.0.23</version>
<version>3.0.28-SNAPSHOT</version>
<exclusions>
<exclusion>
<artifactId>jnr-ffi</artifactId>
@@ -184,7 +184,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>org.jruby.jcodings</groupId>
<artifactId>jcodings</artifactId>
<version>1.0.16</version>
<version>1.0.17</version>
</dependency>
<dependency>
<groupId>org.jruby</groupId>
127 changes: 127 additions & 0 deletions core/src/main/java/org/jruby/ReifiedRubyObject.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
/*
***** BEGIN LICENSE BLOCK *****
* Version: EPL 1.0/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Eclipse Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.eclipse.org/legal/epl-v10.html
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the EPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the EPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
package org.jruby;

/**
* A RubyObject that provides a direct field for up to ten stored variables, to avoid
* the overhead of creating and managing a separate array and reference.
*/
public abstract class ReifiedRubyObject extends RubyObject {
public ReifiedRubyObject(Ruby runtime, RubyClass metaClass) {
super(runtime, metaClass);
}

@Override
public Object getVariable(int i) {
return super.getVariable(i);
}

@Override
public void setVariable(int index, Object value) {
super.setVariable(index, value);
}

public Object getVariable0() {
return getVariable(0);
}

public Object getVariable1() {
return getVariable(1);
}

public Object getVariable2() {
return getVariable(2);
}

public Object getVariable3() {
return getVariable(3);
}

public Object getVariable4() {
return getVariable(4);
}

public Object getVariable5() {
return getVariable(5);
}

public Object getVariable6() {
return getVariable(6);
}

public Object getVariable7() {
return getVariable(7);
}

public Object getVariable8() {
return getVariable(8);
}

public Object getVariable9() {
return getVariable(9);
}

public void setVariable0(Object value) {
setVariable(0, value);
}

public void setVariable1(Object value) {
setVariable(1, value);
}

public void setVariable2(Object value) {
setVariable(2, value);
}

public void setVariable3(Object value) {
setVariable(3, value);
}

public void setVariable4(Object value) {
setVariable(4, value);
}

public void setVariable5(Object value) {
setVariable(5, value);
}

public void setVariable6(Object value) {
setVariable(6, value);
}

public void setVariable7(Object value) {
setVariable(7, value);
}

public void setVariable8(Object value) {
setVariable(8, value);
}

public void setVariable9(Object value) {
setVariable(9, value);
}
}
56 changes: 40 additions & 16 deletions core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
@@ -2838,31 +2838,30 @@ public PrintStream getOutputStream() {
return new PrintStream(new IOOutputStream(getGlobalVariables().get("$stdout")));
}

public RubyModule getClassFromPath(String path) {
RubyModule c = getObject();
public RubyModule getClassFromPath(final String path) {
if (path.length() == 0 || path.charAt(0) == '#') {
throw newTypeError("can't retrieve anonymous class " + path);
}

RubyModule c = getObject();
int pbeg = 0, p = 0;
for(int l=path.length(); p<l; ) {
while(p<l && path.charAt(p) != ':') {
p++;
}
String str = path.substring(pbeg, p);
for ( final int l = path.length(); p < l; ) {
while ( p < l && path.charAt(p) != ':' ) p++;

final String str = path.substring(pbeg, p);

if(p<l && path.charAt(p) == ':') {
if(p+1 < l && path.charAt(p+1) != ':') {
throw newTypeError("undefined class/module " + path.substring(pbeg,p));
if ( p < l && path.charAt(p) == ':' ) {
if ( ++p < l && path.charAt(p) != ':' ) {
throw newTypeError("undefined class/module " + str);
}
p += 2;
pbeg = p;
pbeg = ++p;
}

IRubyObject cc = c.getConstant(str);
if(!(cc instanceof RubyModule)) {
if ( ! ( cc instanceof RubyModule ) ) {
throw newTypeError(path + " does not refer to class/module");
}
c = (RubyModule)cc;
c = (RubyModule) cc;
}
return c;
}
@@ -2887,7 +2886,7 @@ public void printError(RubyException excp) {
}

public void loadFile(String scriptName, InputStream in, boolean wrap) {
IRubyObject self = wrap ? TopSelfFactory.createTopSelf(this, true) : getTopSelf();
IRubyObject self = wrap ? getTopSelf().rbClone() : getTopSelf();
ThreadContext context = getCurrentContext();
String file = context.getFile();

@@ -2898,7 +2897,9 @@ public void loadFile(String scriptName, InputStream in, boolean wrap) {

if (wrap) {
// toss an anonymous module into the search path
((RootNode) parseResult).getStaticScope().setModule(RubyModule.newModule(this));
RubyModule wrapper = RubyModule.newModule(this);
((RubyBasicObject)self).extend(new IRubyObject[] {wrapper});
((RootNode) parseResult).getStaticScope().setModule(wrapper);
}

runInterpreter(context, parseResult, self);
@@ -4806,6 +4807,24 @@ public Object constant() {
return constant;
}

/**
* Set the base Class#new method.
*
* @param baseNewMethod
*/
public void setBaseNewMethod(DynamicMethod baseNewMethod) {
this.baseNewMethod = baseNewMethod;
}

/**
* Get the base Class#new method.
*
* @return the base Class#new method
*/
public DynamicMethod getBaseNewMethod() {
return baseNewMethod;
}

@Deprecated
public int getSafeLevel() {
return 0;
@@ -5159,4 +5178,9 @@ public void addToObjectSpace(boolean useObjectSpace, IRubyObject object) {
* accesses.
*/
private final Object constant;

/**
* The built-in Class#new method, so we can bind more directly to allocate and initialize.
*/
private DynamicMethod baseNewMethod;
}
2 changes: 2 additions & 0 deletions core/src/main/java/org/jruby/RubyClass.java
Original file line number Diff line number Diff line change
@@ -113,6 +113,8 @@ public static void createClassClass(Ruby runtime, RubyClass classClass) {
classClass.undefineMethod("extend_object");

classClass.defineAnnotatedMethods(RubyClass.class);

runtime.setBaseNewMethod(classClass.searchMethod("new"));
}

public static final ObjectAllocator CLASS_ALLOCATOR = new ObjectAllocator() {
6 changes: 6 additions & 0 deletions core/src/main/java/org/jruby/RubyFile.java
Original file line number Diff line number Diff line change
@@ -1703,6 +1703,12 @@ else if (protocol.find()) {
}
if (postFix.contains("..")) {
postFix = "!" + canonicalizePath(postFix.substring(1));
if (Platform.IS_WINDOWS && postFix.startsWith("!")) {
postFix = postFix.replace("\\", "/");
if (startsWithDriveLetterOnWindows(postFix.substring(1))) {
postFix = "!" + postFix.substring(3);
}
}
}
return runtime.newString(preFix + realPath + postFix);
}
Loading

0 comments on commit fe72d62

Please sign in to comment.