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: 5e5168ff1bd3
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 79fb61c36698
Choose a head ref

Commits on Apr 18, 2015

  1. Copy the full SHA
    1248492 View commit details
  2. Make setIRScope and setScopeType simpler. This change makes me wonder…

    … how safe we are since not all
    
    constructed IRScope paths setIRScope.  In the case of evals it appears we only set IRScopeType.
    enebo committed Apr 18, 2015
    Copy the full SHA
    905afa0 View commit details
  3. IRPersistence via AOT was not properly recording nested scopes. To dr…

    …ive Ruby code to generate AOT
    
    code we need to create a separate IRManager and put it in dry run mode so it sets up lexical
    containment info.
    enebo committed Apr 18, 2015
    Copy the full SHA
    79ed302 View commit details
  4. 9
    Copy the full SHA
    06c5d29 View commit details
  5. 2
    Copy the full SHA
    709766f View commit details
  6. Copy the full SHA
    a8be7b9 View commit details
  7. Copy the full SHA
    d23f319 View commit details
  8. Copy the full SHA
    df92a84 View commit details
  9. Copy the full SHA
    329a0dd View commit details
  10. Copy the full SHA
    9a46f35 View commit details
  11. Copy the full SHA
    1fdc0cc View commit details

Commits on Apr 19, 2015

  1. Copy the full SHA
    5d65a34 View commit details
  2. Copy the full SHA
    0902cd3 View commit details
  3. Copy the full SHA
    787bdf0 View commit details
  4. Copy the full SHA
    87861f4 View commit details
  5. Copy the full SHA
    794fa12 View commit details
  6. Copy the full SHA
    bd31401 View commit details
  7. Copy the full SHA
    c31f20b View commit details
  8. 5
    Copy the full SHA
    77a5ca9 View commit details
  9. Copy the full SHA
    09d9a6d View commit details
  10. Copy the full SHA
    ecc6b13 View commit details
  11. Copy the full SHA
    a60feff View commit details
  12. Copy the full SHA
    5a97a52 View commit details
  13. Copy the full SHA
    79fb61c View commit details
