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

Commits on Jun 26, 2015

  1. [Truffle] Prevent NotProvided values from being written to frame slots.

    NotProvided is an internal sentinel value and should never leak into Ruby code.
    nirvdrum committed Jun 26, 2015
    3
    Copy the full SHA
    ecedf14 View commit details
  2. 2
    Copy the full SHA
    48fc86c View commit details
Original file line number Diff line number Diff line change
@@ -162,7 +162,7 @@ public static boolean wasProvided(Object value) {
}

public static boolean wasNotProvided(Object value) {
return value instanceof NotProvided;
return value == NotProvided.INSTANCE;
}

// Values
Original file line number Diff line number Diff line change
@@ -10,12 +10,15 @@
package org.jruby.truffle.nodes.locals;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.dsl.ImportStatic;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.Frame;
import com.oracle.truffle.api.frame.FrameSlot;
import com.oracle.truffle.api.frame.FrameSlotKind;
import com.oracle.truffle.api.nodes.Node;
import org.jruby.truffle.nodes.RubyGuards;

@ImportStatic(RubyGuards.class)
public abstract class WriteFrameSlotNode extends Node {

protected final FrameSlot frameSlot;
@@ -51,7 +54,7 @@ public double writeDouble(Frame frame, double value) {
return value;
}

@Specialization(guards = "isObjectKind(frame)")
@Specialization(guards = { "isObjectKind(frame)", "wasProvided(value)" })
public Object writeObject(Frame frame, Object value) {
frame.setObject(frameSlot, value);
return value;