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
|
|
@ -63,6 +63,7 @@ protected:
|
|||
ByteCodeBlock* blk = codeBlock->byteCodeBlock();
|
||||
Context* ctx = codeBlock->context();
|
||||
const size_t registerSize = blk->m_requiredOperandRegisterNumber;
|
||||
const size_t programStart = reinterpret_cast<const size_t>(blk->m_code.data());
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
const size_t stackStorageSize = codeBlock->totalStackAllocatedVariableSize();
|
||||
|
|
@ -97,11 +98,11 @@ protected:
|
|||
}
|
||||
|
||||
if (shouldClearStack) {
|
||||
const Value returnValue = ByteCodeInterpreter::interpret(&newState, blk, 0, registerFile);
|
||||
const Value returnValue = ByteCodeInterpreter::interpret(&newState, blk, programStart, registerFile);
|
||||
clearStack<512>();
|
||||
return returnValue;
|
||||
} else {
|
||||
return ByteCodeInterpreter::interpret(&newState, blk, 0, registerFile);
|
||||
return ByteCodeInterpreter::interpret(&newState, blk, programStart, registerFile);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -167,7 +168,7 @@ protected:
|
|||
|
||||
record.setNewTarget(newTarget);
|
||||
|
||||
const Value returnValue = ByteCodeInterpreter::interpret(&newState, blk, 0, registerFile);
|
||||
const Value returnValue = ByteCodeInterpreter::interpret(&newState, blk, reinterpret_cast<const size_t>(blk->m_code.data()), registerFile);
|
||||
if (shouldClearStack) {
|
||||
clearStack<512>();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue