compile.scm serialization: emit 32bit-format header when possible
This commit is contained in:
parent
8eb89941db
commit
c99c947c18
@ -1167,13 +1167,27 @@
|
||||
))
|
||||
(emit-header (lambda ()
|
||||
; we assume that 'count' ran first to initialize len, objcount, size32, size64
|
||||
(bytecode-put-u32 #x8495A6BF) ; Intext_magic_number_big
|
||||
(bytecode-put-u32 0) ; Unused
|
||||
(bytecode-put-u64 len)
|
||||
(bytecode-put-u64 objcount) ; note: always 0, as objects are not used in the bytecode-object format
|
||||
(bytecode-put-u64 size64)
|
||||
(cond
|
||||
((and
|
||||
(fits-unsigned 32 len)
|
||||
(fits-unsigned 32 size32)
|
||||
(fits-unsigned 32 size64)
|
||||
)
|
||||
(bytecode-put-u32 #x8495A6BE) ; Intext_magic_number_small
|
||||
(bytecode-put-u32 len)
|
||||
(bytecode-put-u32 objcount) ; note: always 0, as objects are not used in the bytecode-object format
|
||||
(bytecode-put-u32 size32)
|
||||
(bytecode-put-u32 size64)
|
||||
)
|
||||
(else
|
||||
(bytecode-put-u32 #x8495A6BF) ; Intext_magic_number_big
|
||||
(bytecode-put-u32 0) ; Unused
|
||||
(bytecode-put-u64 len)
|
||||
(bytecode-put-u64 objcount)
|
||||
(bytecode-put-u64 size64)
|
||||
))
|
||||
)
|
||||
))
|
||||
)
|
||||
(begin
|
||||
(count value)
|
||||
(emit-header)
|
||||
|
@ -1 +1 @@
|
||||
Bytecode size: 7624 bytes
|
||||
Bytecode size: 7600 bytes
|
||||
|
@ -1 +1 @@
|
||||
Bytecode size: 5044 bytes
|
||||
Bytecode size: 5020 bytes
|
||||
|
@ -1 +1 @@
|
||||
Bytecode size: 10060 bytes
|
||||
Bytecode size: 10036 bytes
|
||||
|
@ -1 +1 @@
|
||||
Bytecode size: 7920 bytes
|
||||
Bytecode size: 7896 bytes
|
||||
|
@ -1 +1 @@
|
||||
Bytecode size: 10622 bytes
|
||||
Bytecode size: 10598 bytes
|
||||
|
@ -1 +1 @@
|
||||
Bytecode size: 9316 bytes
|
||||
Bytecode size: 9292 bytes
|
||||
|
@ -1 +1 @@
|
||||
Bytecode size: 6183 bytes
|
||||
Bytecode size: 6159 bytes
|
||||
|
@ -1 +1 @@
|
||||
Bytecode size: 5613 bytes
|
||||
Bytecode size: 5589 bytes
|
||||
|
@ -1 +1 @@
|
||||
Bytecode size: 6704 bytes
|
||||
Bytecode size: 6680 bytes
|
||||
|
@ -1 +1 @@
|
||||
Bytecode size: 6327 bytes
|
||||
Bytecode size: 6303 bytes
|
||||
|
@ -1 +1 @@
|
||||
Bytecode size: 7883 bytes
|
||||
Bytecode size: 7859 bytes
|
||||
|
@ -1 +1 @@
|
||||
Bytecode size: 6862 bytes
|
||||
Bytecode size: 6838 bytes
|
||||
|
@ -1 +1 @@
|
||||
Bytecode size: 17753 bytes
|
||||
Bytecode size: 17729 bytes
|
||||
|
@ -1 +1 @@
|
||||
Bytecode size: 7311 bytes
|
||||
Bytecode size: 7287 bytes
|
||||
|
Loading…
x
Reference in New Issue
Block a user