mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Implement basic of using variable
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
b2ba17408c
commit
954b5bc77f
25 changed files with 583 additions and 45 deletions
|
|
@ -43,6 +43,7 @@ ByteCodeGenerateContext::ByteCodeGenerateContext(InterpretedCodeBlock* codeBlock
|
|||
, m_isFunctionDeclarationBindingInitialization(false)
|
||||
, m_isVarDeclaredBindingInitialization(false)
|
||||
, m_isLexicallyDeclaredBindingInitialization(false)
|
||||
, m_isUsingBindingInitialization(false)
|
||||
, m_canSkipCopyToRegister(true)
|
||||
, m_keepNumberalLiteralsInRegisterFile(numeralLiteralData)
|
||||
, m_inCallingExpressionScope(false)
|
||||
|
|
@ -56,6 +57,7 @@ ByteCodeGenerateContext::ByteCodeGenerateContext(InterpretedCodeBlock* codeBlock
|
|||
#endif
|
||||
, m_needsExtendedExecutionState(codeBlock->isAsync() || codeBlock->isGenerator())
|
||||
, m_registerStack(new std::vector<ByteCodeRegisterIndex>())
|
||||
, m_disposableRecordRegisterStack(new std::vector<ByteCodeRegisterIndex>())
|
||||
, m_lexicallyDeclaredNames(new std::vector<std::pair<size_t, AtomicString>>())
|
||||
, m_positionToContinue(0)
|
||||
, m_lexicalBlockIndex(0)
|
||||
|
|
@ -885,6 +887,17 @@ void ByteCodeGenerator::relocateByteCode(ByteCodeBlock* block)
|
|||
}
|
||||
break;
|
||||
}
|
||||
case InitializeDisposableOpcode: {
|
||||
InitializeDisposable* cd = (InitializeDisposable*)currentCode;
|
||||
ASSIGN_STACKINDEX_IF_NEEDED(cd->m_srcRegisterIndex, stackBase, stackBaseWillBe, stackVariableSize);
|
||||
ASSIGN_STACKINDEX_IF_NEEDED(cd->m_dstRegisterIndex, stackBase, stackBaseWillBe, stackVariableSize);
|
||||
break;
|
||||
}
|
||||
case FinalizeDisposableOpcode: {
|
||||
FinalizeDisposable* cd = (FinalizeDisposable*)currentCode;
|
||||
ASSIGN_STACKINDEX_IF_NEEDED(cd->m_dataRegisterIndex, stackBase, stackBaseWillBe, stackVariableSize);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue