This moves the compiler support flag out of the public package as it was only put there for tests. This also files modgen under the testing subdir so that it isn't mistaken for main code. Signed-off-by: Adrian Cole <adrian@tetrate.io>
31 lines
897 B
Go
31 lines
897 B
Go
package compiler
|
|
|
|
import (
|
|
"github.com/tetratelabs/wazero/internal/wazeroir"
|
|
)
|
|
|
|
const isSupported = true
|
|
|
|
// init initializes variables for the amd64 architecture
|
|
func init() {
|
|
newArchContext = newArchContextImpl
|
|
}
|
|
|
|
// archContext is embedded in callEngine in order to store architecture-specific data.
|
|
// For amd64, this is empty.
|
|
type archContext struct{}
|
|
|
|
// newArchContextImpl implements newArchContext for amd64 architecture.
|
|
func newArchContextImpl() (ret archContext) { return }
|
|
|
|
func init() {
|
|
unreservedGeneralPurposeRegisters = amd64UnreservedGeneralPurposeRegisters
|
|
unreservedVectorRegisters = amd64UnreservedVectorRegisters
|
|
}
|
|
|
|
// newCompiler returns a new compiler interface which can be used to compile the given function instance.
|
|
// Note: ir param can be nil for host functions.
|
|
func newCompiler(ir *wazeroir.CompilationResult) (compiler, error) {
|
|
return newAmd64Compiler(ir)
|
|
}
|