Merge branch 'master' into furas
This commit is contained in:
@@ -143,11 +143,7 @@ void furvm_generator::generate_instruction(furvm::mod& mod,
|
||||
generate_jump(mod, ctx, branch.else_block(), false);
|
||||
} break;
|
||||
case furlang::ir::instruction_t::Return: {
|
||||
if (instr.sources().empty()) {
|
||||
mod.bytecode().push_back(static_cast<furvm::byte>(furvm::instruction_t::Return));
|
||||
} else {
|
||||
mod.bytecode().push_back(static_cast<furvm::byte>(furvm::instruction_t::ReturnValue));
|
||||
}
|
||||
mod.bytecode().push_back(static_cast<furvm::byte>(furvm::instruction_t::Return));
|
||||
} break;
|
||||
case furlang::ir::instruction_t::Call: {
|
||||
const auto& call = dynamic_cast<const furlang::ir::call_instruction&>(instr);
|
||||
|
||||
@@ -170,11 +170,6 @@ enum class instruction_t : byte {
|
||||
* @brief Pops the current call frame.
|
||||
*/
|
||||
Return,
|
||||
|
||||
/**
|
||||
* @brief Pops the current call frame and pushes the first element from the previous stack onto the new stack.
|
||||
*/
|
||||
ReturnValue,
|
||||
};
|
||||
|
||||
struct instruction {
|
||||
|
||||
@@ -297,11 +297,6 @@ void executor::step() {
|
||||
pop_frame();
|
||||
if (m_frames.empty()) m_flags = m_flags | executor_flags::Done;
|
||||
} break;
|
||||
case instruction_t::ReturnValue: {
|
||||
auto value = pop_thing();
|
||||
pop_frame();
|
||||
push_thing(std::move(value));
|
||||
} break;
|
||||
case instruction_t::PushConstant: throw std::runtime_error("unimplemented");
|
||||
default: throw std::runtime_error("unknown instruction");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user