Skip to content

Do not create stubs when resolving virtual calls #1917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Do not create stubs when resolving virtual methods
It is no longer necessary to do this here. Stubs are getting created
earlier, before method conversion.
  • Loading branch information
Owen Jones committed Mar 8, 2018
commit b87661e7b847b01c44353ae8fa10fe56f5486b04
15 changes: 0 additions & 15 deletions src/java_bytecode/ci_lazy_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,6 @@ void ci_lazy_methodst::get_virtual_method_targets(
!call_basename.empty(),
"Virtual function must have a reasonable name after removing class");

auto old_size=callable_methods.size();

const irep_idt &self_method=
get_virtual_method_target(
instantiated_classes, call_basename, call_class, symbol_table);
Expand All @@ -449,19 +447,6 @@ void ci_lazy_methodst::get_virtual_method_targets(
if(!child_method.empty())
callable_methods.push_back(child_method);
}

if(callable_methods.size()==old_size)
{
// Didn't find any candidate callee. Generate a stub.
std::string stubname=id2string(call_class)+"."+id2string(call_basename);
symbolt symbol;
symbol.name=stubname;
symbol.base_name=call_basename;
symbol.type=c.function().type();
symbol.value.make_nil();
symbol.mode=ID_java;
symbol_table.add(symbol);
}
}

/// See output
Expand Down