Showing with 4,629 additions and 1,416 deletions.
  1. +8 −11 core/src/main/java/org/jruby/RubyString.java
  2. +0 −12 core/src/main/java/org/jruby/internal/runtime/methods/MethodNodes.java
  3. +0 −1 core/src/main/java/org/jruby/ir/IRMethod.java
  4. +1 −4 core/src/main/java/org/jruby/ir/IRModuleBody.java
  5. +0 −1 core/src/main/java/org/jruby/ir/IRScriptBody.java
  6. +3 −39 core/src/main/java/org/jruby/parser/StaticScope.java
  7. +1 −11 core/src/main/java/org/jruby/runtime/Helpers.java
  8. +3 −1 core/src/main/ruby/jruby/jruby.rb
  9. +0 −2 maven/jruby-complete/src/it/bouncycastle-with-bc-gem/invoker.properties
  10. +0 −65 maven/jruby-complete/src/it/bouncycastle-with-bc-gem/pom.xml
  11. +0 −34 ...by-complete/src/it/bouncycastle-with-bc-gem/src/test/java/org/jruby/its/BouncyCastleTestCase.java
  12. +0 −2 maven/jruby-complete/src/it/bouncycastle/invoker.properties
  13. +0 −43 maven/jruby-complete/src/it/bouncycastle/pom.xml
  14. +0 −27 maven/jruby-complete/src/it/bouncycastle/src/test/java/org/jruby/its/BouncyCastleTestCase.java
  15. +1 −1 maven/jruby/src/it/bouncycastle-with-bc-gem/pom.xml
  16. +1 −1 maven/jruby/src/it/bouncycastle-with-bc-gem/src/test/java/org/jruby/its/BouncyCastleTestCase.java
  17. +1 −1 maven/jruby/src/it/bouncycastle/src/test/java/org/jruby/its/BouncyCastleTestCase.java
  18. +1 −2 spec/truffle/tags/core/method/to_proc_tags.txt
  19. +1 −0 spec/truffle/tags/library/time/httpdate_tags.txt
  20. +1 −0 spec/truffle/tags/library/time/iso8601_tags.txt
  21. +2 −0 spec/truffle/tags/library/time/rfc2822_tags.txt
  22. +2 −0 spec/truffle/tags/library/time/rfc822_tags.txt
  23. +1 −0 spec/truffle/tags/library/time/xmlschema_tags.txt
  24. +1 −0 spec/truffle/truffle.mspec
  25. +0 −2 truffle/src/main/java/org/jruby/truffle/TruffleBridgeImpl.java
  26. +5 −10 truffle/src/main/java/org/jruby/truffle/nodes/RubyNode.java
  27. +0 −1 truffle/src/main/java/org/jruby/truffle/nodes/RubyTypes.java
  28. +5 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/ArrayNodes.java
  29. +6 −6 truffle/src/main/java/org/jruby/truffle/nodes/core/ClassNodes.java
  30. +0 −265 truffle/src/main/java/org/jruby/truffle/nodes/core/FileNodes.java
  31. +22 −0 truffle/src/main/java/org/jruby/truffle/nodes/core/FixnumNodes.java
  32. +0 −259 truffle/src/main/java/org/jruby/truffle/nodes/core/IONodes.java
  33. +28 −0 truffle/src/main/java/org/jruby/truffle/nodes/core/MethodNodes.java
  34. +8 −2 truffle/src/main/java/org/jruby/truffle/nodes/core/TimeNodes.java
  35. +20 −0 truffle/src/main/java/org/jruby/truffle/nodes/core/TrufflePrimitiveNodes.java
  36. +1 −6 truffle/src/main/java/org/jruby/truffle/nodes/dispatch/DispatchHeadNodeFactory.java
  37. +18 −0 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/DirPrimitiveNodes.java
  38. +3 −10 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/EncodingConverterPrimitiveNodes.java
  39. +115 −0 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/IOBufferPrimitiveNodes.java
  40. +83 −0 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/IOPrimitiveNodes.java
  41. +25 −0 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/PosixNodes.java
  42. +1 −0 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/RubiniusPrimitiveManager.java
  43. +20 −1 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/StringPrimitiveNodes.java
  44. +11 −6 truffle/src/main/java/org/jruby/truffle/nodes/yield/YieldDispatchHeadNode.java
  45. +7 −1 truffle/src/main/java/org/jruby/truffle/runtime/RubyContext.java
  46. +35 −115 truffle/src/main/java/org/jruby/truffle/runtime/core/CoreLibrary.java
  47. +0 −128 truffle/src/main/java/org/jruby/truffle/runtime/core/RubyFile.java
  48. +33 −4 truffle/src/main/java/org/jruby/truffle/runtime/subsystems/FeatureManager.java
  49. +44 −2 truffle/src/main/java/org/jruby/truffle/runtime/subsystems/RubiniusConfiguration.java
  50. +6 −6 truffle/src/main/java/org/jruby/truffle/runtime/subsystems/TrufflePOSIXHandler.java
  51. +2 −15 truffle/src/main/java/org/jruby/truffle/translator/TranslatorDriver.java
  52. +16 −16 truffle/src/main/ruby/core.rb
  53. +0 −25 truffle/src/main/ruby/core/kernel.rb
  54. +0 −2 truffle/src/main/ruby/core/rubinius/api/shims/lookuptable.rb
  55. +159 −2 truffle/src/main/ruby/core/rubinius/bootstrap/io.rb
  56. +923 −223 truffle/src/main/ruby/core/rubinius/common/file.rb
  57. +2,560 −0 truffle/src/main/ruby/core/rubinius/common/io.rb
  58. +15 −0 truffle/src/main/ruby/core/rubinius/common/kernel.rb
  59. +45 −0 truffle/src/main/ruby/core/rubinius/delta/file.rb
  60. +36 −0 truffle/src/main/ruby/core/rubinius/platform/file.rb
  61. +338 −0 truffle/src/main/ruby/core/rubinius/platform/struct.rb
  62. +11 −50 truffle/src/main/ruby/core/shims.rb
