-
-
Notifications
You must be signed in to change notification settings - Fork 925
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into truffle-head
- 9.4.12.0
- 9.4.11.0
- 9.4.10.0
- 9.4.9.0
- 9.4.8.0
- 9.4.7.0
- 9.4.6.0
- 9.4.5.0
- 9.4.4.0
- 9.4.3.0
- 9.4.2.0
- 9.4.1.0
- 9.4.0.0
- 9.3.15.0
- 9.3.14.0
- 9.3.13.0
- 9.3.12.0
- 9.3.11.0
- 9.3.10.0
- 9.3.9.0
- 9.3.8.0
- 9.3.7.0
- 9.3.6.0
- 9.3.5.0
- 9.3.4.0
- 9.3.3.0
- 9.3.2.0
- 9.3.1.0
- 9.3.0.0
- 9.2.21.0
- 9.2.20.1
- 9.2.20.0
- 9.2.19.0
- 9.2.18.0
- 9.2.17.0
- 9.2.16.0
- 9.2.15.0
- 9.2.14.0
- 9.2.13.0
- 9.2.12.0
- 9.2.11.1
- 9.2.11.0
- 9.2.10.0
- 9.2.9.0
- 9.2.8.0
- 9.2.7.0
- 9.2.6.0
- 9.2.5.0
- 9.2.4.1
- 9.2.4.0
- 9.2.3.0
- 9.2.2.0
- 9.2.1.0
- 9.2.0.0
- 9.1.17.0
- 9.1.16.0
- 9.1.15.0
- 9.1.14.0
- 9.1.13.0
- 9.1.12.0
- 9.1.11.0
- 9.1.10.0
- 9.1.9.0
- 9.1.8.0
- 9.1.7.0
- 9.1.6.0
- 9.1.5.0
- 9.1.4.0
- 9.1.3.0
Showing
55 changed files
with
513 additions
and
213 deletions.
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,10 @@ | ||
# Custom Range classes Xs and Ys | ||
class Custom | ||
include Comparable | ||
attr :length | ||
def initialize(n) | ||
@length = n | ||
end | ||
def eql?(other) | ||
inspect.eql? other.inspect | ||
end | ||
def inspect | ||
'custom' | ||
end | ||
def <=>(other) | ||
@length <=> other.length | ||
end | ||
def to_s | ||
sprintf "%2d #{inspect}", @length | ||
end | ||
end | ||
|
||
class Xs < Custom # represent a string of 'x's | ||
def succ | ||
Xs.new(@length + 1) | ||
end | ||
def inspect | ||
'x' * @length | ||
end | ||
end | ||
|
||
class Ys < Custom # represent a string of 'y's | ||
def succ | ||
Ys.new(@length + 1) | ||
end | ||
def inspect | ||
'y' * @length | ||
end | ||
end | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
require File.expand_path('../shared/equal_value', __FILE__) | ||
|
||
describe :range_eql, shared: true do | ||
it "returns true if other has same begin, end, and exclude_end? values" do | ||
(0..2).send(@method, 0..2).should == true | ||
('G'..'M').send(@method,'G'..'M').should == true | ||
(0.5..2.4).send(@method, 0.5..2.4).should == true | ||
(5..10).send(@method, Range.new(5,10)).should == true | ||
('D'..'V').send(@method, Range.new('D','V')).should == true | ||
(0.5..2.4).send(@method, Range.new(0.5, 2.4)).should == true | ||
(0xffff..0xfffff).send(@method, 0xffff..0xfffff).should == true | ||
(0xffff..0xfffff).send(@method, Range.new(0xffff,0xfffff)).should == true | ||
(Xs.new(3)..Xs.new(5)).send(@method, Range.new(Xs.new(3), Xs.new(5))).should == true | ||
describe "Range#eql?" do | ||
it_behaves_like(:range_eql, :eql?) | ||
|
||
it "returns false if the endpoints are not eql?" do | ||
(0..1).send(@method, 0..1.0).should == false | ||
('Q'..'X').send(@method, 'A'..'C').should == false | ||
('Q'...'X').send(@method, 'Q'..'W').should == false | ||
('Q'..'X').send(@method, 'Q'...'X').should == false | ||
(0.5..2.4).send(@method, 0.5...2.4).should == false | ||
(1482..1911).send(@method, 1482...1911).should == false | ||
(0xffff..0xfffff).send(@method, 0xffff...0xfffff).should == false | ||
(Xs.new(3)..Xs.new(5)).send(@method, Range.new(Ys.new(3), Ys.new(5))).should == false | ||
end | ||
|
||
it "returns false if other is no Range" do | ||
(1..10).send(@method, 1).should == false | ||
(1..10).send(@method, 'a').should == false | ||
(1..10).send(@method, mock('x')).should == false | ||
end | ||
|
||
it "returns true for subclasses to Range" do | ||
class MyRange < Range ; end | ||
Range.new(1, 2).send(@method, MyRange.new(1, 2)).should == true | ||
Range.new(Xs.new(3), Xs.new(5)).send(@method, MyRange.new(Xs.new(3), Xs.new(5))).should == true | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
describe "Range" do | ||
it "includes Enumerable" do | ||
Range.include?(Enumerable).should == true | ||
end | ||
end | ||
end |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
|
||
describe "Thread#thread_variable_get" do | ||
before :each do | ||
@t = Thread.new { } | ||
end | ||
|
||
after :each do | ||
@t.join | ||
end | ||
|
||
it "returns nil if the variable is not set" do | ||
@t.thread_variable_get(:a).should be_nil | ||
end | ||
|
||
it "returns the value previously set by #[]=" do | ||
@t.thread_variable_set :a, 49 | ||
@t.thread_variable_get(:a).should == 49 | ||
end | ||
|
||
it "returns a value private to self" do | ||
@t.thread_variable_set :thread_variable_get_spec, 82 | ||
Thread.current.thread_variable_get(:thread_variable_get_spec).should be_nil | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
|
||
describe "Thread#thread_variable_set" do | ||
before :each do | ||
@t = Thread.new { } | ||
end | ||
|
||
after :each do | ||
@t.join | ||
end | ||
|
||
it "returns the value set" do | ||
(@t.thread_variable_set :a, 2).should == 2 | ||
end | ||
|
||
it "sets a value that will be returned by #thread_variable_get" do | ||
@t.thread_variable_set :a, 49 | ||
@t.thread_variable_get(:a).should == 49 | ||
end | ||
|
||
it "sets a value private to self" do | ||
@t.thread_variable_set :thread_variable_get_spec, 82 | ||
@t.thread_variable_get(:thread_variable_get_spec).should == 82 | ||
Thread.current.thread_variable_get(:thread_variable_get_spec).should be_nil | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
|
||
describe "Thread#thread_variable?" do | ||
before :each do | ||
@t = Thread.new { } | ||
end | ||
|
||
after :each do | ||
@t.join | ||
end | ||
|
||
it "returns false if the thread variables do not contain 'key'" do | ||
@t.thread_variable_set :a, 2 | ||
@t.thread_variable?(:b).should be_false | ||
end | ||
|
||
it "returns true if the thread variables contain 'key'" do | ||
@t.thread_variable_set :a, 2 | ||
@t.thread_variable?(:a).should be_true | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
|
||
describe "Thread#thread_variables" do | ||
before :each do | ||
@t = Thread.new { } | ||
end | ||
|
||
after :each do | ||
@t.join | ||
end | ||
|
||
it "returns the keys of all the values set" do | ||
@t.thread_variable_set :a, 2 | ||
@t.thread_variable_set :b, 4 | ||
@t.thread_variable_set :c, 6 | ||
@t.thread_variables.sort.should == [:a, :b, :c] | ||
end | ||
|
||
it "sets a value private to self" do | ||
@t.thread_variable_set :thread_variables_spec_a, 82 | ||
@t.thread_variable_set :thread_variables_spec_b, 82 | ||
Thread.current.thread_variables.should == [] | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
require File.expand_path('../../../../spec_helper', __FILE__) | ||
require File.expand_path('../shared/random_bytes.rb', __FILE__) | ||
|
||
describe "OpenSSL::Random#pseudo_bytes" do | ||
it_behaves_like :openssl_random_bytes, :pseudo_bytes | ||
if defined?(OpenSSL::Random.pseudo_bytes) | ||
describe "OpenSSL::Random.pseudo_bytes" do | ||
it_behaves_like :openssl_random_bytes, :pseudo_bytes | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
require File.expand_path('../../../../spec_helper', __FILE__) | ||
require File.expand_path('../shared/random_bytes.rb', __FILE__) | ||
|
||
describe "OpenSSL::Random#random_bytes" do | ||
describe "OpenSSL::Random.random_bytes" do | ||
it_behaves_like :openssl_random_bytes, :random_bytes | ||
end |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fails:Fiber#resume executes the ensure clause |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fails:Range#== returns true if the endpoints are == |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fails:Fiber#resume executes the ensure clause |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fails:Range#eql? returns false if the endpoints are not eql? |
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
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
34 changes: 34 additions & 0 deletions
34
truffle/src/main/java/org/jruby/truffle/language/globals/TruffleGlobalsNodes.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2013, 2016 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.language.globals; | ||
|
||
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; | ||
import com.oracle.truffle.api.dsl.Specialization; | ||
import com.oracle.truffle.api.object.DynamicObject; | ||
import org.jruby.truffle.builtins.CoreClass; | ||
import org.jruby.truffle.builtins.CoreMethod; | ||
import org.jruby.truffle.builtins.CoreMethodArrayArgumentsNode; | ||
|
||
@CoreClass("Truffle::Globals") | ||
public abstract class TruffleGlobalsNodes { | ||
|
||
@CoreMethod(names = "permanently_invalidate", onSingleton = true, required = 1) | ||
public abstract static class PermanentlyInvalidateNode extends CoreMethodArrayArgumentsNode { | ||
|
||
@TruffleBoundary | ||
@Specialization(guards = "isRubySymbol(name)") | ||
public DynamicObject permanentlyInvalidate(DynamicObject name) { | ||
getContext().getCoreLibrary().getGlobalVariables().getStorage(name.toString()).permanentlyInvalidate(); | ||
return nil(); | ||
} | ||
|
||
} | ||
|
||
} |