Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
102 additions
and 3 deletions.
- +2 −0 core/src/main/java/org/jruby/ir/IRVisitor.java
- +1 −0 core/src/main/java/org/jruby/ir/Operation.java
- +9 −0 core/src/main/java/org/jruby/ir/instructions/CallBase.java
- +2 −0 core/src/main/java/org/jruby/ir/instructions/CallInstr.java
- +42 −0 core/src/main/java/org/jruby/ir/instructions/specialized/OneFloatArgNoBlockCallInstr.java
- +7 −0 core/src/main/java/org/jruby/ir/interpreter/Interpreter.java
- +39 −3 core/src/main/java/org/jruby/ir/targets/JVMVisitor.java
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
@@ -0,0 +1,42 @@ | ||
package org.jruby.ir.instructions.specialized; | ||
|
||
import org.jruby.ir.IRVisitor; | ||
import org.jruby.ir.Operation; | ||
import org.jruby.ir.instructions.CallInstr; | ||
import org.jruby.ir.operands.Float; | ||
import org.jruby.parser.StaticScope; | ||
import org.jruby.runtime.DynamicScope; | ||
import org.jruby.runtime.ThreadContext; | ||
import org.jruby.runtime.builtin.IRubyObject; | ||
|
||
public class OneFloatArgNoBlockCallInstr extends CallInstr { | ||
private final double flote; | ||
|
||
public OneFloatArgNoBlockCallInstr(CallInstr call) { | ||
super(Operation.CALL_1D, call); | ||
|
||
assert getCallArgs().length == 1; | ||
|
||
this.flote = ((Float) getCallArgs()[0]).value; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return super.toString() + "{1F}"; | ||
} | ||
|
||
public double getFloatArg() { | ||
return flote; | ||
} | ||
|
||
@Override | ||
public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope dynamicScope, IRubyObject self, Object[] temp) { | ||
IRubyObject object = (IRubyObject) receiver.retrieve(context, self, currScope, dynamicScope, temp); | ||
return getCallSite().call(context, self, object, flote); | ||
} | ||
|
||
@Override | ||
public void visit(IRVisitor visitor) { | ||
visitor.OneFloatArgNoBlockCallInstr(this); | ||
} | ||
} |
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