 MoonBit月兔编程语言 现代编程思想 第十四课 案例:堆栈虚拟机	
local.set 控制流: if/else call 7 类型定义 数据 1. enum Value { I32(Int) } // 只考虑32位有符号整数 指令 1. enum Instruction { 2. Const(Int) // 常数 3. Add; Sub; Modulo; Equal // // 函数调⽤ 5. Local_Get(String); Local_Set(String) // 取值、设值 6. If(Int, List[Instruction], List[Instruction]) // 条件判断 7. } 8 类型定义 函数 1. struct Function { 2. name : String 3. // 只考虑⼀种数据 称和数量 4. params : List[String]; result : Int; locals : List[String] 5. instructions : List[Instruction] 6. } 程序 1. struct Program { 2. functions : List[Function] 3. start : Option[String] 4. }0 码力 | 31 页 | 594.38 KB | 1 年前3 MoonBit月兔编程语言 现代编程思想 第十四课 案例:堆栈虚拟机	
local.set 控制流: if/else call 7 类型定义 数据 1. enum Value { I32(Int) } // 只考虑32位有符号整数 指令 1. enum Instruction { 2. Const(Int) // 常数 3. Add; Sub; Modulo; Equal // // 函数调⽤ 5. Local_Get(String); Local_Set(String) // 取值、设值 6. If(Int, List[Instruction], List[Instruction]) // 条件判断 7. } 8 类型定义 函数 1. struct Function { 2. name : String 3. // 只考虑⼀种数据 称和数量 4. params : List[String]; result : Int; locals : List[String] 5. instructions : List[Instruction] 6. } 程序 1. struct Program { 2. functions : List[Function] 3. start : Option[String] 4. }0 码力 | 31 页 | 594.38 KB | 1 年前3
 The Zig Programming Language 0.12.0 Documentationthe stack memory: stack_trace_struct.zig pub const StackTrace = struct { index: usize, instruction_addresses: [N]usize, }; Here, N is the maximum function call depth as determined by call graph "no-inline" in LLVM IR fn __zig_return_error(stack_trace: *StackTrace) void { stack_trace.instruction_addresses[stack_trace.index] = @returnAddress(); stack_trace.index = (stack_trace.index + 1) actually zero. What is a return statement in code without error return tracing can become a jump instruction in code with error return tracing. Optionals One area that Zig provides safety without compromising0 码力 | 241 页 | 7.37 MB | 1 年前3 The Zig Programming Language 0.12.0 Documentationthe stack memory: stack_trace_struct.zig pub const StackTrace = struct { index: usize, instruction_addresses: [N]usize, }; Here, N is the maximum function call depth as determined by call graph "no-inline" in LLVM IR fn __zig_return_error(stack_trace: *StackTrace) void { stack_trace.instruction_addresses[stack_trace.index] = @returnAddress(); stack_trace.index = (stack_trace.index + 1) actually zero. What is a return statement in code without error return tracing can become a jump instruction in code with error return tracing. Optionals One area that Zig provides safety without compromising0 码力 | 241 页 | 7.37 MB | 1 年前3
 The Zig Programming Language 0.5.0 Documentationvector is a group of Integers, Floats, or Pointers which are operated on in parallel using a single instruction (SIMD). Vector types are created with the builtin function @Vector. TODO talk about C ABI interop initialize this struct in the stack memory: pub const StackTrace = struct { index: usize, instruction_addresses: [N]usize, }; Here, N is the maximum function call depth as determined by call graph "no-inline" in LLVM IR fn __zig_return_error(stack_trace: *StackTrace) void { stack_trace.instruction_addresses[stack_trace.index] = @returnAddres stack_trace.index = (stack_trace.index + 1) %0 码力 | 224 页 | 5.80 MB | 1 年前3 The Zig Programming Language 0.5.0 Documentationvector is a group of Integers, Floats, or Pointers which are operated on in parallel using a single instruction (SIMD). Vector types are created with the builtin function @Vector. TODO talk about C ABI interop initialize this struct in the stack memory: pub const StackTrace = struct { index: usize, instruction_addresses: [N]usize, }; Here, N is the maximum function call depth as determined by call graph "no-inline" in LLVM IR fn __zig_return_error(stack_trace: *StackTrace) void { stack_trace.instruction_addresses[stack_trace.index] = @returnAddres stack_trace.index = (stack_trace.index + 1) %0 码力 | 224 页 | 5.80 MB | 1 年前3
 The Zig Programming Language 0.11.0 Documentationmemory: stack_trace_struct.zig 1 pub const StackTrace = struct { 2 index: usize, 3 instruction_addresses: [N]usize, 4 }; Here, N is the maximum function call depth as determined by call graph "no-inline" in LLVM IR 2 fn __zig_return_error(stack_trace: *StackTrace) void { 3 stack_trace.instruction_addresses[stack_trace.index] = @returnAddress(); 4 stack_trace.index = (stack_trace.index actually zero. What is a return statement in code without error return tracing can become a jump instruction in code with error return tracing. 29. Optionals One area that Zig provides safety without compromising0 码力 | 238 页 | 7.80 MB | 1 年前3 The Zig Programming Language 0.11.0 Documentationmemory: stack_trace_struct.zig 1 pub const StackTrace = struct { 2 index: usize, 3 instruction_addresses: [N]usize, 4 }; Here, N is the maximum function call depth as determined by call graph "no-inline" in LLVM IR 2 fn __zig_return_error(stack_trace: *StackTrace) void { 3 stack_trace.instruction_addresses[stack_trace.index] = @returnAddress(); 4 stack_trace.index = (stack_trace.index actually zero. What is a return statement in code without error return tracing can become a jump instruction in code with error return tracing. 29. Optionals One area that Zig provides safety without compromising0 码力 | 238 页 | 7.80 MB | 1 年前3
 The Zig Programming Language 0.7.1 Documentationgroup of booleans, Integers, Floats, or Pointers which are operated on in parallel using a single instruction (SIMD). Vector types are created with the builtin function @Type, or using the shorthand as std initialize this struct in the stack memory: pub const StackTrace = struct { index: usize, instruction_addresses: [N]usize, }; Here, N is the maximum function call depth as determined by call graph "no-inline" in LLVM IR fn __zig_return_error(stack_trace: *StackTrace) void { stack_trace.instruction_addresses[stack_trace.index] = @returnAd stack_trace.index = (stack_trace.index + 1) % N; }0 码力 | 225 页 | 5.74 MB | 1 年前3 The Zig Programming Language 0.7.1 Documentationgroup of booleans, Integers, Floats, or Pointers which are operated on in parallel using a single instruction (SIMD). Vector types are created with the builtin function @Type, or using the shorthand as std initialize this struct in the stack memory: pub const StackTrace = struct { index: usize, instruction_addresses: [N]usize, }; Here, N is the maximum function call depth as determined by call graph "no-inline" in LLVM IR fn __zig_return_error(stack_trace: *StackTrace) void { stack_trace.instruction_addresses[stack_trace.index] = @returnAd stack_trace.index = (stack_trace.index + 1) % N; }0 码力 | 225 页 | 5.74 MB | 1 年前3
 The Zig Programming Language 0.6.0 Documentationvector is a group of Integers, Floats, or Pointers which are operated on in parallel using a single instruction (SIMD). Vector types are created with the builtin function @Vector. TODO talk about C ABI interop initialize this struct in the stack memory: pub const StackTrace = struct { index: usize, instruction_addresses: [N]usize, }; Here, N is the maximum function call depth as determined by call graph "no-inline" in LLVM IR fn __zig_return_error(stack_trace: *StackTrace) void { stack_trace.instruction_addresses[stack_trace.index] = @returnAd stack_trace.index = (stack_trace.index + 1) % N; }0 码力 | 214 页 | 5.37 MB | 1 年前3 The Zig Programming Language 0.6.0 Documentationvector is a group of Integers, Floats, or Pointers which are operated on in parallel using a single instruction (SIMD). Vector types are created with the builtin function @Vector. TODO talk about C ABI interop initialize this struct in the stack memory: pub const StackTrace = struct { index: usize, instruction_addresses: [N]usize, }; Here, N is the maximum function call depth as determined by call graph "no-inline" in LLVM IR fn __zig_return_error(stack_trace: *StackTrace) void { stack_trace.instruction_addresses[stack_trace.index] = @returnAd stack_trace.index = (stack_trace.index + 1) % N; }0 码力 | 214 页 | 5.37 MB | 1 年前3
 The Zig Programming Language 0.8.1 Documentationgroup of booleans, Integers, Floats, or Pointers which are operated on in parallel using a single instruction (SIMD). Vector types are created with the builtin function @Type, or using the shorthand as std initialize this struct in the stack memory: pub const StackTrace = struct { index: usize, instruction_addresses: [N]usize, }; Here, N is the maximum function call depth as determined by call graph "no-inline" in LLVM IR fn __zig_return_error(stack_trace: *StackTrace) void { stack_trace.instruction_addresses[stack_trace.index] = @returnAd stack_trace.index = (stack_trace.index + 1) % N; }0 码力 | 234 页 | 6.01 MB | 1 年前3 The Zig Programming Language 0.8.1 Documentationgroup of booleans, Integers, Floats, or Pointers which are operated on in parallel using a single instruction (SIMD). Vector types are created with the builtin function @Type, or using the shorthand as std initialize this struct in the stack memory: pub const StackTrace = struct { index: usize, instruction_addresses: [N]usize, }; Here, N is the maximum function call depth as determined by call graph "no-inline" in LLVM IR fn __zig_return_error(stack_trace: *StackTrace) void { stack_trace.instruction_addresses[stack_trace.index] = @returnAd stack_trace.index = (stack_trace.index + 1) % N; }0 码力 | 234 页 | 6.01 MB | 1 年前3
 The Zig Programming Language 0.9.1 Documentationmemory: stack_trace_struct.zig 1 pub const StackTrace = struct { 2 index: usize, 3 instruction_addresses: [N]usize, 4 }; Here, N is the maximum function call depth as determined by call graph "no-inline" in LLVM IR 2 fn __zig_return_error(stack_trace: *StackTrace) void { 3 stack_trace.instruction_addresses[stack_trace.index] = @returnAddress(); 4 stack_trace.index = (stack_trace.index actually zero. What is a return statement in code without error return tracing can become a jump instruction in code with error return tracing. Optionals One area that Zig provides safety without compromising0 码力 | 234 页 | 7.90 MB | 1 年前3 The Zig Programming Language 0.9.1 Documentationmemory: stack_trace_struct.zig 1 pub const StackTrace = struct { 2 index: usize, 3 instruction_addresses: [N]usize, 4 }; Here, N is the maximum function call depth as determined by call graph "no-inline" in LLVM IR 2 fn __zig_return_error(stack_trace: *StackTrace) void { 3 stack_trace.instruction_addresses[stack_trace.index] = @returnAddress(); 4 stack_trace.index = (stack_trace.index actually zero. What is a return statement in code without error return tracing can become a jump instruction in code with error return tracing. Optionals One area that Zig provides safety without compromising0 码力 | 234 页 | 7.90 MB | 1 年前3
 The Zig Programming Language 0.10.1 Documentationmemory: stack_trace_struct.zig 1 pub const StackTrace = struct { 2 index: usize, 3 instruction_addresses: [N]usize, 4 }; Here, N is the maximum function call depth as determined by call graph "no-inline" in LLVM IR 2 fn __zig_return_error(stack_trace: *StackTrace) void { 3 stack_trace.instruction_addresses[stack_trace.index] = @returnAddress(); 4 stack_trace.index = (stack_trace.index actually zero. What is a return statement in code without error return tracing can become a jump instruction in code with error return tracing. Optionals One area that Zig provides safety without compromising0 码力 | 239 页 | 8.03 MB | 1 年前3 The Zig Programming Language 0.10.1 Documentationmemory: stack_trace_struct.zig 1 pub const StackTrace = struct { 2 index: usize, 3 instruction_addresses: [N]usize, 4 }; Here, N is the maximum function call depth as determined by call graph "no-inline" in LLVM IR 2 fn __zig_return_error(stack_trace: *StackTrace) void { 3 stack_trace.instruction_addresses[stack_trace.index] = @returnAddress(); 4 stack_trace.index = (stack_trace.index actually zero. What is a return statement in code without error return tracing can become a jump instruction in code with error return tracing. Optionals One area that Zig provides safety without compromising0 码力 | 239 页 | 8.03 MB | 1 年前3
 The Zig Programming Language 0.4.0 Documentationvector is a group of Integers, Floats, or Pointers which are operated on in parallel using a single instruction (SIMD). Vector types are created with the builtin function @Vector. TODO talk about C ABI interop initialize this struct in the stack memory: pub const StackTrace = struct { index: usize, instruction_addresses: [N]usize, }; Here, N is the maximum function call depth as determined by call graph "no-inline" in LLVM IR fn __zig_return_error(stack_trace: *StackTrace) void { stack_trace.instruction_addresses[stack_trace.index] = @returnAddres stack_trace.index = (stack_trace.index + 1) %0 码力 | 207 页 | 5.29 MB | 1 年前3 The Zig Programming Language 0.4.0 Documentationvector is a group of Integers, Floats, or Pointers which are operated on in parallel using a single instruction (SIMD). Vector types are created with the builtin function @Vector. TODO talk about C ABI interop initialize this struct in the stack memory: pub const StackTrace = struct { index: usize, instruction_addresses: [N]usize, }; Here, N is the maximum function call depth as determined by call graph "no-inline" in LLVM IR fn __zig_return_error(stack_trace: *StackTrace) void { stack_trace.instruction_addresses[stack_trace.index] = @returnAddres stack_trace.index = (stack_trace.index + 1) %0 码力 | 207 页 | 5.29 MB | 1 年前3
共 33 条
- 1
- 2
- 3
- 4














