[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: how to load a very large table with more than 2^18 literal strings?
- From: Mike Pall <mikelu-0909@...>
- Date: Sat, 12 Sep 2009 16:18:37 +0200
Joshua Jensen wrote:
>> The parser stores all constant key/value pairs into a lazily
>> allocated template table. It only emits store instructions for
>> variable keys or values. If a template table has been created,
>> it's put into the constant section. The table creation instruction
>> TNEW is then patched to the table duplication instruction TDUP.
>>
> I run into the table size problem often enough to be annoying. Is it
> possible to apply your work in LJ2 as a standard Lua 5.1 patch?
Not easily. You'd first need to modify the whole parser and code
generator to add lazy constifying of string literals (VKSTR, like
VKNUM). Otherwise all parsed strings end up in the constant pool
which sort of defeats the whole idea.
--Mike