mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Update CompressibleString
* add CompressibleString to compress/decompress large-sized source code * add ENABLE_SOURCE_COMPRESSION flag (you can use the CompressibleString by build with -DENABLE_SOURCE_COMPRESSION flag) * use lz4 compression algorithm (from https://github.com/lz4/lz4, the latest release v1.9.2) - add Escargot::LZ4 namespace - pull included lib header files out of Escargot::LZ4 namespace - code format changed by tools/check_tidy.py * default outdir in config.cmake removed Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
parent
0a79a6c98c
commit
b27127c3dd
13 changed files with 3947 additions and 37 deletions
|
|
@ -170,11 +170,20 @@ static OptionalRef<StringRef> builtinHelperFileRead(OptionalRef<ExecutionStateRe
|
|||
}
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
#if defined(ENABLE_SOURCE_COMPRESSION)
|
||||
if (hasNonLatin1Content) {
|
||||
src = StringRef::createFromUTF8ToCompressibleString(utf8Str.data(), utf8Str.length());
|
||||
} else {
|
||||
src = StringRef::createCompressibleString(str.data(), str.length());
|
||||
}
|
||||
#else
|
||||
if (hasNonLatin1Content) {
|
||||
src = StringRef::createFromUTF8(utf8Str.data(), utf8Str.length());
|
||||
} else {
|
||||
src = StringRef::createFromLatin1(str.data(), str.length());
|
||||
}
|
||||
#endif
|
||||
return src;
|
||||
} else {
|
||||
char msg[1024];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue