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: 5a4b3f9bd97f
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8d2c1384d29e
Choose a head ref
  • 3 commits
  • 22 files changed
  • 1 contributor

Commits on Sep 2, 2015

  1. Copy the full SHA
    7e50101 View commit details
  2. Copy the full SHA
    29318b9 View commit details
  3. Copy the full SHA
    8d2c138 View commit details
Showing with 198 additions and 638 deletions.
  1. +2 −1 core/src/main/java/org/jruby/util/cli/Options.java
  2. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/cast/TaintResultNode.java
  3. +5 −3 truffle/src/main/java/org/jruby/truffle/nodes/core/ExceptionNodes.java
  4. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
  5. +11 −3 truffle/src/main/java/org/jruby/truffle/nodes/core/ObjectSpaceNodes.java
  6. +15 −15 truffle/src/main/java/org/jruby/truffle/nodes/objects/IsFrozenNode.java
  7. +15 −13 truffle/src/main/java/org/jruby/truffle/nodes/objects/IsTaintedNode.java
  8. +4 −8 truffle/src/main/java/org/jruby/truffle/nodes/objects/ReadInstanceVariableNode.java
  9. +0 −66 truffle/src/main/java/org/jruby/truffle/nodes/objectstorage/ReadBooleanObjectFieldNode.java
  10. +0 −66 truffle/src/main/java/org/jruby/truffle/nodes/objectstorage/ReadDoubleObjectFieldNode.java
  11. +121 −21 truffle/src/main/java/org/jruby/truffle/nodes/objectstorage/ReadHeadObjectFieldNode.java
  12. +0 −66 truffle/src/main/java/org/jruby/truffle/nodes/objectstorage/ReadIntegerObjectFieldNode.java
  13. +0 −66 truffle/src/main/java/org/jruby/truffle/nodes/objectstorage/ReadLongObjectFieldNode.java
  14. +0 −60 truffle/src/main/java/org/jruby/truffle/nodes/objectstorage/ReadMissingObjectFieldNode.java
  15. +0 −45 truffle/src/main/java/org/jruby/truffle/nodes/objectstorage/ReadObjectFieldChainNode.java
  16. +0 −62 truffle/src/main/java/org/jruby/truffle/nodes/objectstorage/ReadObjectFieldNode.java
  17. +0 −47 truffle/src/main/java/org/jruby/truffle/nodes/objectstorage/ReadObjectObjectFieldNode.java
  18. +0 −83 truffle/src/main/java/org/jruby/truffle/nodes/objectstorage/UninitializedReadObjectFieldNode.java
  19. +14 −6 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/ObjectPrimitiveNodes.java
  20. +4 −1 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/StatPrimitiveNodes.java
  21. +1 −0 truffle/src/main/java/org/jruby/truffle/runtime/Options.java
  22. +4 −4 truffle/src/main/java/org/jruby/truffle/runtime/object/ObjectIDOperations.java
