clang-format

This commit is contained in:
Georgii Rylov
2025-01-27 11:31:02 +00:00
parent d0c6da10ff
commit 1f4d3dd4d4
7 changed files with 93 additions and 74 deletions

View File

@ -4104,37 +4104,41 @@ aot_frame_update_profile_info(WASMExecEnv *exec_env, bool alloc_frame)
#endif /* end of WASM_ENABLE_AOT_STACK_FRAME != 0 */
#if WASM_ENABLE_DUMP_CALL_STACK != 0
void
aot_iterate_callstack(WASMExecEnv *exec_env, const wasm_frame_callback frame_handler, void* user_data)
void
aot_iterate_callstack(WASMExecEnv *exec_env,
const wasm_frame_callback frame_handler, void *user_data)
{
/*
* Note for devs: please refrain from such modifications inside of aot_iterate_callstack
* - any allocations/freeing memory
* - dereferencing any pointers other than: exec_env, exec_env->module_inst,
* exec_env->module_inst->module, pointers between stack's bottom and top_boundary
* For more details check wasm_iterate_callstack in wasm_export.h
*/
/*
* Note for devs: please refrain from such modifications inside of
* aot_iterate_callstack
* - any allocations/freeing memory
* - dereferencing any pointers other than: exec_env, exec_env->module_inst,
* exec_env->module_inst->module, pointers between stack's bottom and
* top_boundary For more details check wasm_iterate_callstack in
* wasm_export.h
*/
if (!is_tiny_frame(exec_env)) {
//TODO: support standard frames
// TODO: support standard frames
return;
}
uint8* top_boundary = exec_env->wasm_stack.top_boundary;
uint8* top = exec_env->wasm_stack.top;
uint8* bottom = exec_env->wasm_stack.bottom;
uint8 *top_boundary = exec_env->wasm_stack.top_boundary;
uint8 *top = exec_env->wasm_stack.top;
uint8 *bottom = exec_env->wasm_stack.bottom;
bool is_top_index_in_range = top_boundary >= top && top >= (bottom + sizeof(AOTTinyFrame));
bool is_top_index_in_range =
top_boundary >= top && top >= (bottom + sizeof(AOTTinyFrame));
if (!is_top_index_in_range) {
return;
}
bool is_top_aligned_with_bottom = (unsigned long)(top - bottom) % sizeof(AOTTinyFrame) == 0;
bool is_top_aligned_with_bottom =
(unsigned long)(top - bottom) % sizeof(AOTTinyFrame) == 0;
if (!is_top_aligned_with_bottom) {
return;
}
AOTTinyFrame* frame = (AOTTinyFrame*)(top - sizeof(AOTTinyFrame));
AOTTinyFrame *frame = (AOTTinyFrame *)(top - sizeof(AOTTinyFrame));
WASMCApiFrame record_frame;
while (frame &&
(uint8_t*)frame >= bottom) {
while (frame && (uint8_t *)frame >= bottom) {
record_frame.instance = exec_env->module_inst;
record_frame.module_offset = 0;
record_frame.func_index = frame->func_index;