Divide CodeBlock into NativeCodeBlock and InterpretedCodeBlock

* NativeCodeBlock is newly added for NativeFunctionObject
* all interpreter-related info is moved into InterpretedCodeBlock

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
HyukWoo Park 2020-07-03 16:09:26 +09:00 committed by Patrick Kim
commit 2fe9333814
45 changed files with 842 additions and 814 deletions

View file

@ -37,7 +37,7 @@ namespace Escargot {
bool Script::isExecuted()
{
return m_topCodeBlock->m_byteCodeBlock == nullptr;
return m_topCodeBlock->byteCodeBlock() == nullptr;
}
Context* Script::context()
@ -515,7 +515,7 @@ Value Script::executeLocal(ExecutionState& state, Value thisValue, InterpretedCo
FunctionObject* callee = state.resolveCallee();
if (fnRecord->hasBinding(newState, arguments).m_index == SIZE_MAX && callee->isScriptFunctionObject()) {
// FIXME check if formal parameters does not contain a rest parameter, any binding patterns, or any initializers.
bool isMapped = !callee->codeBlock()->hasParameterOtherThanIdentifier() && !inStrict;
bool isMapped = !callee->codeBlock()->asInterpretedCodeBlock()->hasParameterOtherThanIdentifier() && !inStrict;
callee->asScriptFunctionObject()->generateArgumentsObject(newState, state.argc(), state.argv(), fnRecord, nullptr, isMapped);
}
}