3 changes: 2 additions & 1 deletion core/src/main/java/org/jruby/util/cli/Options.java
Original file line number Diff line number Diff line change
@@ -228,13 +228,14 @@ public class Options {

public static final Option<Integer> TRUFFLE_DEFAULT_CACHE = integer(TRUFFLE, "truffle.default_cache", 8, "Default size for caches.");

public static final Option<Integer> TRUFFLE_METHOD_LOOKUP_CACHE = integer(TRUFFLE, "truffle.method_lookup.cache", TRUFFLE_DEFAULT_CACHE.load(), "Constant lookup cache size");
public static final Option<Integer> TRUFFLE_METHOD_LOOKUP_CACHE = integer(TRUFFLE, "truffle.method_lookup.cache", TRUFFLE_DEFAULT_CACHE.load(), "Method lookup cache size");
public static final Option<Integer> TRUFFLE_DISPATCH_CACHE = integer(TRUFFLE, "truffle.dispatch.cache", TRUFFLE_DEFAULT_CACHE.load(), "Dispatch (various forms of method call) cache size.");
public static final Option<Integer> TRUFFLE_YIELD_CACHE = integer(TRUFFLE, "truffle.yield.cache", TRUFFLE_DEFAULT_CACHE.load(), "Yield cache size.");
public static final Option<Integer> TRUFFLE_METHOD_TO_PROC_CACHE = integer(TRUFFLE, "truffle.to_proc.cache", TRUFFLE_DEFAULT_CACHE.load(), "Method#to_proc cache size");
public static final Option<Integer> TRUFFLE_IS_A_CACHE = integer(TRUFFLE, "truffle.is_a.cache", TRUFFLE_DEFAULT_CACHE.load(), "Kernel#is_a? and #kind_of? cache size");
public static final Option<Integer> TRUFFLE_BIND_CACHE = integer(TRUFFLE, "truffle.bind.cache", TRUFFLE_DEFAULT_CACHE.load(), "Test for being able to bind a method to a module cache size");
public static final Option<Integer> TRUFFLE_CONSTANT_LOOKUP_CACHE = integer(TRUFFLE, "truffle.constant_lookup.cache", TRUFFLE_DEFAULT_CACHE.load(), "Constant lookup cache size");
public static final Option<Integer> TRUFFLE_FIELD_LOOKUP_CACHE = integer(TRUFFLE, "truffle.field_lookup.cache", TRUFFLE_DEFAULT_CACHE.load(), "Object field lookup cache size");
public static final Option<Integer> TRUFFLE_BINDING_LOCAL_VARIABLE_CACHE = integer(TRUFFLE, "truffle.binding_local_variable.cache", TRUFFLE_DEFAULT_CACHE.load(), "Binding#local_variable_get/set cache size");
public static final Option<Integer> TRUFFLE_SYMBOL_TO_PROC_CACHE = integer(TRUFFLE, "truffle.symbol_to_proc.cache", TRUFFLE_DEFAULT_CACHE.load(), "Symbol#to_proc cache size");
public static final Option<Integer> TRUFFLE_ALLOCATE_CLASS_CACHE = integer(TRUFFLE, "truffle.allocate_class.cache", TRUFFLE_DEFAULT_CACHE.load(), "Allocation size class cache size");
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ public TaintResultNode(RubyContext context, SourceSection sourceSection) {
}

public Object maybeTaint(DynamicObject source, DynamicObject result) {
if (taintProfile.profile(isTaintedNode.isTainted(source))) {
if (taintProfile.profile(isTaintedNode.executeIsTainted(source))) {
if (taintNode == null) {
CompilerDirectives.transferToInterpreter();
taintNode = insert(TaintNodeGen.create(getContext(), getSourceSection(), null));
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@
import org.jruby.RubyString;
import org.jruby.truffle.nodes.RubyGuards;
import org.jruby.truffle.nodes.objectstorage.ReadHeadObjectFieldNode;
import org.jruby.truffle.nodes.objectstorage.ReadHeadObjectFieldNodeGen;
import org.jruby.truffle.runtime.NotProvided;
import org.jruby.truffle.runtime.RubyCallStack;
import org.jruby.truffle.runtime.RubyContext;
@@ -91,13 +92,14 @@ public abstract static class BacktraceNode extends CoreMethodArrayArgumentsNode

public BacktraceNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
readCustomBacktrace = new ReadHeadObjectFieldNode("@custom_backtrace");
readCustomBacktrace = ReadHeadObjectFieldNodeGen.create(context, sourceSection, "@custom_backtrace", null, null);
}

@Specialization
public Object backtrace(DynamicObject exception) {
if (readCustomBacktrace.isSet(exception)) {
return readCustomBacktrace.execute(exception);
final Object customBacktrace = readCustomBacktrace.execute(exception);
if (customBacktrace != null) {
return customBacktrace;
} else if (Layouts.EXCEPTION.getBacktrace(exception) != null) {
return asRubyStringArray(exception);
} else {
Original file line number Diff line number Diff line change
@@ -1013,7 +1013,7 @@ public Object instanceVariableGetSymbol(DynamicObject object, DynamicObject name
}

private Object instanceVariableGet(DynamicObject object, String name) {
return object.get(RubyContext.checkInstanceVariableName(getContext(), name, this), Layouts.MODULE.getFields(Layouts.BASIC_OBJECT.getLogicalClass(object)).getContext().getCoreLibrary().getNilObject());
return object.get(RubyContext.checkInstanceVariableName(getContext(), name, this), nil());
}

}
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
import org.jruby.truffle.nodes.RubyGuards;
import org.jruby.truffle.nodes.dispatch.RespondToNode;
import org.jruby.truffle.nodes.objectstorage.ReadHeadObjectFieldNode;
import org.jruby.truffle.nodes.objectstorage.ReadHeadObjectFieldNodeGen;
import org.jruby.truffle.runtime.ModuleOperations;
import org.jruby.truffle.runtime.NotProvided;
import org.jruby.truffle.runtime.RubyContext;
@@ -29,6 +30,7 @@
import com.oracle.truffle.api.dsl.ImportStatic;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.UnexpectedResultException;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.source.SourceSection;

@@ -73,8 +75,14 @@ public Object id2Ref(final VirtualFrame frame, final long id,
new ObjectGraph(getContext()).visitObjects(new ObjectGraphVisitor() {
@Override
public boolean visit(DynamicObject object) throws StopVisitingObjectsException {
final Object objectID = readObjectIdNode.execute(object);
if (objectID != nil() && (long) objectID == id) {
final long objectID;
try {
objectID = readObjectIdNode.executeLong(object);
} catch (UnexpectedResultException e) {
throw new UnsupportedOperationException(e);
}

if (objectID == id) {
result.set(object);
throw new StopVisitingObjectsException();
}
@@ -96,7 +104,7 @@ public double id2RefFloat(DynamicObject id) {
}

protected ReadHeadObjectFieldNode createReadObjectIDNode() {
return new ReadHeadObjectFieldNode(Layouts.OBJECT_ID_IDENTIFIER);
return ReadHeadObjectFieldNodeGen.create(getContext(), getSourceSection(), Layouts.OBJECT_ID_IDENTIFIER, 0L, null);
}

protected boolean isLargeFixnumID(DynamicObject id) {
Original file line number Diff line number Diff line change
@@ -10,22 +10,22 @@

package org.jruby.truffle.nodes.objects;

import com.oracle.truffle.api.CompilerDirectives;
import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.nodes.objectstorage.ReadHeadObjectFieldNode;
import org.jruby.truffle.nodes.objectstorage.ReadHeadObjectFieldNodeGen;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.layouts.Layouts;

import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.NodeChild;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.nodes.UnexpectedResultException;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.nodes.objectstorage.ReadHeadObjectFieldNode;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.layouts.Layouts;

@NodeChild(value = "child")
public abstract class IsFrozenNode extends RubyNode {

@Child private ReadHeadObjectFieldNode readFrozenNode;

public IsFrozenNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}
@@ -68,16 +68,16 @@ public boolean isFrozenSymbol(DynamicObject symbol) {
}

@Specialization(guards = { "!isNil(object)", "!isRubyBignum(object)", "!isRubySymbol(object)" })
public boolean isFrozen(DynamicObject object) {
if (readFrozenNode == null) {
CompilerDirectives.transferToInterpreter();
readFrozenNode = insert(new ReadHeadObjectFieldNode(Layouts.FROZEN_IDENTIFIER));
}

protected boolean isFrozen(DynamicObject object,
@Cached("createReadFrozenNode()") ReadHeadObjectFieldNode readFrozenNode) {
try {
return readFrozenNode.isSet(object) && readFrozenNode.executeBoolean(object);
return readFrozenNode.executeBoolean(object);
} catch (UnexpectedResultException e) {
throw new UnsupportedOperationException(readFrozenNode.execute(object).toString());
throw new UnsupportedOperationException(e);
}
}

protected ReadHeadObjectFieldNode createReadFrozenNode() {
return ReadHeadObjectFieldNodeGen.create(getContext(), getSourceSection(), Layouts.FROZEN_IDENTIFIER, false, null);
}
}
Original file line number Diff line number Diff line change
@@ -9,16 +9,18 @@
*/
package org.jruby.truffle.nodes.objects;

import com.oracle.truffle.api.CompilerDirectives;
import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.nodes.objectstorage.ReadHeadObjectFieldNode;
import org.jruby.truffle.nodes.objectstorage.ReadHeadObjectFieldNodeGen;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.layouts.Layouts;

import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.NodeChild;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.nodes.UnexpectedResultException;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.nodes.objectstorage.ReadHeadObjectFieldNode;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.layouts.Layouts;

@NodeChild(value = "child", type = RubyNode.class)
public abstract class IsTaintedNode extends RubyNode {
@@ -52,17 +54,17 @@ public boolean isTainted(double object) {
}

@Specialization
public boolean isTainted(DynamicObject object) {
if (readTaintNode == null) {
CompilerDirectives.transferToInterpreter();
readTaintNode = insert(new ReadHeadObjectFieldNode(Layouts.TAINTED_IDENTIFIER));
}

protected boolean isTainted(DynamicObject object,
@Cached("createReadTaintedNode()") ReadHeadObjectFieldNode readTaintedNode) {
try {
return readTaintNode.isSet(object) && readTaintNode.executeBoolean(object);
return readTaintedNode.executeBoolean(object);
} catch (UnexpectedResultException e) {
throw new UnsupportedOperationException(readTaintNode.execute(object).toString());
throw new UnsupportedOperationException(e);
}
}

protected ReadHeadObjectFieldNode createReadTaintedNode() {
return ReadHeadObjectFieldNodeGen.create(getContext(), getSourceSection(), Layouts.TAINTED_IDENTIFIER, false, null);
}

}
Original file line number Diff line number Diff line change
@@ -17,10 +17,12 @@
import com.oracle.truffle.api.object.Shape;
import com.oracle.truffle.api.source.SourceSection;
import com.oracle.truffle.api.utilities.BranchProfile;

import org.jcodings.specific.UTF8Encoding;
import org.jruby.RubyString;
import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.nodes.objectstorage.ReadHeadObjectFieldNode;
import org.jruby.truffle.nodes.objectstorage.ReadHeadObjectFieldNodeGen;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.layouts.Layouts;
import org.jruby.truffle.translator.ReadNode;
@@ -37,7 +39,7 @@ public class ReadInstanceVariableNode extends RubyNode implements ReadNode {
public ReadInstanceVariableNode(RubyContext context, SourceSection sourceSection, String name, RubyNode receiver, boolean isGlobal) {
super(context, sourceSection);
this.receiver = receiver;
readNode = new ReadHeadObjectFieldNode(name);
readNode = ReadHeadObjectFieldNodeGen.create(context, sourceSection, name, nil(), null);
this.isGlobal = isGlobal;
}

@@ -102,14 +104,8 @@ public Object isDefined(VirtualFrame frame) {
if (isGlobal) {
final DynamicObject receiverValue = (DynamicObject) receiver.execute(frame);

if (readNode.getName().equals("$~") || readNode.getName().equals("$!")) {
if (readNode.getName().equals("$~") || readNode.getName().equals("$!") || readNode.execute(receiverValue) != nil()) {
return Layouts.STRING.createString(getContext().getCoreLibrary().getStringFactory(), RubyString.encodeBytelist("global-variable", UTF8Encoding.INSTANCE), StringSupport.CR_7BIT, null);
} else if (readNode.isSet(receiverValue)) {
if (readNode.execute(receiverValue) == nil()) {
return nil();
} else {
return Layouts.STRING.createString(getContext().getCoreLibrary().getStringFactory(), RubyString.encodeBytelist("global-variable", UTF8Encoding.INSTANCE), StringSupport.CR_7BIT, null);
}
} else {
return nil();
}

This file was deleted.

This file was deleted.

Loading