Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions definitions/src/generate_asm_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::mem::{size_of, zeroed};
macro_rules! print_inst_label {
($name:ident, $real_name:ident, $code:expr) => {
println!(
"\t.long\t.CKB_VM_ASM_LABEL_OP_{} - .CKB_VM_X64_EXECUTE",
"\t.long\t.CKB_VM_ASM_LABEL_OP_{} - .CKB_VM_ASM_EXECUTE",
stringify!($real_name)
);
};
Expand Down Expand Up @@ -239,7 +239,7 @@ fn main() {
println!("#endif");
println!(".CKB_VM_ASM_LABEL_TABLE:");
for _ in 0..0x10 {
println!("\t.long\t.exit_slowpath - .CKB_VM_X64_EXECUTE");
println!("\t.long\t.exit_slowpath - .CKB_VM_ASM_EXECUTE");
}
for_each_inst!(print_inst_label);
println!("#endif /* CKB_VM_ASM_GENERATE_LABEL_TABLES */");
Expand Down
348 changes: 174 additions & 174 deletions src/machine/asm/cdefinitions_generated.h

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/machine/asm/execute_aarch64.S
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,13 @@

.p2align 3
#ifdef __APPLE__
.globl _ckb_vm_x64_execute
_ckb_vm_x64_execute:
.globl _ckb_vm_asm_execute
_ckb_vm_asm_execute:
#else
.globl ckb_vm_x64_execute
ckb_vm_x64_execute:
.globl ckb_vm_asm_execute
ckb_vm_asm_execute:
#endif
.CKB_VM_X64_EXECUTE:
.CKB_VM_ASM_EXECUTE:
stp x19, x20, [sp, -96]!
stp x21, x22, [sp, 16]
stp x23, x24, [sp, 32]
Expand Down
6 changes: 3 additions & 3 deletions src/machine/asm/execute_riscv64.S
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@
LOAD_REGISTER_ADDRESS(RS3, tmp1); \
sd reg1, CKB_VM_ASM_ASM_CORE_MACHINE_OFFSET_REGISTERS(tmp1)

.globl ckb_vm_x64_execute
ckb_vm_x64_execute:
.CKB_VM_X64_EXECUTE:
.globl ckb_vm_asm_execute
ckb_vm_asm_execute:
.CKB_VM_ASM_EXECUTE:
addi sp, sp, -64
sd ra, 0(sp)
sd s0, 8(sp)
Expand Down
10 changes: 5 additions & 5 deletions src/machine/asm/execute_x64.S
Original file line number Diff line number Diff line change
Expand Up @@ -413,13 +413,13 @@
movzbl %ch, RS4_TEMP1d

#ifdef __APPLE__
.globl _ckb_vm_x64_execute
_ckb_vm_x64_execute:
.globl _ckb_vm_asm_execute
_ckb_vm_asm_execute:
#else
.globl ckb_vm_x64_execute
ckb_vm_x64_execute:
.globl ckb_vm_asm_execute
ckb_vm_asm_execute:
#endif
.CKB_VM_X64_EXECUTE:
.CKB_VM_ASM_EXECUTE:
#ifdef IS_WINDOWS
push %rsi
push %rdi
Expand Down
6 changes: 3 additions & 3 deletions src/machine/asm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ where
}

unsafe extern "C" {
pub fn ckb_vm_x64_execute(m: *mut AsmCoreMachine, d: *const InvokeData) -> c_uchar;
pub fn ckb_vm_asm_execute(m: *mut AsmCoreMachine, d: *const InvokeData) -> c_uchar;
// We are keeping this as a function here, but at the bottom level this really
// just points to an array of assembly label offsets for each opcode.
pub fn ckb_vm_asm_labels();
Expand Down Expand Up @@ -771,7 +771,7 @@ impl<R: AsmCoreMachineRevealer, D: TraceDecoder> DefaultMachineRunner for Abstra
fixed_traces: decoder.fixed_traces(),
fixed_trace_mask: decoder.fixed_trace_size().wrapping_sub(1),
};
ckb_vm_x64_execute(&mut *self.machine.inner_mut().as_mut(), &data as *const _)
ckb_vm_asm_execute(&mut *self.machine.inner_mut().as_mut(), &data as *const _)
};
match result {
RET_DECODE_TRACE => decoder.prepare_traces(&mut self.machine)?,
Expand Down Expand Up @@ -840,7 +840,7 @@ impl<R: AsmCoreMachineRevealer, D: TraceDecoder> AbstractAsmMachine<R, D> {
fixed_traces: &trace as *const FixedTrace,
fixed_trace_mask: 0,
};
ckb_vm_x64_execute(&mut *self.machine.inner_mut().as_mut(), &data as *const _)
ckb_vm_asm_execute(&mut *self.machine.inner_mut().as_mut(), &data as *const _)
};
match result {
RET_DECODE_TRACE => (),
Expand Down
4 changes: 2 additions & 2 deletions src/machine/asm/traces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
},
machine::{
CoreMachine, DefaultMachine,
asm::{AsmCoreMachineRevealer, ckb_vm_asm_labels, ckb_vm_x64_execute},
asm::{AsmCoreMachineRevealer, ckb_vm_asm_execute, ckb_vm_asm_labels},
},
memory::Memory,
};
Expand All @@ -37,7 +37,7 @@ pub fn label_from_fastpath_opcode(opcode: InstructionOpcode) -> u64 {
debug_assert!(!is_slowpath_instruction(blank_instruction(opcode)));
unsafe {
u64::from(*(ckb_vm_asm_labels as *const u32).offset(opcode as u8 as isize))
+ (ckb_vm_x64_execute as *const u32 as u64)
+ (ckb_vm_asm_execute as *const u32 as u64)
}
}

Expand Down
Loading