/***************************************************************************/
/* */
/* ttinterp.c */
/* */
/* TrueType bytecode interpreter (body). */
/* */
/* Copyright 1996-2012 */
/* by David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/* Greg Hitchcock from Microsoft has helped a lot in resolving unclear */
/* issues; many thanks! */
#include "ft2build.h"
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_CALC_H
#include FT_TRIGONOMETRY_H
#include FT_SYSTEM_H
#include "ttinterp.h"
#include "tterrors.h"
#ifdef TT_USE_BYTECODE_INTERPRETER
#define TT_MULFIX FT_MulFix
#define TT_MULDIV FT_MulDiv
#define TT_MULDIV_NO_ROUND FT_MulDiv_No_Round
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
/* messages during execution. */
/* */
#undef FT_COMPONENT
#define FT_COMPONENT trace_ttinterp
/*************************************************************************/
/* */
/* In order to detect infinite loops in the code, we set up a counter */
/* within the run loop. A single stroke of interpretation is now */
/* limited to a maximal number of opcodes defined below. */
/* */
#define MAX_RUNNABLE_OPCODES 1000000L
/*************************************************************************/
/* */
/* There are two kinds of implementations: */
/* */
/* a. static implementation */
/* */
/* The current execution context is a static variable, which fields */
/* are accessed directly by the interpreter during execution. The */
/* context is named `cur'. */
/* */
/* This version is non-reentrant, of course. */
/* */
/* b. indirect implementation */
/* */
/* The current execution context is passed to _each_ function as its */
/* first argument, and each field is thus accessed indirectly. */
/* */
/* This version is fully re-entrant. */
/* */
/* The idea is that an indirect implementation may be slower to execute */
/* on low-end processors that are used in some systems (like 386s or */
/* even 486s). */
/* */
/* As a consequence, the indirect implementation is now the default, as */
/* its performance costs can be considered negligible in our context. */
/* Note, however, that we kept the same source with macros because: */
/* */
/* - The code is kept very close in design to the Pascal code used for */
/* development. */
/* */
/* - It's much more readable that way! */
/* */
/* - It's still open to experimentation and tuning. */
/* */
/*************************************************************************/
#ifndef TT_CONFIG_OPTION_STATIC_INTERPRETER /* indirect implementation */
#define CUR (*exc) /* see ttobjs.h */
/*************************************************************************/
/* */
/* This macro is used whenever `exec' is unused in a function, to avoid */
/* stupid warnings from pedantic compilers. */
/* */
#define FT_UNUSED_EXEC FT_UNUSED( exc )
#else /* static implementation */
#define CUR cur
#define FT_UNUSED_EXEC int __dummy = __dummy
static
TT_ExecContextRec cur; /* static exec. context variable */
/* apparently, we have a _lot_ of direct indexing when accessing */
/* the static `cur', which makes the code bigger (due to all the */
/* four bytes addresses). */
#endif /* TT_CONFIG_OPTION_STATIC_INTERPRETER */
/*************************************************************************/
/* */
/* The instruction argument stack. */
/* */
#define INS_ARG EXEC_OP_ FT_Long* args /* see ttobjs.h for EXEC_OP_ */
/*************************************************************************/
/* */
/* This macro is used whenever `args' is unused in a function, to avoid */
/* stupid warnings from pedantic compilers. */
/* */
#define FT_UNUSED_ARG FT_UNUSED_EXEC; FT_UNUSED( args )
/*************************************************************************/
/* */
/* The following macros hide the use of EXEC_ARG and EXEC_ARG_ to */
/* increase readability of the code. */
/* */
/*************************************************************************/
#define SKIP_Code() \
SkipCode( EXEC_ARG )
#define GET_ShortIns() \
GetShortIns( EXEC_ARG )
#define NORM
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
一个优雅的开源跨平台3D引擎,包含Foundations,3DMAXPlugin,Editor.zip (2000个子文件)
ttinterp.c 261KB
url.c 175KB
pngrtran.c 165KB
ftp.c 134KB
ftobjs.c 128KB
pngrutil.c 120KB
ftraster.c 117KB
http.c 112KB
ttcmap.c 104KB
ssh.c 103KB
png.c 91KB
pngwutil.c 90KB
cffgload.c 88KB
multi.c 85KB
ssluse.c 80KB
curl_darwinssl.c 75KB
imap.c 72KB
aflatin.c 70KB
aflatin2.c 69KB
ttgload.c 67KB
afcjk.c 66KB
ftstroke.c 65KB
transfer.c 63KB
pshalgo.c 60KB
smtp.c 60KB
ftgrays.c 59KB
pop3.c 58KB
ttgxvar.c 55KB
ttsbit.c 53KB
pngwrite.c 50KB
t1decode.c 50KB
nss.c 47KB
psobjs.c 47KB
ttload.c 47KB
cffload.c 46KB
curl_schannel.c 46KB
formdata.c 45KB
telnet.c 45KB
ttobjs.c 43KB
tftp.c 40KB
sfobjs.c 39KB
pngread.c 38KB
cookie.c 37KB
pngset.c 36KB
connect.c 36KB
lparser.c 36KB
pngpread.c 36KB
gtls.c 34KB
x509asn1.c 34KB
cffobjs.c 33KB
afhints.c 32KB
pshrec.c 32KB
ftplistparser.c 32KB
easy.c 31KB
gskit.c 31KB
example.c 31KB
cffparse.c 30KB
pngget.c 30KB
curl_ntlm_msgs.c 29KB
ftoutln.c 29KB
mprintf.c 28KB
strerror.c 26KB
ttsbit0.c 26KB
ftrfork.c 26KB
pfrload.c 25KB
ftbbox.c 25KB
ftdbgmem.c 24KB
rtsp.c 24KB
socks.c 24KB
hostip.c 24KB
ftcbasic.c 23KB
lstrlib.c 23KB
lvm.c 23KB
pngtrans.c 22KB
lapi.c 22KB
afmparse.c 22KB
socks_sspi.c 22KB
cffdrivr.c 22KB
http_proxy.c 21KB
ftcalc.c 21KB
axtls.c 21KB
lcode.c 21KB
pngerror.c 20KB
polarssl.c 20KB
ttpload.c 20KB
curl_sasl.c 20KB
lgc.c 20KB
socks_gssapi.c 20KB
ftstream.c 19KB
asyn-ares.c 19KB
sendf.c 19KB
loadlib.c 19KB
sslgen.c 19KB
afloader.c 18KB
cyassl.c 18KB
ttdriver.c 18KB
pngwtran.c 17KB
pngmem.c 17KB
ftglyph.c 17KB
sfdriver.c 17KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
博士僧小星
- 粉丝: 1762
- 资源: 5875
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功