Skip to content

Commit

Permalink
Showing 4 changed files with 13 additions and 18 deletions.
27 changes: 13 additions & 14 deletions truffle/src/main/java/org/jruby/truffle/nodes/core/StringNodes.java
Original file line number Diff line number Diff line change
@@ -76,6 +76,19 @@
@CoreClass(name = "String")
public abstract class StringNodes {

public static class StringType extends BasicObjectType {

}

public static final StringType STRING_TYPE = new StringType();

private static final DynamicObjectFactory STRING_FACTORY;

static {
final Shape shape = RubyBasicObject.LAYOUT.createShape(STRING_TYPE);
STRING_FACTORY = shape.createFactory();
}

public static int getCodeRange(RubyString string) {
return string.codeRange;
}
@@ -158,20 +171,6 @@ public static CodeRangeableWrapper getCodeRangeable(RubyString string) {
return string.codeRangeableWrapper;
}

public static class StringType extends BasicObjectType {

}

public static final StringType STRING_TYPE = new StringType();

private static final DynamicObjectFactory STRING_FACTORY;

static {
final Shape.Allocator allocator = RubyBasicObject.LAYOUT.createAllocator();
final Shape shape = RubyBasicObject.LAYOUT.createShape(STRING_TYPE);
STRING_FACTORY = shape.createFactory();
}

public static void set(RubyString string, ByteList bytes) {
string.bytes = bytes;
}
Original file line number Diff line number Diff line change
@@ -72,7 +72,6 @@ public static class ArrayType extends BasicObjectType {
private static final DynamicObjectFactory ARRAY_FACTORY;

static {
final Shape.Allocator allocator = RubyBasicObject.LAYOUT.createAllocator();
final Shape shape = RubyBasicObject.LAYOUT.createShape(ARRAY_TYPE);
ARRAY_FACTORY = shape.createFactory();
}
Original file line number Diff line number Diff line change
@@ -51,7 +51,6 @@ public static class HashType extends BasicObjectType {
private static final DynamicObjectFactory HASH_FACTORY;

static {
final Shape.Allocator allocator = RubyBasicObject.LAYOUT.createAllocator();
final Shape shape = RubyBasicObject.LAYOUT.createShape(HASH_TYPE);
HASH_FACTORY = shape.createFactory();
}
Original file line number Diff line number Diff line change
@@ -112,8 +112,6 @@ public Object isDefined(VirtualFrame frame) {
}
}

final RubyContext context = getContext();

final Object receiverObject = receiver.execute(frame);

if (receiverObject instanceof RubyBasicObject) {

0 comments on commit b17c552

Please sign in to comment.