fn gen_print(platform: Platform) -> Chunk {
    let mut code = Emitter::new_simple("print", platform);
    match platform {
        Platform::Windows => code.emit(&[0x48, 0x8B, 0x4D, 0x10]), //  mov rcx,[rbp+16]
        Platform::Linux | Platform::Macos => code.emit(&[0x48, 0x8B, 0x7D, 0x10]), // mov rdi,[rbp+16]
    }
    code.prepare_call(platform.stack_reserve());
    code.call(BUILTIN_PRINT);
    code.end_proc();
    code.finalize(ProcedureDebug {
        decl_line: 0,
        artificial: true,
        parent: None,
        lines: vec![],
        return_type: TypeDebug::class_type("<None>"),
        params: vec![VarDebug {
            offset: 16,
            line: 0,
            name: "object".to_owned(),
            var_type: TypeDebug::class_type("object"),
        }],
        locals: vec![],
        frame_size: 0,
    })
}
// Generate machine code for `print`
Generate machine code for `print`
Generate machine code for ` print `
fn gen_print(platform: Platform) -> Chunk {
    let mut code = Emitter::new_simple("print", platform);
    match platform {
        Platform::Windows => code.emit(&[0x48, 0x8B, 0x4D, 0x10]), //  mov rcx,[rbp+16]
        Platform::Linux | Platform::Macos => code.emit(&[0x48, 0x8B, 0x7D, 0x10]), // mov rdi,[rbp+16]
    }
    code.prepare_call(platform.stack_reserve());
    code.call(BUILTIN_PRINT);
    code.end_proc();
    code.finalize(ProcedureDebug {
        decl_line: 0,
        artificial: true,
        parent: None,
        lines: vec![],
        return_type: TypeDebug::class_type("<None>"),
        params: vec![VarDebug {
            offset: 16,
            line: 0,
            name: "object".to_owned(),
            var_type: TypeDebug::class_type("object"),
        }],
        locals: vec![],
        frame_size: 0,
    })
}
fn gen_print ( platform : Platform ) -> Chunk { let mut code = Emitter :: new_simple ( " " , platform ) ; match platform { Platform :: Windows => code . emit ( & [ 0x48 , 0x8B , 0x4D , 0x10 ] ) , //  mov rcx,[rbp+16] Platform :: Linux | Platform :: Macos => code . emit ( & [ 0x48 , 0x8B , 0x7D , 0x10 ] ) , // mov rdi,[rbp+16] } code . prepare_call ( platform . stack_reserve ( ) ) ; code . call ( BUILTIN_PRINT ) ; code . end_proc ( ) ; code . finalize ( ProcedureDebug { decl_line : 0 , artificial : true , parent : None , lines : vec ! [ ] , return_type : TypeDebug :: class_type ( " " ) , params : vec ! [ VarDebug { offset 16 line 0 name " " to_owned ( ) var_type TypeDebug class_type ( " " ) } ] , locals : vec ! [ ] , frame_size : 0 , } ) }
Generate machine code for `print`
Generate machine code for ` print `
platform
Platform