Skip to content

Commit 828bbe4

Browse files
committedAug 13, 2016
Start adding instruction tests.
1 parent 431d99c commit 828bbe4

File tree

2 files changed

+1359
-0
lines changed

2 files changed

+1359
-0
lines changed
 

Diff for: ‎machine/test/test.hpp

+15
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "vm.hpp"
55
#include "state.hpp"
6+
#include "call_frame.hpp"
67
#include "config_parser.hpp"
78
#include "machine/object_utils.hpp"
89
#include "memory.hpp"
@@ -23,6 +24,20 @@ class VMTest {
2324
ConfigParser* config_parser;
2425
Configuration config;
2526

27+
28+
void setup_call_frame(CallFrame* cf, int size) {
29+
cf->prepare(size);
30+
cf->stack_ptr_ = cf->stk - 1;
31+
cf->previous = NULL;
32+
cf->lexical_scope_ = nil<LexicalScope>();
33+
cf->dispatch_data = NULL;
34+
cf->compiled_code = nil<CompiledCode>();
35+
cf->flags = 0;
36+
cf->top_scope_ = NULL;
37+
cf->scope = NULL;
38+
cf->arguments = NULL;
39+
}
40+
2641
// TODO: Fix this
2742
void initialize_as_root(VM* vm) {
2843
vm->set_current_thread();

0 commit comments

Comments
 (0)