mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 11:18:30 +00:00
Improve redbean plus code size optimizations
This change turns symbol table compression back on using Puff, which noticeably reduces the size of programs like redbean and Python. The redbean web server receives some minor API additions for controlling things like SSL in addition to filling gaps in the documentation.
This commit is contained in:
parent
425ff5dff0
commit
13ee75150c
58 changed files with 2077 additions and 589 deletions
90
net/http/khttptoken.S
Normal file
90
net/http/khttptoken.S
Normal file
|
@ -0,0 +1,90 @@
|
|||
#include "libc/macros.internal.h"
|
||||
|
||||
// generated by:
|
||||
// o//tool/build/xlat.com -TiC ' ()<>@,;:\"/[]?={}' -iskHttpToken
|
||||
//
|
||||
// present absent
|
||||
// ──────────────── ────────────────
|
||||
// ∅☺☻♥♦♣♠•◘○◙♂♀♪♫☼ 0x00
|
||||
// ►◄↕‼¶§▬↨↑↓→←∟↔▲▼ 0x10
|
||||
// ! #$%&‘ *+ -. ␠ “ () , / 0x20
|
||||
// 0123456789 :;<=>⁇ 0x30
|
||||
// ABCDEFGHIJKLMNO @ 0x40
|
||||
// PQRSTUVWXYZ ^_ [⭝] 0x50
|
||||
// `abcdefghijklmno 0x60
|
||||
// pqrstuvwxyz | ~ { } ⌂ 0x70
|
||||
// ÇüéâäàåçêëèïîìÄÅ 0x80
|
||||
// ÉæÆôöòûùÿÖÜ¢£¥€ƒ 0x90
|
||||
// áíóúñѪº¿⌐¬½¼¡«» 0xa0
|
||||
// ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐ 0xb0
|
||||
// └┴┬├─┼╞╟╚╔╩╦╠═╬╧ 0xc0
|
||||
// ╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ 0xd0
|
||||
// αßΓπΣσμτΦΘΩδ∞φε∩ 0xe0
|
||||
// ≡±≥≤⌠⌡÷≈°∙×√ⁿ²■λ 0xf0
|
||||
//
|
||||
// const char kHttpToken[256] = {
|
||||
// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x00
|
||||
// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x10
|
||||
// 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 0x20
|
||||
// 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 0x30
|
||||
// 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x40
|
||||
// 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 0x50
|
||||
// 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60
|
||||
// 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, // 0x70
|
||||
// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x80
|
||||
// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x90
|
||||
// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0xa0
|
||||
// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0xb0
|
||||
// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0xc0
|
||||
// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0xd0
|
||||
// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0xe0
|
||||
// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0xf0
|
||||
// };
|
||||
//
|
||||
// @see RFC2616
|
||||
// CHAR = <any US-ASCII character (octets 0 - 127)>
|
||||
// SP = <US-ASCII SP, space (32)>
|
||||
// HT = <US-ASCII HT, horizontal-tab (9)>
|
||||
// CTL = <any US-ASCII control character
|
||||
// (octets 0 - 31) and DEL (127)>
|
||||
// token = 1*<any CHAR except CTLs or separators>
|
||||
// separators = "(" | ")" | "<" | ">" | "@"
|
||||
// | "," | ";" | ":" | "\" | <">
|
||||
// | "/" | "[" | "]" | "?" | "="
|
||||
// | "{" | "}" | SP | HT
|
||||
|
||||
.initbss 300,_init_kHttpToken
|
||||
kHttpToken:
|
||||
.zero 256
|
||||
.endobj kHttpToken,globl
|
||||
.previous
|
||||
|
||||
.initro 300,_init_kHttpToken
|
||||
kHttpToken.rom:
|
||||
.byte 33,0 # 00-20 ∅-␠
|
||||
.byte 1,1 # 21-21 !-!
|
||||
.byte 1,0 # 22-22 “-“
|
||||
.byte 5,1 # 23-27 #-‘
|
||||
.byte 2,0 # 28-29 (-)
|
||||
.byte 2,1 # 2a-2b *-+
|
||||
.byte 1,0 # 2c-2c ,-,
|
||||
.byte 2,1 # 2d-2e --.
|
||||
.byte 1,0 # 2f-2f /-/
|
||||
.byte 10,1 # 30-39 0-9
|
||||
.byte 7,0 # 3a-40 :-@
|
||||
.byte 26,1 # 41-5a A-Z
|
||||
.byte 3,0 # 5b-5d [-]
|
||||
.byte 29,1 # 5e-7a ^-z
|
||||
.byte 1,0 # 7b-7b {-{
|
||||
.byte 1,1 # 7c-7c |-|
|
||||
.byte 1,0 # 7d-7d }-}
|
||||
.byte 1,1 # 7e-7e ~-~
|
||||
.byte 129,0 # 7f-ff ⌂-λ
|
||||
.byte 0,0 # terminator
|
||||
.endobj kHttpToken.rom,globl
|
||||
|
||||
.init.start 300,_init_kHttpToken
|
||||
call rldecode
|
||||
.init.end 300,_init_kHttpToken
|
||||
|
||||
// 45 bytes total (18% original size)
|
Loading…
Add table
Add a link
Reference in a new issue