Search in sources :

Example 6 with ExecutionContext

use of com.github.anba.es6draft.runtime.ExecutionContext in project es6draft by anba.

the class Int8x16Constructor method call.

@Override
public Object call(ExecutionContext callerContext, Object thisValue, Object... args) {
    ExecutionContext calleeContext = calleeContext();
    Object[] fields = new Object[VECTOR_LENGTH];
    for (int i = 0; i < VECTOR_LENGTH; ++i) {
        fields[i] = i < args.length ? args[i] : UNDEFINED;
    }
    return SIMDCreateInt(calleeContext, SIMD_TYPE, fields, AbstractOperations::ToInt8);
}
Also used : ExecutionContext(com.github.anba.es6draft.runtime.ExecutionContext) ScriptObject(com.github.anba.es6draft.runtime.types.ScriptObject) AbstractOperations(com.github.anba.es6draft.runtime.AbstractOperations)

Example 7 with ExecutionContext

use of com.github.anba.es6draft.runtime.ExecutionContext in project es6draft by anba.

the class Bool16x8Constructor method call.

@Override
public Object call(ExecutionContext callerContext, Object thisValue, Object... args) {
    ExecutionContext calleeContext = calleeContext();
    Object[] fields = new Object[VECTOR_LENGTH];
    for (int i = 0; i < VECTOR_LENGTH; ++i) {
        fields[i] = i < args.length ? args[i] : UNDEFINED;
    }
    return SIMDCreateBool(calleeContext, SIMD_TYPE, fields, AbstractOperations::ToBoolean);
}
Also used : ExecutionContext(com.github.anba.es6draft.runtime.ExecutionContext) ScriptObject(com.github.anba.es6draft.runtime.types.ScriptObject) AbstractOperations(com.github.anba.es6draft.runtime.AbstractOperations)

Example 8 with ExecutionContext

use of com.github.anba.es6draft.runtime.ExecutionContext in project es6draft by anba.

the class CodeGenerator method compile.

MethodName compile(SwitchStatement node, BlockDeclarationInstantiationGenerator generator) {
    if (!isCompiled(node)) {
        MethodCode method = newMethod(node);
        BlockDeclInitVisitor body = new BlockDeclInitVisitor(method);
        body.lineInfo(node);
        body.begin();
        Variable<ExecutionContext> cx = body.getExecutionContext();
        Variable<LexicalEnvironment<DeclarativeEnvironmentRecord>> env = body.getLexicalEnvironment();
        generator.generateMethod(node, cx, env, body);
        body._return();
        body.end();
    }
    return methodDesc(node);
}
Also used : ExecutionContext(com.github.anba.es6draft.runtime.ExecutionContext) LexicalEnvironment(com.github.anba.es6draft.runtime.LexicalEnvironment) MethodCode(com.github.anba.es6draft.compiler.assembler.Code.MethodCode)

Example 9 with ExecutionContext

use of com.github.anba.es6draft.runtime.ExecutionContext in project es6draft by anba.

the class CodeGenerator method compile.

MethodName compile(SwitchStatement node, List<Declaration> declarations, BlockDeclarationInstantiationGenerator generator) {
    MethodCode method = newMethod2(node);
    BlockDeclInitVisitor body = new BlockDeclInitVisitor(method);
    body.lineInfo(node);
    body.begin();
    Variable<ExecutionContext> cx = body.getExecutionContext();
    Variable<LexicalEnvironment<DeclarativeEnvironmentRecord>> env = body.getLexicalEnvironment();
    generator.generateMethod(declarations, cx, env, body);
    body._return();
    body.end();
    return methodDesc(node, method.methodName);
}
Also used : ExecutionContext(com.github.anba.es6draft.runtime.ExecutionContext) LexicalEnvironment(com.github.anba.es6draft.runtime.LexicalEnvironment) MethodCode(com.github.anba.es6draft.compiler.assembler.Code.MethodCode)

Example 10 with ExecutionContext

use of com.github.anba.es6draft.runtime.ExecutionContext in project es6draft by anba.

the class CodeGenerator method compile.

MethodName compile(BlockStatement node, BlockDeclarationInstantiationGenerator generator) {
    if (!isCompiled(node)) {
        MethodCode method = newMethod(node);
        BlockDeclInitVisitor body = new BlockDeclInitVisitor(method);
        body.lineInfo(node);
        body.begin();
        Variable<ExecutionContext> cx = body.getExecutionContext();
        Variable<LexicalEnvironment<DeclarativeEnvironmentRecord>> env = body.getLexicalEnvironment();
        generator.generateMethod(node, cx, env, body);
        body._return();
        body.end();
    }
    return methodDesc(node);
}
Also used : ExecutionContext(com.github.anba.es6draft.runtime.ExecutionContext) LexicalEnvironment(com.github.anba.es6draft.runtime.LexicalEnvironment) MethodCode(com.github.anba.es6draft.compiler.assembler.Code.MethodCode)

Aggregations

ExecutionContext (com.github.anba.es6draft.runtime.ExecutionContext)70 ScriptObject (com.github.anba.es6draft.runtime.types.ScriptObject)46 AbstractOperations (com.github.anba.es6draft.runtime.AbstractOperations)10 Realm (com.github.anba.es6draft.runtime.Realm)10 Callable (com.github.anba.es6draft.runtime.types.Callable)10 LexicalEnvironment (com.github.anba.es6draft.runtime.LexicalEnvironment)9 FunctionObject (com.github.anba.es6draft.runtime.types.builtins.FunctionObject)8 ScriptException (com.github.anba.es6draft.runtime.internal.ScriptException)7 OrdinaryObject (com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject)6 Name (com.github.anba.es6draft.ast.scope.Name)5 ArrayObject (com.github.anba.es6draft.runtime.types.builtins.ArrayObject)5 HashSet (java.util.HashSet)5 Declaration (com.github.anba.es6draft.ast.Declaration)4 HoistableDeclaration (com.github.anba.es6draft.ast.HoistableDeclaration)4 StatementListItem (com.github.anba.es6draft.ast.StatementListItem)4 MethodCode (com.github.anba.es6draft.compiler.assembler.Code.MethodCode)4 MethodName (com.github.anba.es6draft.compiler.assembler.MethodName)4 TryCatchLabel (com.github.anba.es6draft.compiler.assembler.TryCatchLabel)4 IsCallable (com.github.anba.es6draft.runtime.AbstractOperations.IsCallable)4 ToObject (com.github.anba.es6draft.runtime.AbstractOperations.ToObject)4