mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Improve dealing way of program counter in interpreter
* Use direct address instead of using offset of program when calling interpreter * We don't need to restore the pointer of program counter in ExecutionState Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
2e2b6a8398
commit
2678a383ec
5 changed files with 35 additions and 54 deletions
|
|
@ -483,7 +483,7 @@ Value Script::execute(ExecutionState& state, bool isExecuteOnEvalFunction, bool
|
|||
// set the next(first) breakpoint to be stopped in a newer script execution
|
||||
context()->setAsAlwaysStopState();
|
||||
#endif
|
||||
resultValue = ByteCodeInterpreter::interpret(codeExecutionState, byteCodeBlock, 0, registerFile);
|
||||
resultValue = ByteCodeInterpreter::interpret(codeExecutionState, byteCodeBlock, reinterpret_cast<size_t>(byteCodeBlock->m_code.data()), registerFile);
|
||||
clearStack<512>();
|
||||
|
||||
// we give up program bytecodeblock after first excution for reducing memory usage
|
||||
|
|
@ -611,7 +611,7 @@ Value Script::executeLocal(ExecutionState& state, Value thisValue, InterpretedCo
|
|||
}
|
||||
|
||||
newState.ensureRareData()->m_codeBlock = m_topCodeBlock;
|
||||
Value resultValue = ByteCodeInterpreter::interpret(&newState, byteCodeBlock, 0, registerFile);
|
||||
Value resultValue = ByteCodeInterpreter::interpret(&newState, byteCodeBlock, reinterpret_cast<size_t>(byteCodeBlock->m_code.data()), registerFile);
|
||||
clearStack<512>();
|
||||
|
||||
return resultValue;
|
||||
|
|
@ -1093,7 +1093,7 @@ Script::ModuleExecutionResult Script::moduleExecute(ExecutionState& state, Optio
|
|||
|
||||
if (LIKELY(!m_topCodeBlock->isAsync())) {
|
||||
try {
|
||||
ByteCodeInterpreter::interpret(newState, byteCodeBlock, 0, registerFile);
|
||||
ByteCodeInterpreter::interpret(newState, byteCodeBlock, reinterpret_cast<size_t>(byteCodeBlock->m_code.data()), registerFile);
|
||||
} catch (const Value& e) {
|
||||
resultValue = e;
|
||||
gotException = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue