Skip to content

Instantly share code, notes, and snippets.

@sshao
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save sshao/7eecc87458d3e55d7f5d to your computer and use it in GitHub Desktop.

Select an option

Save sshao/7eecc87458d3e55d7f5d to your computer and use it in GitHub Desktop.
diff --git a/vm/llvm/jit_visit.hpp b/vm/llvm/jit_visit.hpp
index ad91132..fdeebb7 100644
--- a/vm/llvm/jit_visit.hpp
+++ b/vm/llvm/jit_visit.hpp
@@ -2517,7 +2517,6 @@ use_send:
void visit_cast_for_multi_block_arg() {
JITStackArgs* inline_args = incoming_args();
if(inline_args) {
- if(inline_args->size() == 1) {
std::vector<Type*> types;
types.push_back(ctx_->ptr_type("State"));
types.push_back(CallFrameTy);
@@ -2541,10 +2540,6 @@ use_send:
check_for_exception(ary);
stack_push(ary);
- } else {
- stack_push(constant(cUndef)); // holder
- set_hint(cHintLazyBlockArgs);
- }
} else {
Signature sig(ctx_, ObjType);
sig << StateTy;
sig << CallFrameTy;
# this repro yields the correct result with and without the jit_visit changes
def m
yield [1, 2, 3]
end
def work
m { |a, b, c| [a, b, c] }
end
i = 0
while i < 500_000 do
work
i += 1
end
p work
# this repro yielded the wrong result without the jit_visit changes
# but yields the correct result with the changes
def m
yield 1, 2, 3
end
def work
m { |a, b, c| [a, b, c] }
end
i = 0
while i < 500_000 do
work
i += 1
end
p work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment