v.gen.x64 #

fn gen #

fn gen(files []ast.File, table &ast.Table, out_name string, pref &pref.Preferences) (int, int)

struct Gen #

struct Gen {
	out_name string
	pref     &pref.Preferences
mut:
	table                &ast.Table
	buf                  []byte
	sect_header_name_pos int
	offset               i64
	str_pos              []i64
	strings              []string
	file_size_pos        i64
	main_fn_addr         i64
	code_start_pos       i64
	fn_addr              map[string]i64
	var_offset           map[string]int
	stack_var_pos        int
	debug_pos            int
	errors               []errors.Error
	warnings             []errors.Warning
	syms                 []Symbol
	relocs               []Reloc
	nlines               int
}

fn (Gen) add #

fn (mut g Gen) add(reg Register, val int)

fn (Gen) add8 #

fn (mut g Gen) add8(reg Register, val int)

fn (Gen) call_fn #

fn (mut g Gen) call_fn(node ast.CallExpr)

fn (Gen) error_with_pos #

fn (mut g Gen) error_with_pos(s string, pos token.Position)

fn (Gen) gen_exit #

fn (mut g Gen) gen_exit()

fn (Gen) gen_loop_end #

fn (mut g Gen) gen_loop_end(to int, label int)

fn (Gen) gen_loop_start #

fn (mut g Gen) gen_loop_start(from int) int

returns label's relative address

fn (Gen) gen_print #

fn (mut g Gen) gen_print(s string)

fn (Gen) gen_print_from_expr #

fn (mut g Gen) gen_print_from_expr(expr ast.Expr, newline bool)

fn (Gen) generate_elf_header #

fn (mut g Gen) generate_elf_header()

fn (Gen) generate_macho_header #

fn (mut g Gen) generate_macho_header()

fn (Gen) pop #

fn (mut g Gen) pop(reg Register)

fn (Gen) pos #

fn (g &Gen) pos() i64

fn (Gen) push #

fn (mut g Gen) push(reg Register)

fn (Gen) register_function_address #

fn (mut g Gen) register_function_address(name string)

fn (Gen) ret #

fn (mut g Gen) ret()

fn (Gen) save_main_fn_addr #

fn (mut g Gen) save_main_fn_addr()

fn (Gen) stmts #

fn (mut g Gen) stmts(stmts []ast.Stmt)

fn (Gen) sub32 #

fn (mut g Gen) sub32(reg Register, val int)

fn (Gen) sub8 #

fn (mut g Gen) sub8(reg Register, val int)

fn (Gen) zeroes #

fn (mut g Gen) zeroes(n int)