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
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3854,6 +3854,12 @@ if(EXISTS "${INTAKE_PYTHON}")
add_test(NAME cpu_aot_recursion COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/cpu/recursion_check.py" "$<TARGET_FILE:cpu_register_probe>"
"$<TARGET_FILE:cpu_recursion>" "$<TARGET_FILE:cpu_recursion_lifted>")
cpu_asm_fixture(cpu_stack_args stack_args)
# The exports from unset_slot on exist only to be refused; the test translates each alone.
cpu_translation(cpu_stack_args cpu_switch_aot call_six,call_seven,call_scratch,call_rec,call_eight,call_fill,call_edge,call_twelfth)
add_test(NAME cpu_aot_stack_arguments COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/cpu/stack_args_check.py" "$<TARGET_FILE:cpu_register_probe>"
"$<TARGET_FILE:cpu_stack_args>" "$<TARGET_FILE:cpu_stack_args_lifted>")
cpu_asm_fixture(cpu_call_entries call_entries)
cpu_translation(cpu_call_entries cpu_switch_aot entry_caller,entry_tail)
add_test(NAME cpu_aot_call_entries COMMAND "${INTAKE_PYTHON}" -B
Expand Down
10 changes: 7 additions & 3 deletions docs/experiments.md

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions tests/cpu/calls_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ def first_call(name):
raise AssertionError(f"no call in {name}")

rvas.update(leaf=first_call("call_leaf"), mid=first_call("chain3"), low=first_call("narrow_call"))
data = pe.get_data(rvas["chain3"], 64)
rvas["chain3_call"] = next(ins.ip for ins in Decoder(64, data, ip=rvas["chain3"])
if ins.flow_control == FlowControl.CALL)
return rvas


Expand Down Expand Up @@ -193,9 +196,9 @@ def check(probe_path, original_path, lifted_path):
# first call left undefined.
("call_leaf", [("call_leaf", 0x0d, "48 89 03 48 83 c0 01", ("call", "leaf"))], "callee argument rcx is undefined"),
("narrow_call", [("narrow_call", 0x0d, "0f b6 c0", "0f 94 c0")], "flags clobbered by the call"),
# mid_step reads the fifth-argument slot above its caller's home area.
# mid_step reads the fifth-argument slot above its caller's home area, where chain3 pushed RSI.
("chain3", [("mid", 0x11, "48 03 44 24 20", "48 03 44 24 50")],
"callee at RVA {mid:#x} refused: unsupported stack argument"),
"stack argument 5 of the call at RVA {chain3_call:#x} holds a saved register"),
# An unsupported instruction in leaf_mix refuses mid_step and with it chain3.
("chain3", [("leaf", 0x04, "48 03 c2", "0f a2 90")],
"callee at RVA {mid:#x} refused: callee at RVA {leaf:#x} refused: unsupported instruction"),
Expand Down
Loading
Loading