Commit 776b3869 authored by Stephanie Gawroriski's avatar Stephanie Gawroriski
Browse files

Add base classes for the JS config and engine.

parent 2178fd10
......@@ -4,6 +4,7 @@ X-SquirrelJME-Error: CA
X-SquirrelJME-Name: Web Demo JIT
X-SquirrelJME-Vendor: Steven Gawroriski
X-SquirrelJME-Version: 0.0.2
X-SquirrelJME-Depends: squirreljme-jit
X-SquirrelJME-Description: This is a JIT which compiles to Javascript
so that the web demo runs at the speed of the Javascript engine.
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
// Copyright (C) Steven Gawroriski <steven@multiphasicapps.net>
// Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------
package net.multiphasicapps.squirreljme.jit.webdemo;
import net.multiphasicapps.squirreljme.jit.JITConfig;
import net.multiphasicapps.squirreljme.jit.JITConfigSerializer;
/**
* Javascript configuration.
*
* @since 2017/03/14
*/
public class JSConfig
extends JITConfig<JSConfig>
{
/**
* Initializes the configuration.
*
* @sine 2017/03/14
*/
public JSConfig()
{
super("generic.bits", "32");
}
/**
* {@inheritDoc}
* @since 2017/03/14
*/
@Override
public JITConfigSerializer<JSConfig> serializer()
{
throw new todo.TODO();
}
}
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
// Copyright (C) Steven Gawroriski <steven@multiphasicapps.net>
// Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------
package net.multiphasicapps.squirreljme.jit.webdemo;
import net.multiphasicapps.squirreljme.classformat.StackMapType;
import net.multiphasicapps.squirreljme.jit.ActiveCacheState;
import net.multiphasicapps.squirreljme.jit.CacheState;
import net.multiphasicapps.squirreljme.jit.DataType;
import net.multiphasicapps.squirreljme.jit.JITConfig;
import net.multiphasicapps.squirreljme.jit.JITStateAccessor;
import net.multiphasicapps.squirreljme.jit.TranslationEngine;
import net.multiphasicapps.squirreljme.linkage.MethodLinkage;
/**
* This is the translation engine for the compile to JavaScript target.
*
* @since 2017/03/14
*/
public class JSEngine
extends TranslationEngine
{
/**
* Initializes the Javascript engine.
*
* @param __conf The target configuration.
* @param __sa The accessor to the state.
* @since 2017/03/14
*/
public JSEngine(JITConfig __conf, JITStateAccessor __sa)
{
super(__conf, __sa);
}
/**
* {@inheritDoc}
* @since 2017/03/14
*/
@Override
public void bindStateForEntry(ActiveCacheState __cs)
{
throw new todo.TODO();
}
/**
* {@inheritDoc}
* @since 2017/03/14
*/
@Override
public void invokeMethod(CacheState __in, ActiveCacheState __out,
MethodLinkage __ml, ActiveCacheState.Slot __rv,
CacheState.Slot[] __args)
throws NullPointerException
{
throw new todo.TODO();
}
/**
* {@inheritDoc}
* @since 2017/03/14
*/
@Override
public void slotCount(int __ms, int __ml)
{
throw new todo.TODO();
}
/**
* {@inheritDoc}
* @since 2017/03/14
*/
@Override
public DataType toDataType(StackMapType __t)
throws NullPointerException
{
throw new todo.TODO();
}
}
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
// Copyright (C) Steven Gawroriski <steven@multiphasicapps.net>
// Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------
package net.multiphasicapps.squirreljme.jit.webdemo;
import net.multiphasicapps.squirreljme.jit.JITConfig;
import net.multiphasicapps.squirreljme.jit.JITStateAccessor;
import net.multiphasicapps.squirreljme.jit.TranslationEngine;
import net.multiphasicapps.squirreljme.jit.TranslationEngineProvider;
/**
* This provides translation engines to the JavaScript JIT.
*
* @since 2017/03/14
*/
public class JSEngineProvider
implements TranslationEngineProvider
{
/** The target configuration. */
protected final JITConfig config;
/**
* Initializes the Javascript engine provider.
*
* @since 2017/03/14
*/
public JSEngineProvider()
{
// Setup config
this.config = new JSConfig();
}
/**
* {@inheritDoc}
* @since 2017/03/14
*/
@Override
public TranslationEngine createEngine(JITStateAccessor __jsa)
{
return new JSEngine(this.config, __jsa);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment