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:
HyukWoo Park 2019-12-18 11:12:53 +09:00 committed by Boram Bae
commit b27127c3dd
13 changed files with 3947 additions and 37 deletions

View file

@ -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];