Skip to content

Commit 2cc143f

Browse files
committed
Remove Primitive.caller_binding
1 parent 18a93b8 commit 2cc143f

File tree

2 files changed

+0
-52
lines changed

2 files changed

+0
-52
lines changed

spec/truffle/caller_data_spec.rb

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ def self.last_match_set(match)
2020
Primitive.regexp_last_match_set(Primitive.caller_special_variables, match)
2121
match
2222
end
23-
24-
def self.caller_binding_and_variables(last_line, last_match)
25-
b = Primitive.caller_binding
26-
Primitive.io_last_line_set(Primitive.caller_special_variables, last_line)
27-
Primitive.regexp_last_match_set(Primitive.caller_special_variables, last_match)
28-
b
29-
end
3023
end
3124

3225
describe "A caller" do
@@ -48,23 +41,4 @@ def self.caller_binding_and_variables(last_line, last_match)
4841
$_.should == last_line
4942
$~.should == md
5043
end
51-
52-
it "can have its special variables and frame read by the same method" do
53-
last_line = "Hello!"
54-
md = Primitive.matchdata_create_single_group(/o/, "Hello", 4, 5)
55-
b = TruffleCallerSpecFixtures.caller_binding_and_variables(last_line, md)
56-
$_.should == last_line
57-
$~.should == md
58-
b.local_variable_get(:md).should == md
59-
end
60-
61-
it "can have its special variables and frame read by the same method through an intermediate #send" do
62-
last_line = "Hello!"
63-
md = Primitive.matchdata_create_single_group(/o/, "Hello", 4, 5)
64-
b = TruffleCallerSpecFixtures.send(:caller_binding_and_variables, last_line, md)
65-
$_.should == last_line
66-
$~.should == md
67-
b.local_variable_get(:md).should == md
68-
end
69-
7044
end

src/main/java/org/truffleruby/core/binding/BindingNodes.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
import com.oracle.truffle.api.CompilerDirectives;
1818
import com.oracle.truffle.api.dsl.GenerateNodeFactory;
1919
import com.oracle.truffle.api.dsl.GenerateUncached;
20-
import com.oracle.truffle.api.frame.FrameInstance.FrameAccess;
2120
import com.oracle.truffle.api.frame.FrameSlotKind;
22-
import com.oracle.truffle.api.profiles.ConditionProfile;
2321
import com.oracle.truffle.api.strings.TruffleString;
2422
import org.truffleruby.Layouts;
2523
import org.truffleruby.RubyContext;
@@ -35,13 +33,11 @@
3533
import org.truffleruby.core.encoding.Encodings;
3634
import org.truffleruby.core.klass.RubyClass;
3735
import org.truffleruby.core.string.RubyString;
38-
import org.truffleruby.language.CallStackManager;
3936
import org.truffleruby.language.RubyBaseNode;
4037
import org.truffleruby.language.RubyBaseNodeWithExecute;
4138
import org.truffleruby.language.RubyNode;
4239
import org.truffleruby.language.RubySourceNode;
4340
import org.truffleruby.language.Visibility;
44-
import org.truffleruby.language.arguments.ReadCallerFrameNode;
4541
import org.truffleruby.language.arguments.RubyArguments;
4642
import org.truffleruby.language.control.RaiseException;
4743
import org.truffleruby.language.locals.FindDeclarationVariableNodes;
@@ -500,28 +496,6 @@ protected Object allocate(RubyClass rubyClass) {
500496

501497
}
502498

503-
@Primitive(name = "caller_binding")
504-
public abstract static class CallerBindingNode extends PrimitiveArrayArgumentsNode {
505-
506-
@Child ReadCallerFrameNode callerFrameNode = new ReadCallerFrameNode();
507-
508-
@Specialization
509-
protected RubyBinding binding(VirtualFrame frame,
510-
@Cached ConditionProfile javaCoreMethodProfile) {
511-
MaterializedFrame callerFrame = callerFrameNode.execute(frame);
512-
513-
if (javaCoreMethodProfile.profile(CallStackManager.isJavaCore(RubyArguments.tryGetMethod(callerFrame)))) {
514-
// we are called from a Java core method, e.g., Method#call, we need to find the actual caller
515-
callerFrame = getContext()
516-
.getCallStack()
517-
.getNonJavaCoreCallerFrame(FrameAccess.MATERIALIZE)
518-
.materialize();
519-
}
520-
521-
return BindingNodes.createBinding(getContext(), getLanguage(), callerFrame);
522-
}
523-
}
524-
525499
@Primitive(name = "create_empty_binding")
526500
public abstract static class CreateEmptyBindingNode extends PrimitiveArrayArgumentsNode {
527501
@Specialization

0 commit comments

Comments
 (0)