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: 73285cb76611
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a0412a5968e3
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on May 26, 2015

  1. Copy the full SHA
    11d47bf View commit details
  2. Copy the full SHA
    a0412a5 View commit details
Showing with 2 additions and 17 deletions.
  1. +2 −17 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/IOPrimitiveNodes.java
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@ public abstract class IOPrimitiveNodes {
IBUFFER_PROPERTY = Property.create(IBUFFER_IDENTIFIER, allocator.locationForType(RubyBasicObject.class, EnumSet.of(LocationModifier.NonNull)), 0);
LINENO_PROPERTY = Property.create(LINENO_IDENTIFIER, allocator.locationForType(Integer.class, EnumSet.of(LocationModifier.NonNull)), 0);
DESCRIPTOR_PROPERTY = Property.create(DESCRIPTOR_IDENTIFIER, allocator.locationForType(Integer.class, EnumSet.of(LocationModifier.NonNull)), 0);
MODE_PROPERTY = Property.create(MODE_IDENTIFIER, allocator.locationForType(RubyBasicObject.class, EnumSet.of(LocationModifier.NonNull)), 0);
MODE_PROPERTY = Property.create(MODE_IDENTIFIER, allocator.locationForType(Integer.class, EnumSet.of(LocationModifier.NonNull)), 0);

IO_FACTORY = RubyBasicObject.EMPTY_SHAPE
.addProperty(IBUFFER_PROPERTY)
@@ -112,26 +112,11 @@ public RubyBasicObject allocate(RubyContext context, RubyClass rubyClass, Node c
}
}

private static Object getIBuffer(RubyBasicObject io) {
assert io.getDynamicObject().getShape().hasProperty(IBUFFER_IDENTIFIER);
return IBUFFER_PROPERTY.get(io.getDynamicObject(), true);
}

private static Object getLineNo(RubyBasicObject io) {
assert io.getDynamicObject().getShape().hasProperty(LINENO_IDENTIFIER);
return IBUFFER_PROPERTY.get(io.getDynamicObject(), true);
}

private static int getDescriptor(RubyBasicObject io) {
assert io.getDynamicObject().getShape().hasProperty(DESCRIPTOR_IDENTIFIER);
return (int) DESCRIPTOR_PROPERTY.get(io.getDynamicObject(), true);
}

private static Object getMode(RubyBasicObject io) {
assert io.getDynamicObject().getShape().hasProperty(MODE_IDENTIFIER);
return MODE_PROPERTY.get(io.getDynamicObject(), true);
}

public static void setDescriptor(RubyBasicObject io, int newDescriptor) {
assert io.getDynamicObject().getShape().hasProperty(DESCRIPTOR_IDENTIFIER);

@@ -142,7 +127,7 @@ public static void setDescriptor(RubyBasicObject io, int newDescriptor) {
}
}

public static void setMode(RubyBasicObject io, Object newMode) {
public static void setMode(RubyBasicObject io, int newMode) {
assert io.getDynamicObject().getShape().hasProperty(MODE_IDENTIFIER);

try {