Skip to content

Commit

Permalink
[Truffle] Fix naming errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Feb 9, 2015
1 parent 0a36252 commit e1b597c
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -26,29 +26,29 @@
})
public abstract class ArrayWriteDenormalizedNode extends RubyNode {

@Child private ArrayWriteNormalizedNode readNode;
@Child private ArrayWriteNormalizedNode writeNode;

public ArrayWriteDenormalizedNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public ArrayWriteDenormalizedNode(ArrayWriteDenormalizedNode prev) {
super(prev);
readNode = prev.readNode;
writeNode = prev.writeNode;
}

public abstract Object executeWrite(VirtualFrame frame, RubyArray array, int index, Object value);

@Specialization
public Object read(VirtualFrame frame, RubyArray array, int index, Object value) {
if (readNode == null) {
public Object write(VirtualFrame frame, RubyArray array, int index, Object value) {
if (writeNode == null) {
CompilerDirectives.transferToInterpreter();
readNode = insert(ArrayWriteNormalizedNodeFactory.create(getContext(), getSourceSection(), null, null, null));
writeNode = insert(ArrayWriteNormalizedNodeFactory.create(getContext(), getSourceSection(), null, null, null));
}

final int normalizedIndex = array.normalizeIndex(index);

return readNode.executeWrite(frame, array, normalizedIndex, value);
return writeNode.executeWrite(frame, array, normalizedIndex, value);
}

}

0 comments on commit e1b597c

Please sign in to comment.