mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Reduce memory allocation during bytecode generation
* ByteCodeBlock does not hold location data info anymore * location data of each bytecode is manually allocated only for stack-tracing or debugger mode * duplicated String allocation for source code is removed Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
parent
ccdf475f9b
commit
f56a557ff5
22 changed files with 277 additions and 186 deletions
|
|
@ -563,13 +563,13 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
static bool evalScript(ContextRef* context, StringRef* str, StringRef* srcName, bool shouldPrintScriptResult, bool isModule)
|
||||
static bool evalScript(ContextRef* context, StringRef* source, StringRef* srcName, bool shouldPrintScriptResult, bool isModule)
|
||||
{
|
||||
if (stringEndsWith(srcName->toStdUTF8String(), "mjs")) {
|
||||
isModule = isModule || true;
|
||||
}
|
||||
|
||||
auto scriptInitializeResult = context->scriptParser()->initializeScript(str, srcName, isModule);
|
||||
auto scriptInitializeResult = context->scriptParser()->initializeScript(source, srcName, isModule);
|
||||
if (!scriptInitializeResult.script) {
|
||||
fprintf(stderr, "Script parsing error: ");
|
||||
switch (scriptInitializeResult.parseErrorCode) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue