Skip to content

Commit

Permalink
Fixed JIT for goto_if_nil, goto_if_not_nil.
Browse files Browse the repository at this point in the history
  • Loading branch information
brixen committed Dec 9, 2014
1 parent 27d4f07 commit 033ec2d
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions vm/llvm/jit_visit.hpp
Expand Up @@ -2885,15 +2885,7 @@ namespace rubinius {
}

void visit_goto_if_nil(opcode ip) {
Value* value = stack_pop();
Value* i = b().CreatePtrToInt(
value, ctx_->IntPtrTy, "as_int");

Value* anded = b().CreateAnd(i,
clong(FALSE_MASK), "and");

Value* cmp = b().CreateICmpEQ(anded,
clong(reinterpret_cast<long>(cNil)), "is_nil");
Value* cmp = b().CreateICmpEQ(stack_pop(), constant(cNil), "is_nil");

BasicBlock* cont = new_block("continue");
BasicBlock* bb = block_map_[ip].block;
Expand All @@ -2904,15 +2896,7 @@ namespace rubinius {
}

void visit_goto_if_not_nil(opcode ip) {
Value* value = stack_pop();
Value* i = b().CreatePtrToInt(
value, ctx_->IntPtrTy, "as_int");

Value* anded = b().CreateAnd(i,
clong(FALSE_MASK), "and");

Value* cmp = b().CreateICmpNE(anded,
clong(reinterpret_cast<long>(cNil)), "is_not_nil");
Value* cmp = b().CreateICmpNE(stack_pop(), constant(cNil), "is_not_nil");

BasicBlock* cont = new_block("continue");
BasicBlock* bb = block_map_[ip].block;
Expand Down

0 comments on commit 033ec2d

Please sign in to comment.