Skip to content

Commit

Permalink
[Truffle] Adding Complex specialization for Fixnum#*.
Browse files Browse the repository at this point in the history
  • Loading branch information
bjfish committed Apr 5, 2015
1 parent 704cc35 commit 6c4efab
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -374,6 +374,16 @@ public Object mulRational(VirtualFrame frame, long a, RubyBasicObject b) {
return rationalMulNode.call(frame, b, "*", null, a);
}

@Specialization(guards = "isComplex(arguments[1])")
public Object mulComplex(VirtualFrame frame, int a, RubyBasicObject b) {
return ruby(frame, "b * a", "b", b, "a", a);
}

@Specialization(guards = "isComplex(arguments[1])")
public Object mulComplex(VirtualFrame frame, long a, RubyBasicObject b) {
return ruby(frame, "b * a", "b", b, "a", a);
}

}

@CoreMethod(names = {"/", "__slash__"}, required = 1)
Expand Down

0 comments on commit 6c4efab

Please sign in to comment.