Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
1,587 additions
and 174 deletions.
- +69 −0 core/src/main/java/org/jruby/truffle/nodes/cast/ToSNode.java
- +4 −14 core/src/main/java/org/jruby/truffle/nodes/core/InterpolatedStringNode.java
- +2 −0 core/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
- +3 −3 core/src/main/java/org/jruby/truffle/translator/BodyTranslator.java
- +1 −1 default.build.properties
- +9 −1 lib/ruby/stdlib/csv.rb
- +21 −3 lib/ruby/stdlib/digest.rb
- +104 −11 lib/ruby/stdlib/matrix.rb
- +4 −1 lib/ruby/stdlib/net/http.rb
- +52 −14 lib/ruby/stdlib/net/imap.rb
- +9 −9 lib/ruby/stdlib/open3.rb
- +4 −2 lib/ruby/stdlib/pp.rb
- +1 −1 lib/ruby/stdlib/psych.rb
- +15 −0 lib/ruby/stdlib/psych/visitors/to_ruby.rb
- +14 −0 lib/ruby/stdlib/psych/visitors/yaml_tree.rb
- +4 −0 lib/ruby/stdlib/resolv.rb
- +1 −1 lib/ruby/stdlib/rexml/document.rb
- +2 −2 lib/ruby/stdlib/rexml/dtd/elementdecl.rb
- +1 −0 lib/ruby/stdlib/rexml/entity.rb
- +0 −12 lib/ruby/stdlib/rexml/rexml.rb
- +8 −6 lib/ruby/stdlib/tsort.rb
- +14 −26 lib/ruby/stdlib/unicode_normalize/normalize.rb
- +1,163 −0 lib/ruby/stdlib/unicode_normalize/tables.rb
- +1 −1 lib/ruby/stdlib/uri.rb
- +2 −2 lib/ruby/stdlib/uri/generic.rb
- +1 −1 lib/ruby/stdlib/uri/mailto.rb
- +2 −2 lib/ruby/stdlib/uri/rfc2396_parser.rb
- +2 −2 lib/ruby/stdlib/uri/rfc3986_parser.rb
- +2 −0 lib/ruby/stdlib/webrick/httpstatus.rb
- +56 −41 lib/ruby/stdlib/webrick/server.rb
- +1 −0 lib/ruby/stdlib/webrick/ssl.rb
- +2 −8 lib/ruby/stdlib/win32/importer.rb
- +7 −4 lib/ruby/stdlib/win32/registry.rb
- +6 −6 spec/ffi/function_spec.rb
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved. This | ||
* code is released under a tri EPL/GPL/LGPL license. You can use it, | ||
* redistribute it and/or modify it under the terms of the: | ||
* | ||
* Eclipse Public License version 1.0 | ||
* GNU General Public License version 2 | ||
* GNU Lesser General Public License version 2.1 | ||
*/ | ||
package org.jruby.truffle.nodes.cast; | ||
|
||
import com.oracle.truffle.api.dsl.NodeChild; | ||
import com.oracle.truffle.api.dsl.Specialization; | ||
import com.oracle.truffle.api.frame.VirtualFrame; | ||
import com.oracle.truffle.api.nodes.UnexpectedResultException; | ||
import com.oracle.truffle.api.source.SourceSection; | ||
import org.jruby.truffle.nodes.RubyNode; | ||
import org.jruby.truffle.nodes.RubyTypesGen; | ||
import org.jruby.truffle.nodes.core.KernelNodes; | ||
import org.jruby.truffle.nodes.core.KernelNodesFactory; | ||
import org.jruby.truffle.nodes.dispatch.DispatchHeadNode; | ||
import org.jruby.truffle.runtime.RubyContext; | ||
import org.jruby.truffle.runtime.core.RubyString; | ||
|
||
@NodeChild(type = RubyNode.class) | ||
public abstract class ToSNode extends RubyNode { | ||
|
||
@Child protected DispatchHeadNode callToSNode; | ||
@Child protected KernelNodes.ClassNode classNode; | ||
@Child protected KernelNodes.ToSNode toSNode; | ||
|
||
public ToSNode(RubyContext context, SourceSection sourceSection) { | ||
super(context, sourceSection); | ||
callToSNode = new DispatchHeadNode(context, true); | ||
classNode = KernelNodesFactory.ClassNodeFactory.create(context, sourceSection, new RubyNode[]{null}); | ||
toSNode = KernelNodesFactory.ToSNodeFactory.create(context, sourceSection, new RubyNode[]{null}); | ||
} | ||
|
||
public ToSNode(ToSNode prev) { | ||
super(prev); | ||
callToSNode = prev.callToSNode; | ||
classNode = prev.classNode; | ||
toSNode = prev.toSNode; | ||
} | ||
|
||
@Override | ||
public abstract RubyString executeString(VirtualFrame frame); | ||
|
||
@Specialization | ||
public RubyString toS(RubyString string) { | ||
return string; | ||
} | ||
|
||
@Specialization(guards = "!isRubyString", rewriteOn = UnexpectedResultException.class) | ||
public RubyString toS(VirtualFrame frame, Object object) throws UnexpectedResultException { | ||
return RubyTypesGen.RUBYTYPES.expectRubyString(callToSNode.call(frame, object, "to_s", null)); | ||
} | ||
|
||
@Specialization(guards = "!isRubyString") | ||
public RubyString toSFallback(VirtualFrame frame, Object object) { | ||
final Object value = callToSNode.call(frame, object, "to_s", null); | ||
|
||
if (value instanceof RubyString) { | ||
return (RubyString) value; | ||
} else { | ||
return toSNode.toS(classNode.executeGetClass(frame, object)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -38,7 +38,7 @@ version.ruby=2.2.0 | ||
version.ruby.major=2.2 | ||
version.ruby.minor=0 | ||
version.ruby.patchlevel=0 | ||
version.ruby.revision=48765 | ||
|
||
version.ruby1_9.major=1.9 | ||
version.ruby1_9=1.9.3 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.