Skip to content

Commit

Permalink
Fixed some evil bugs related to old assumptions we were making regard…
Browse files Browse the repository at this point in the history
…ing optimizations.

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/branches/fp-optimized-experimental@1744 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information
Patrick Thomson committed Jun 5, 2009
1 parent 79357a3 commit aead5a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1780,7 +1780,7 @@ RoxorCompiler::compile_optimized_dispatch_call(SEL sel, int argc, std::vector<Va
return pn;
}
}
else {
else if (!(leftIsFixFloatConstant || rightIsFixFloatConstant)){
// Either one or both of the operands was not a fixable constant.
Value *is_redefined_val = new LoadInst(is_redefined, "", bb);
Value *isOpRedefined = new ICmpInst(ICmpInst::ICMP_EQ,
Expand Down Expand Up @@ -1844,15 +1844,15 @@ RoxorCompiler::compile_optimized_dispatch_call(SEL sel, int argc, std::vector<Va
unboxedLeft = ConstantInt::get(RubyObjTy, leftLong);
}
else {
unboxedLeft = BinaryOperator::CreateAShr(leftVal, oneVal, "", bb);
unboxedLeft = BinaryOperator::CreateAShr(leftVal, twoVal, "", bb);
}

Value *unboxedRight;
if (rightIsFixnumConstant) {
unboxedRight = ConstantInt::get(RubyObjTy, rightLong);
}
else {
unboxedRight = BinaryOperator::CreateAShr(rightVal, oneVal, "", bb);
unboxedRight = BinaryOperator::CreateAShr(rightVal, twoVal, "", bb);
}

Value *opVal;
Expand Down Expand Up @@ -1904,7 +1904,7 @@ RoxorCompiler::compile_optimized_dispatch_call(SEL sel, int argc, std::vector<Va
BasicBlock *then3BB;

if (result_is_fixnum) {
Value *shift = BinaryOperator::CreateShl(opVal, oneVal, "", bb);
Value *shift = BinaryOperator::CreateShl(opVal, twoVal, "", bb);
thenVal = BinaryOperator::CreateOr(shift, oneVal, "", bb);

// Is result fixable?
Expand Down

0 comments on commit aead5a7

Please sign in to comment.