Skip to content

Commit

Permalink
jit(arm64): Add common 'compile'/'maybeCompile' prefix (tetratelabs#235)
Browse files Browse the repository at this point in the history
Signed-off-by: r8d8 <ckryvomaz@gmail.com>
  • Loading branch information
mathetake authored and r8d8 committed Feb 14, 2022
1 parent eeb18d1 commit 7011653
Show file tree
Hide file tree
Showing 6 changed files with 312 additions and 303 deletions.
4 changes: 2 additions & 2 deletions wasm/jit/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
type compiler interface {
// String is for debugging purpose.
String() string
// emitPreamble is called before compiling any wazeroir operation.
// compilePreamble is called before compiling any wazeroir operation.
// This is used, for example, to initilize the reserved registers, etc.
emitPreamble() error
compilePreamble() error
// compile generates the byte slice of native code.
// stackPointerCeil is the max stack pointer that the target function would reach.
// staticData is compiledFunctionStaticData for the resutling native code.
Expand Down
2 changes: 1 addition & 1 deletion wasm/jit/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ func compileWasmFunction(f *wasm.FunctionInstance) (*compiledFunction, error) {
return nil, fmt.Errorf("failed to initialize assembly builder: %w", err)
}

if err := compiler.emitPreamble(); err != nil {
if err := compiler.compilePreamble(); err != nil {
return nil, fmt.Errorf("failed to emit preamble: %w", err)
}

Expand Down
2 changes: 1 addition & 1 deletion wasm/jit/jit_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -5219,7 +5219,7 @@ func (c *amd64Compiler) exit(status jitCallStatusCode) {
c.addInstruction(ret)
}

func (c *amd64Compiler) emitPreamble() (err error) {
func (c *amd64Compiler) compilePreamble() (err error) {
// We assume all function parameters are already pushed onto the stack by
// the caller.
c.pushFunctionParams()
Expand Down
Loading

0 comments on commit 7011653

Please sign in to comment.