Search in sources :

Example 1 with CompiledObject

use of com.github.anba.es6draft.compiler.CompiledObject in project es6draft by anba.

the class ScriptRuntime method GetTemplateObject.

/**
     * 12.2.8 Template Literals
     * <p>
     * 12.2.8.2.2 Runtime Semantics: GetTemplateObject ( templateLiteral )
     * 
     * @param key
     *            the template literal key
     * @param handle
     *            the method handle for the template literal data
     * @param cx
     *            the execution context
     * @return the template call site object
     */
public static ArrayObject GetTemplateObject(int key, MethodHandle handle, ExecutionContext cx) {
    assert cx.getCurrentExecutable() instanceof CompiledObject : cx.getCurrentExecutable();
    CompiledObject compiledObject = (CompiledObject) cx.getCurrentExecutable();
    ArrayObject template = compiledObject.getTemplateObject(key);
    if (template == null) {
        template = GetTemplateObject(handle, cx);
        compiledObject.setTemplateObject(key, template);
    }
    return template;
}
Also used : TypedArrayObject(com.github.anba.es6draft.runtime.objects.binary.TypedArrayObject) CompiledObject(com.github.anba.es6draft.compiler.CompiledObject)

Aggregations

CompiledObject (com.github.anba.es6draft.compiler.CompiledObject)1 TypedArrayObject (com.github.anba.es6draft.runtime.objects.binary.TypedArrayObject)1