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

Commits on Jan 25, 2016

  1. Copy the full SHA
    8eb9751 View commit details
  2. Copy the full SHA
    ba1e729 View commit details
Showing with 62 additions and 0 deletions.
  1. +2 −0 test/truffle/integration/execjs/coffeescript.rb
  2. +60 −0 truffle/src/main/java/org/jruby/truffle/nodes/core/TruffleInteropNodes.java
2 changes: 2 additions & 0 deletions test/truffle/integration/execjs/coffeescript.rb
Original file line number Diff line number Diff line change
@@ -24,6 +24,8 @@

require "execjs"
require "truffle/execjs"

# Not using the remote file as we can't inflate the data it gives us at the moment
#require "open-uri"
source = File.read(File.join(File.dirname(__FILE__), 'coffeescript.js')) # open("http://coffeescript.org/extras/coffee-script.js").read

Original file line number Diff line number Diff line change
@@ -113,6 +113,36 @@ public IsBoxedPrimitiveNode(RubyContext context, SourceSection sourceSection) {
this.node = Message.IS_BOXED.createNode();
}

@Specialization
public boolean isBoxedPrimitive(VirtualFrame frame, boolean receiver) {
return receiver;
}

@Specialization
public boolean isBoxedPrimitive(VirtualFrame frame, byte receiver) {
return true;
}

@Specialization
public boolean isBoxedPrimitive(VirtualFrame frame, short receiver) {
return true;
}

@Specialization
public boolean isBoxedPrimitive(VirtualFrame frame, long receiver) {
return true;
}

@Specialization
public boolean isBoxedPrimitive(VirtualFrame frame, float receiver) {
return true;
}

@Specialization
public boolean isBoxedPrimitive(VirtualFrame frame, double receiver) {
return true;
}

@Specialization
public boolean isBoxedPrimitive(VirtualFrame frame, CharSequence receiver) {
return true;
@@ -277,6 +307,36 @@ public UnboxValueNode(RubyContext context, SourceSection sourceSection) {
this.node = Message.UNBOX.createNode();
}

@Specialization
public boolean unbox(VirtualFrame frame, boolean receiver) {
return receiver;
}

@Specialization
public byte unbox(VirtualFrame frame, byte receiver) {
return receiver;
}

@Specialization
public short unbox(VirtualFrame frame, short receiver) {
return receiver;
}

@Specialization
public long unbox(VirtualFrame frame, long receiver) {
return receiver;
}

@Specialization
public float unbox(VirtualFrame frame, float receiver) {
return receiver;
}

@Specialization
public double unbox(VirtualFrame frame, double receiver) {
return receiver;
}

@Specialization
public DynamicObject executeForeign(VirtualFrame frame, CharSequence receiver) {
// TODO CS-21-Dec-15 this shouldn't be needed - we need to convert j.l.String to Ruby's String automatically