jserv / full-stack-hello

minimal instruction set and assembler/compiler for "Hello World" execution
Other
114 stars 49 forks source link

The opcode impl hook design is inefficient #1

Open mlouielu opened 7 years ago

mlouielu commented 7 years ago

Current design about opcode implement hook is to hook the corresponding implement to each instruction in env->insts, which the insts is read from file.

Should it be hook on an opcode impl list, then each instruction only need to call from env->impl[opcode](...), this should be more efficient for memory usage and hooking stage.

jserv commented 7 years ago

We need map or associative data structure to hook instruction and validate as well.

mlouielu commented 7 years ago

@jserv I didn't get it. what do you mean?