-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f27f85
commit 639d226
Showing
7 changed files
with
80 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,6 +146,7 @@ SetCode~i~i | |
RegMove~i | ||
Reg2Mem~u~i | ||
Reg2Mem4~u~u | ||
_staticmemcpy_ | ||
Overflow | ||
FuncUsrEnd | ||
FuncUsrEnd2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include "gwion_util.h" | ||
#include "gwion_ast.h" | ||
#include "gwion_env.h" | ||
#include "vm.h" | ||
#include "gwion.h" | ||
#include "instr.h" | ||
#include "emit.h" | ||
#include "object.h" | ||
#include "shreduler_private.h" | ||
|
||
ANN void comptime_ini(const Emitter emit, const m_str name) { | ||
emit_push_code(emit, name); // new code { | ||
} | ||
|
||
ANN2(1) void comptime_end(const Emitter emit, const size_t size, void *data) { | ||
if (size) { | ||
emit_regmove(emit, -size); | ||
const Instr instr = emit_add_instr(emit, _staticmemcpy_); | ||
instr->m_val = (m_uint)data; | ||
instr->m_val2 = size; | ||
} | ||
const VM *vm = emit->gwion->vm; | ||
const VM_Code code = finalyze(emit, EOC); // } new code | ||
const VM_Shred shred = vm->cleaner_shred; | ||
shred->code = code; | ||
shred->info->me->ref++; | ||
shredule(vm->shreduler, shred, 0); | ||
const bool loop = vm->shreduler->loop; | ||
vm_run(vm); | ||
shred->code = NULL; | ||
vm->bbq->is_running = true; | ||
vm->shreduler->loop = loop; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters