mu/run_one_test.subx
Kartik Agaram 3ac95f6a40 6072
I just did an experiment, and test_apps is spending over half its time
(95 seconds that could be 40) redundantly clearing every stream before
every test. And some of those streams are _large_; the translators for
SubX and Mu use streams sizes pessimistically for the largest possible
program they can handle (1MB per segment).

A single test (the one in assort.subx) spends 24 seconds initializing 2
1MB-segments before processing a dozen lines of text in the blink of an
eye.

I'm not going to speed this up. But good to know.
2020-02-29 22:36:03 -08:00

31 lines
1.5 KiB
Plaintext

# run a single test
== code
# instruction effective address register displacement immediate
# . op subop mod rm32 base index scale r32
# . 1-3 bytes 3 bits 2 bits 3 bits 3 bits 3 bits 2 bits 2 bits 0/1/2/4 bytes 0/1/2/4 bytes
Entry:
# Heap = new-segment(64KB)
# . . push args
68/push Heap/imm32
ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size
# . . call
e8/call new-segment/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
# initialize-trace-stream(256KB)
# . . push args
68/push 0x40000/imm32/256KB
# . . call
e8/call initialize-trace-stream/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp
# for debugging: run a single test
e8/call $TEST_NAME/disp32
8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx
b8/copy-to-eax 1/imm32/exit
cd/syscall 0x80/imm8
# . . vim:nowrap:textwidth=0