- 27
- 0
- 约2.41万字
- 约 91页
- 2016-12-07 发布于湖北
- 举报
Chapter 7 Runtime Environments 一个程序要运行,至少应有这样两个存储空间: (1) 代码空间这是经翻译后生成的目标代码的存储区域,线性存放着目标指令序列。对三地址代码来说,当前执行的指令位置由指令指针ip指示。因此,只要将ip指向程序的第一个语句,程序便处于开始执行的状态,以后每执行一个语句,ip便加4(我们约定,三地址代码的每个语句占4个字节),指向下个语句。要改变程序控制顺序,只要将转向点赋给ip即可。 (2) 数据空间每个程序都定义一定数量的各种类型的变量和常数,翻译程序必须为之分配相应的存储空间。初等类型的数据,如逻辑、整型、实型变量,通常以存储器的基本存储单元如字节、字、双字来存储。 Chapter 7 Runtime Environments 7.1 Source Language Issues Program vs program execution A program consists of several procedures (functions) An execution of a program is called as a process An execution of a program would cause the activation of the related procedures A name (e.g, a variable name)in a procedure would be related to different data objects Notes: An activation may manipulate data objects allocated for its use. Chapter 7 Runtime Environments 7.1 Source Language Issues Allocation and de-allocation of data objects Managed by the run-time support package Allocation of a data object is just to allocate storage space to the data object relating to the name in the procedure Notes: The representation of a data object at run time is determined by its type. Chapter 7 Runtime Environments 7.1 Source Language Issues A procedure is activated when called The lifetime of an activation of a procedure is the sequence of steps between the first and last steps in the execution of the procedure body A procedure is recursive if a new activation can begin before an earlier activation of the same procedure has ended Chapter 7 Runtime Environments 7.1 Source Language Issues 3.Activation Trees A tree to depict the control flow enters and leaves activation of a procedure f(4) f(3) f(2) f(2) f(1) f(1) f(0) f(1) f(0) Procedure Activations: Example Activation Trees: Example Chapter 7 Runtime Environments 7.1 Source Language Issues 4.Control stacks A stack to keep track of live procedure activations Chapter 7 Runtime Environments 7.1 Source Language Issues Control Stack Scope R
您可能关注的文档
- 山东省武城县二中2015-2016学年高一上学期第二次月考地理试卷.doc
- 山东省枣庄市峄城区吴林街道中学九年级物理全册 17 欧姆定律复习教案 (新版)新人教版.doc
- 就任北京大学校长的演说 边疆.ppt
- 山东省淄博市六中2015-2016学年高二历史上学期期中学分认定模块考试试题(含解析).doc
- 山区段专项施工方案.doc
- 山水宜城物业服务方案.doc
- 珠宝行业--电子商务的资源整合与资本分解.ppt
- 家畜环卫学:畜禽舍建筑结构设计与类型选择.ppt
- 如何细节描写.pptx
- 山西海创基础工程方案(终极).doc
- (2026春新版)部编版八年级语文下册《第一单元》PPT课件.pptx
- 2018电力监控系统网络安全监测装置技术规范.docx
- 2022电力监控系统安全防护方案审核要点.docx
- 2014电力电缆光伏系统EN 50618欧标.docx
- (2026春新版)人教版二年级数学下册《第三单元 万以内数的认识》教案.docx
- (2026春新版)人教版二年级数学下册《第四单元 万以内的加法和减法》教案.docx
- (2026春新版)人教版二年级数学下册《综合与实践 时间在哪里》教案.docx
- (2026春新版)苏教版二年级数学下册《综合与实践 时间有多长》教案 .pdf
- (2026春新版)部编版三年级语文下册第3单元(教案).docx
- (2026春新版)部编版三年级语文下册第8单元(教案).docx
原创力文档

文档评论(0)