Refactoring of function types. Also fixes some library import bugs.
This commit is contained in:
@@ -23,7 +23,7 @@ using namespace alloy::runtime;
|
||||
IVMFunction::IVMFunction(FunctionInfo* symbol_info) :
|
||||
register_count_(0), intcode_count_(0), intcodes_(0),
|
||||
source_map_count_(0), source_map_(0),
|
||||
GuestFunction(symbol_info) {
|
||||
Function(symbol_info) {
|
||||
}
|
||||
|
||||
IVMFunction::~IVMFunction() {
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace backend {
|
||||
namespace ivm {
|
||||
|
||||
|
||||
class IVMFunction : public runtime::GuestFunction {
|
||||
class IVMFunction : public runtime::Function {
|
||||
public:
|
||||
IVMFunction(runtime::FunctionInfo* symbol_info);
|
||||
virtual ~IVMFunction();
|
||||
|
||||
@@ -712,6 +712,13 @@ int Translate_CALL_INDIRECT_TRUE(TranslationContext& ctx, Instr* i) {
|
||||
return DispatchToC(ctx, i, fns[i->src1.value->type]);
|
||||
}
|
||||
|
||||
uint32_t IntCode_CALL_EXTERN(IntCodeState& ics, const IntCode* i) {
|
||||
return IntCode_CALL_XX(ics, i, i->src1_reg);
|
||||
}
|
||||
int Translate_CALL_EXTERN(TranslationContext& ctx, Instr* i) {
|
||||
return DispatchToC(ctx, i, IntCode_CALL_EXTERN);
|
||||
}
|
||||
|
||||
uint32_t IntCode_RETURN(IntCodeState& ics, const IntCode* i) {
|
||||
return IA_RETURN;
|
||||
}
|
||||
@@ -4009,6 +4016,7 @@ static const TranslateFn dispatch_table[] = {
|
||||
Translate_CALL_TRUE,
|
||||
Translate_CALL_INDIRECT,
|
||||
Translate_CALL_INDIRECT_TRUE,
|
||||
Translate_CALL_EXTERN,
|
||||
Translate_RETURN,
|
||||
Translate_RETURN_TRUE,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user