jit

package module
v0.0.0-...-b536689 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2014 License: LGPL-2.1 Imports: 3 Imported by: 0

README

JIT Build Status

A libjit wrapper for Golang.

(c) 2013 Chanwit Kaewkasi

Suranaree University of Technology, Thailand

This software is licensed under LGPL.

How to install

You need to install libjit firstly. Please note that it requires automake 1.11.6 or later to build libjit. So, check your version of automake before proceed.

git clone git://git.savannah.gnu.org/libjit.git
cd libjit
./auto_gen.sh
./configure --prefix=/usr
make
sudo make install

Then, install the library by: go get github.com/chanwit/jit.

There are some examples under jit/examples. You can try running go run t1.go and see the result.

Enjoy jitting.

Documentation

Index

Constants

View Source
const CDECL = C.jit_abi_cdecl

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	C C.jit_context_t
}

func NewContext

func NewContext() *Context

func (*Context) BuildEnd

func (c *Context) BuildEnd()

func (*Context) BuildStart

func (c *Context) BuildStart()

func (*Context) Destroy

func (c *Context) Destroy()

func (*Context) NewFunction

func (c *Context) NewFunction(ret Type, params []Type) *Function

type Function

type Function struct {
	C C.jit_function_t
	// contains filtered or unexported fields
}

func (*Function) Add

func (f *Function) Add(a, b *Value) *Value

func (*Function) BranchIfNot

func (f *Function) BranchIfNot(v *Value, label *Label)

func (*Function) Call

func (f *Function) Call(target *Function, values ...*Value) *Value

func (*Function) Call0

func (f *Function) Call0(name string, target *Function, values ...*Value) *Value

func (*Function) CallNative

func (f *Function) CallNative(name string, target unsafe.Pointer, sig *Signature, values ...*Value) *Value

func (*Function) Compile

func (f *Function) Compile()

func (*Function) Dump

func (f *Function) Dump(name string)

func (*Function) Eq

func (f *Function) Eq(a, b *Value) *Value

func (*Function) GetOnDemandCompiler

func (f *Function) GetOnDemandCompiler() func(*Function) bool

func (*Function) Label

func (f *Function) Label(label *Label)

func (*Function) LessThan

func (f *Function) LessThan(a, b *Value) *Value

func (*Function) Mul

func (f *Function) Mul(a, b *Value) *Value

func (*Function) Param

func (f *Function) Param(i int) *Value

func (*Function) Param2

func (f *Function) Param2() (*Value, *Value)

func (*Function) Param3

func (f *Function) Param3() (*Value, *Value, *Value)

func (*Function) Return

func (f *Function) Return(ret *Value)

func (*Function) Run

func (f *Function) Run(values ...interface{}) interface{}

func (*Function) SetOnDemandCompiler

func (f *Function) SetOnDemandCompiler(function func(f *Function) bool)

func (*Function) SetRecompilable

func (f *Function) SetRecompilable()

func (*Function) Store

func (f *Function) Store(x, y *Value)

func (*Function) StoreRelative

func (f *Function) StoreRelative(x *Value, offset int, y *Value)

func (*Function) Sub

func (f *Function) Sub(a, b *Value) *Value

func (*Function) TailCall

func (f *Function) TailCall(target *Function, values ...*Value) *Value

type Label

type Label struct {
	C C.jit_label_t
}

func NewLabel

func NewLabel() *Label

type Signature

type Signature struct {
	C C.jit_type_t
}

func NewSignature

func NewSignature(ret Type, params []Type) *Signature

type Type

type Type struct {
	C C.jit_type_t
}

func Int

func Int() Type

func UInt

func UInt() Type

func Void

func Void() Type

func VoidPtr

func VoidPtr() Type

type Value

type Value struct {
	C C.jit_value_t
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL