Skip to content

Commit

Permalink
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -103,7 +103,6 @@ public EachObjectNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@TruffleBoundary
@Specialization(guards = "isRubyProc(block)")
public int eachObject(VirtualFrame frame, NotProvided ofClass, DynamicObject block) {
CompilerDirectives.transferToInterpreter();
Original file line number Diff line number Diff line change
@@ -9,10 +9,11 @@
*/
package org.jruby.truffle.nodes.globals;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.source.SourceSection;

import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.layouts.Layouts;
@@ -33,9 +34,13 @@ public ReadMatchReferenceNode(RubyContext context, SourceSection sourceSection,
this.index = index;
}

@CompilerDirectives.TruffleBoundary
@Override
public Object execute(VirtualFrame frame) {
return readMatchReference();
}

@TruffleBoundary
private Object readMatchReference() {
DynamicObject receiver = Layouts.THREAD.getThreadLocals(getContext().getThreadManager().getCurrentThread());
final Object match = receiver.get("$~", Layouts.MODULE.getFields(Layouts.BASIC_OBJECT.getLogicalClass(receiver)).getContext().getCoreLibrary().getNilObject());

0 comments on commit bf77585

Please sign in to comment.