mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
implement declare var, Function Decl, Function Expression
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
7c47c6ed51
commit
a545adebf5
28 changed files with 549 additions and 90 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include "ByteCodeInterpreter.h"
|
||||
#include "runtime/Environment.h"
|
||||
#include "runtime/EnvironmentRecord.h"
|
||||
#include "runtime/FunctionObject.h"
|
||||
|
||||
namespace Escargot {
|
||||
|
||||
|
|
@ -98,6 +99,30 @@ void ByteCodeIntrepreter::interpret(ExecutionState& state, CodeBlock* codeBlock)
|
|||
NEXT_INSTRUCTION();
|
||||
}
|
||||
|
||||
DeclareVarVariableOpcodeLbl:
|
||||
{
|
||||
DeclareVarVariable* code = (DeclareVarVariable*)currentCode;
|
||||
env->record()->createMutableBinding(state, code->m_name, false);
|
||||
executeNextCode<DeclareVarVariable>(programCounter);
|
||||
NEXT_INSTRUCTION();
|
||||
}
|
||||
|
||||
DeclareFunctionExpressionOpcodeLbl:
|
||||
{
|
||||
DeclareFunctionExpression* code = (DeclareFunctionExpression*)currentCode;
|
||||
registerFile[code->m_registerIndex] = new FunctionObject(state, code->m_codeBlock);
|
||||
executeNextCode<DeclareFunctionExpression>(programCounter);
|
||||
NEXT_INSTRUCTION();
|
||||
}
|
||||
|
||||
DeclareFunctionDeclarationOpcodeLbl:
|
||||
{
|
||||
DeclareFunctionDeclaration* code = (DeclareFunctionDeclaration*)currentCode;
|
||||
registerFile[0] = new FunctionObject(state, code->m_codeBlock);
|
||||
executeNextCode<DeclareFunctionDeclaration>(programCounter);
|
||||
NEXT_INSTRUCTION();
|
||||
}
|
||||
|
||||
EndOpcodeLbl:
|
||||
{
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue