tamarin中interpter的一点分析
来源:互联网 发布:韦德历届总决赛数据 编辑:程序博客网 时间:2024/06/05 00:49
#ifdef AVMPLUS_WORD_CODE
# if defined AVMPLUS_DIRECT_THREADED //可以直接线程化
# if defined GNUC_THREADING // linux下的宏
# define INSTR(op) L_##op: VERBOSE; 放置虚拟指令标签
# define NEXT goto *(*pc++)
# elif defined MSVC_X86_REWRITE_THREADING //switch和标签相结合
# define INSTR(op) case WOP_##op: L_ ## op: VERBOSE;
# define NEXT continue
# elif defined MSVC_X86_ASM_THREADING //直接分发,要对abc码预处理
# define INSTR(op) L_ ## op: VERBOSE;
# define NEXT __asm { \
__asm mov ebx, pc \ //pc指向的是指令的地址
__asm mov eax, [ebx] \
__asm add ebx, 4 \
__asm mov pc, ebx \
__asm jmp eax \
}
# endif // threading discipline
# else // AVMPLUS_DIRECT_THREADED
# define INSTR(op) case WOP_##op: VERBOSE;
# define NEXT continue
# endif
# define U30ARG (*pc++)
# define U8ARG (*pc++)
# define S24ARG (intptr_t)(*pc++)
# ifdef DEBUGGER
// expc is visible outside this function, so make sure it's correct.
// It's probably possible to adjust it on demand outside the function too,
// because code that accesses it will have access to "info" and can
// perform the adjustment.
# define SAVE_EXPC expc = pc-1-info->word_code_start()
# define SAVE_EXPC_S24 expc = pc-2-info->word_code_start()
# else
// Adjusted on demand in the CATCH clause. Reduces size of interpreter function
// by 2.5KB of object code (x86 / gcc4.0 / -O3).
# define SAVE_EXPC expc = (intptr_t)pc
# define SAVE_EXPC_S24 expc = (intptr_t)(pc-1)
# endif
#else // !AVMPLUS_WORD_CODE
# define INSTR(op) case OP_##op: VERBOSE;
# define NEXT continue
# define U30ARG (tmp_pc=pc, tmp_u30 = uint32_t(readU30(tmp_pc)), pc = tmp_pc, tmp_u30)
# define U8ARG (*pc++)
# define S24ARG (pc+=3, readS24(pc-3))
# define SAVE_EXPC expc = pc-1-codeStart
# define SAVE_EXPC_S24 expc = pc-4-codeStart
#endif // AVMPLUS_WORD_CODE
# if defined AVMPLUS_DIRECT_THREADED //可以直接线程化
# if defined GNUC_THREADING // linux下的宏
# define INSTR(op) L_##op: VERBOSE; 放置虚拟指令标签
# define NEXT goto *(*pc++)
# elif defined MSVC_X86_REWRITE_THREADING //switch和标签相结合
# define INSTR(op) case WOP_##op: L_ ## op: VERBOSE;
# define NEXT continue
# elif defined MSVC_X86_ASM_THREADING //直接分发,要对abc码预处理
# define INSTR(op) L_ ## op: VERBOSE;
# define NEXT __asm { \
__asm mov ebx, pc \ //pc指向的是指令的地址
__asm mov eax, [ebx] \
__asm add ebx, 4 \
__asm mov pc, ebx \
__asm jmp eax \
}
# endif // threading discipline
# else // AVMPLUS_DIRECT_THREADED
# define INSTR(op) case WOP_##op: VERBOSE;
# define NEXT continue
# endif
# define U30ARG (*pc++)
# define U8ARG (*pc++)
# define S24ARG (intptr_t)(*pc++)
# ifdef DEBUGGER
// expc is visible outside this function, so make sure it's correct.
// It's probably possible to adjust it on demand outside the function too,
// because code that accesses it will have access to "info" and can
// perform the adjustment.
# define SAVE_EXPC expc = pc-1-info->word_code_start()
# define SAVE_EXPC_S24 expc = pc-2-info->word_code_start()
# else
// Adjusted on demand in the CATCH clause. Reduces size of interpreter function
// by 2.5KB of object code (x86 / gcc4.0 / -O3).
# define SAVE_EXPC expc = (intptr_t)pc
# define SAVE_EXPC_S24 expc = (intptr_t)(pc-1)
# endif
#else // !AVMPLUS_WORD_CODE
# define INSTR(op) case OP_##op: VERBOSE;
# define NEXT continue
# define U30ARG (tmp_pc=pc, tmp_u30 = uint32_t(readU30(tmp_pc)), pc = tmp_pc, tmp_u30)
# define U8ARG (*pc++)
# define S24ARG (pc+=3, readS24(pc-3))
# define SAVE_EXPC expc = pc-1-codeStart
# define SAVE_EXPC_S24 expc = pc-4-codeStart
#endif // AVMPLUS_WORD_CODE
- tamarin中interpter的一点分析
- 在Tamarin中 3D Touch 的使用
- Tamarin
- tamarin
- Launcher3中Folder的一点分析
- [tamarin系列之9] 在线的eval
- irq 的一点分析
- 关于C/C++中指针做形参的一点小分析
- 应用软件开发过程中设计需求分析的一点体会
- [tamarin系列之4] 构建专用的avmshell
- [tamarin系列之8] 配合as3eval的as3c
- 三层架构的一点分析
- security cookie的一点分析
- 关于 include 的一点分析
- 软件分析的一点心得
- 源码分析的一点感悟
- nDPI源码的一点分析
- 关于ip_finish_output2的一点分析
- 页面局部刷新( ScriptManager 和 UpdatePanel)(转)
- 正则表达式
- HttpWatch工具简介及使用
- VB 总结
- Android 保存浏览记录 SharedPreTools
- tamarin中interpter的一点分析
- iOS开发资源:Helios、THLabel以及AGi18n等
- Effective C++ 读书笔记之Part8.Customizing new and delete
- datetimepicker标签
- 第四章 Django模板系统
- 勇敢的跟孩子谈钱:生活中的财商课
- 如何修改表空间数据文件路径
- php+mysql计算某个已知经纬度周围几公里数据查询处理方法
- 改进iOS客户端的升级提醒功能