Skip to content

Commit

Permalink
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
package org.jruby.truffle.core.rubinius;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.frame.Frame;
import com.oracle.truffle.api.frame.FrameInstance;
import com.oracle.truffle.api.frame.FrameSlot;
import com.oracle.truffle.api.frame.FrameSlotTypeException;
@@ -33,7 +34,7 @@ public Object execute(VirtualFrame frame) {

// Rubinius expects $_ to be thread-local, rather than frame-local. If we see it in a method call, we need
// to look to the caller's frame to get the correct value, otherwise it will be nil.
final MaterializedFrame callerFrame = getContext().getCallStack().getCallerFrameIgnoringSend().getFrame(FrameInstance.FrameAccess.READ_ONLY, true).materialize();
final Frame callerFrame = getContext().getCallStack().getCallerFrameIgnoringSend().getFrame(FrameInstance.FrameAccess.READ_ONLY, true);

// TODO CS 4-Jan-16 - but it could be in higher frames!
final FrameSlot slot = callerFrame.getFrameDescriptor().findFrameSlot("$_");
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.dsl.NodeChild;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.Frame;
import com.oracle.truffle.api.frame.FrameInstance;
import com.oracle.truffle.api.frame.FrameSlot;
import com.oracle.truffle.api.frame.FrameSlotTypeException;
@@ -36,7 +37,7 @@ public Object lastStringWrite(Object value) {

// Rubinius expects $_ to be thread-local, rather than frame-local. If we see it in a method call, we need
// to look to the caller's frame to get the correct value, otherwise it will be nil.
MaterializedFrame callerFrame = getContext().getCallStack().getCallerFrameIgnoringSend().getFrame(FrameInstance.FrameAccess.READ_ONLY, true).materialize();
Frame callerFrame = getContext().getCallStack().getCallerFrameIgnoringSend().getFrame(FrameInstance.FrameAccess.READ_WRITE, true);

FrameSlot slot = callerFrame.getFrameDescriptor().findFrameSlot("$_");

0 comments on commit dc0219b

Please sign in to comment.