19 changes: 8 additions & 11 deletions core/src/main/java/org/jruby/RubyString.java
Original file line number Diff line number Diff line change
@@ -240,18 +240,15 @@ public final boolean isBrokenString() {
}

private void copyCodeRangeForSubstr(RubyString from, Encoding enc) {
int fromCr = from.getCodeRange();
if (fromCr == CR_7BIT) {
setCodeRange(fromCr);
} else if (fromCr == CR_VALID) {
if (!enc.isAsciiCompatible() || searchNonAscii(value) != -1) {
setCodeRange(CR_VALID);

if (value.getRealSize() == 0) {
setCodeRange(!enc.isAsciiCompatible() ? CR_VALID : CR_7BIT);
} else {
int fromCr = from.getCodeRange();
if (fromCr == CR_7BIT) {
setCodeRange(fromCr);
} else {
setCodeRange(CR_7BIT);
}
} else{
if (value.getRealSize() == 0) {
setCodeRange(!enc.isAsciiCompatible() ? CR_VALID : CR_7BIT);
setCodeRange(CR_UNKNOWN);
}
}
}
Original file line number Diff line number Diff line change
@@ -17,9 +17,6 @@

public class MethodNodes {

// TODO(CS): MethodNodes will never leave this cache
private final static Map<String, MethodNodes> cache = new ConcurrentHashMap<>();

private final ArgsNode argsNode;
private final Node bodyNode;

@@ -39,13 +36,4 @@ public Node getBodyNode() {
return bodyNode;
}

public static void cache(String methodJavaName, MethodNodes nodes) {
cache.put(methodJavaName, nodes);
}

public static MethodNodes lookup(String methodJavaName) {
return cache.get(methodJavaName);
}


}
1 change: 0 additions & 1 deletion core/src/main/java/org/jruby/ir/IRMethod.java
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@ public IRMethod(IRManager manager, IRScope lexicalParent, MethodDefNode defn, St

if (!getManager().isDryRun() && staticScope != null) {
staticScope.setIRScope(this);
staticScope.setScopeType(this.getScopeType());
}
}

5 changes: 1 addition & 4 deletions core/src/main/java/org/jruby/ir/IRModuleBody.java
Original file line number Diff line number Diff line change
@@ -15,10 +15,7 @@ public IRModuleBody(IRManager manager, IRScope lexicalParent, String name,

if (!getManager().isDryRun()) {
updateVersion();
if (staticScope != null) {
staticScope.setIRScope(this);
staticScope.setScopeType(this.getScopeType());
}
if (staticScope != null) staticScope.setIRScope(this);
}
}

1 change: 0 additions & 1 deletion core/src/main/java/org/jruby/ir/IRScriptBody.java
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@ public IRScriptBody(IRManager manager, String sourceName, StaticScope staticScop
this.toplevelScope = null;
if (!getManager().isDryRun() && staticScope != null) {
staticScope.setIRScope(this);
staticScope.setScopeType(this.getScopeType());
}
}

42 changes: 3 additions & 39 deletions core/src/main/java/org/jruby/parser/StaticScope.java
Original file line number Diff line number Diff line change
@@ -86,9 +86,8 @@ public class StaticScope implements Serializable {

private Type type;
private boolean isBlockOrEval;
private boolean isArgumentScope; // Is this block and argument scope of a define_method (for the purposes of zsuper).
private boolean isArgumentScope; // Is this block and argument scope of a define_method.

private int scopeId;
private IRScope irScope; // Method/Closure that this static scope corresponds to

public enum Type {
@@ -134,10 +133,6 @@ public IRScope getIRScope() {
return irScope;
}

public int getScopeId() {
return scopeId;
}

public IRScopeType getScopeType() {
return scopeType;
}
@@ -146,16 +141,9 @@ public void setScopeType(IRScopeType scopeType) {
this.scopeType = scopeType;
}

public void setIRScope(IRScope irScope, boolean isForLoopBody) {
if (!isForLoopBody) {
this.irScope = irScope;
}
this.scopeId = irScope.getScopeId();
this.scopeType = irScope.getScopeType();
}

public void setIRScope(IRScope irScope) {
setIRScope(irScope, false);
this.irScope = irScope;
this.scopeType = irScope.getScopeType();
}

/**
@@ -233,18 +221,6 @@ public void setVariables(String[] names) {
System.arraycopy(names, 0, variableNames, 0, names.length);
}

/* Note: Only used by compiler until it can use getConstant again or use some other refactoring */
public IRubyObject getConstantWithConstMissing(String internedName) {
IRubyObject result = getConstantInner(internedName);

// If we could not find the constant from cref..then try getting from inheritence hierarchy
return result == null ? cref.getConstant(internedName) : result;
}

public boolean isConstantDefined(String internedName) {
return getConstant(internedName) != null;
}

public IRubyObject getConstant(String internedName) {
IRubyObject result = getConstantInner(internedName);

@@ -268,18 +244,6 @@ private IRubyObject getConstantInnerNoObject(String internedName) {
return getConstantInner(internedName);
}

public IRubyObject setConstant(String internedName, IRubyObject result) {
RubyModule module;

if ((module = getModule()) != null) {
module.setConstant(internedName, result);
return result;
}

// TODO: wire into new exception handling mechanism
throw result.getRuntime().newTypeError("no class/module to define constant");
}

/**
* Next outer most scope in list of scopes. An enclosing scope may have no direct scoping
* relationship to its child. If I am in a localScope and then I enter something which
12 changes: 1 addition & 11 deletions core/src/main/java/org/jruby/runtime/Helpers.java
Original file line number Diff line number Diff line change
@@ -656,12 +656,6 @@ public static IRubyObject fetchClassVariable(Ruby runtime, StaticScope scope,
return rubyClass.getClassVar(name);
}

public static IRubyObject getConstant(ThreadContext context, String internedName) {
Ruby runtime = context.runtime;

return context.getCurrentScope().getStaticScope().getConstantWithConstMissing(internedName);
}

public static IRubyObject nullToNil(IRubyObject value, ThreadContext context) {
return value != null ? value : context.nil;
}
@@ -1195,15 +1189,11 @@ public static IRubyObject setConstantInModule(ThreadContext context, String name
if (!(module instanceof RubyModule)) {
throw context.runtime.newTypeError(module.toString() + " is not a class/module");
}
((RubyModule)module).setConstant(name, value);
((RubyModule) module).setConstant(name, value);

return value;
}

public static IRubyObject setConstantInCurrent(IRubyObject value, ThreadContext context, String name) {
return context.getCurrentStaticScope().setConstant(name, value);
}

public static final int MAX_SPECIFIC_ARITY_OBJECT_ARRAY = 10;

public static IRubyObject[] anewarrayIRubyObjects(int size) {
4 changes: 3 additions & 1 deletion core/src/main/ruby/jruby/jruby.rb
Original file line number Diff line number Diff line change
@@ -64,13 +64,15 @@ def parse(content = nil, filename = (default_filename = true; '-'), extra_positi

def compile_ir(content = nil, filename = (default_filename = true; '-'), extra_position_info = false, &block)
runtime = JRuby.runtime
manager = org.jruby.ir.IRManager.new(runtime.instance_config)
manager.dry_run = true
node = if default_filename
parse(content, &block)
else
parse(content, filename, extra_position_info, &block)
end

scope = org.jruby.ir.IRBuilder.build_root(runtime.getIRManager(), node).scope
scope = org.jruby.ir.IRBuilder.build_root(manager, node).scope
scope.top_level_binding_scope = node.scope

scope

This file was deleted.

65 changes: 0 additions & 65 deletions maven/jruby-complete/src/it/bouncycastle-with-bc-gem/pom.xml

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions maven/jruby-complete/src/it/bouncycastle/invoker.properties

This file was deleted.

43 changes: 0 additions & 43 deletions maven/jruby-complete/src/it/bouncycastle/pom.xml

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion maven/jruby/src/it/bouncycastle-with-bc-gem/pom.xml
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<bc.version>1.49</bc.version>
<bc.version>1.50</bc.version>
</properties>

<build>
Loading