[decompile] Joint (#1813)

* temp

* decompile joints

* fix merge
This commit is contained in:
water111
2022-08-28 16:38:58 -04:00
committed by GitHub
parent d4a065a4e5
commit 2bead6db97
28 changed files with 6858 additions and 158 deletions
+9 -1
View File
@@ -3086,7 +3086,8 @@ void FunctionCallElement::update_from_stack(const Env& env,
auto vtable_var_name = env.get_variable_name(*vtable_reg);
auto arg0_mr = match(Matcher::any_reg(0), unstacked.at(1));
if (arg0_mr.matched && env.get_variable_name(*arg0_mr.maps.regs.at(0)) == vtable_var_name) {
if (tp_type.kind != TP_Type::Kind::VIRTUAL_METHOD) {
if (tp_type.kind != TP_Type::Kind::VIRTUAL_METHOD &&
tp_type.kind != TP_Type::Kind::GET_ART_BY_NAME_METHOD) {
throw std::runtime_error(
"Method internal mismatch. METHOD_OF_OBJECT operator didn't get a VIRTUAL_METHOD "
"type.");
@@ -3111,6 +3112,13 @@ void FunctionCallElement::update_from_stack(const Env& env,
arg_forms.at(0) = pop;
auto head = mr.maps.forms.at(1);
// rewrite get-art-by-name-method calls to get-art-by-name, which is a macro that
// will apply the appropriate cast.
if (tp_type.kind == TP_Type::Kind::GET_ART_BY_NAME_METHOD) {
ASSERT(head->to_string(env) == "get-art-by-name-method");
head = pool.form<ConstantTokenElement>("get-art-by-name");
}
auto head_obj = head->to_form(env);
if (head_obj.is_symbol() && tp_type.method_from_type().base_type() == "setting-control" &&
arg_forms.at(0)->to_form(env).is_symbol("*setting-control*") &&