CS383 Programming Languages Quiz 5. 1. About runtime stack, which one is incorrect? a.The stack grows and shrinks as a process runs. b.The stack is used.

Slides:



Advertisements
Similar presentations
Introduction to Memory Management. 2 General Structure of Run-Time Memory.
Advertisements

Topic 10 Java Memory Management. 1-2 Memory Allocation in Java When a program is being executed, separate areas of memory are allocated for each class.
CSI 3120, Implementing subprograms, page 1 Implementing subprograms The environment in block-structured languages The structure of the activation stack.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /17/2013 Lecture 12: Procedures Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE CENTRAL.
Procedures II (1) Fall 2005 Lecture 07: Procedure Calls (Part 2)
Lecture 10: Heap Management CS 540 GMU Spring 2009.
Prof. Necula CS 164 Lecture 141 Run-time Environments Lecture 8.
Garbage Collection CSCI 2720 Spring Static vs. Dynamic Allocation Early versions of Fortran –All memory was static C –Mix of static and dynamic.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 18.
Chapter 8 Runtime Support. How program structures are implemented in a computer memory? The evolution of programming language design has led to the creation.
Stacks and HeapsCS-3013 A-term A Short Digression on Stacks and Heaps CS-3013 Operating Systems A-term 2008 (Slides include materials from Modern.
Digression on Stack and Heaps CS-502 (EMC) Fall A Short Digression on Stacks and Heaps CS-502, Operating Systems Fall 2009 (EMC) (Slides include.
Memory Allocation. Three kinds of memory Fixed memory Stack memory Heap memory.
CS 536 Spring Run-time organization Lecture 19.
3/17/2008Prof. Hilfinger CS 164 Lecture 231 Run-time organization Lecture 23.
Runtime Environments Source language issues Storage organization
Run-Time Storage Organization
Intro to Computer Architecture
1 Pertemuan 20 Run-Time Environment Matakuliah: T0174 / Teknik Kompilasi Tahun: 2005 Versi: 1/6.
Run time vs. Compile time
An Adaptive, Region-based Allocator for Java Feng Qian & Laurie Hendren 2002.
Run-time Environment and Program Organization
1 Run time vs. Compile time The compiler must generate code to handle issues that arise at run time Representation of various data types Procedure linkage.
Digression: the “Stack” 1 CS502 Spring 2006 Digression: the “Stack” Imagine the following program:– int factorial(int n){ if (n
Stacks and HeapsCS-502 Fall A Short Digression Stacks and Heaps CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System.
1 Memory Model of A Program, Methods Overview l Memory Model of JVM »Method Area »Heap »Stack.
1 Contents. 2 Run-Time Storage Organization 3 Static Allocation In many early languages, notably assembly and FORTRAN, all storage allocation is static.
Recursion and Implementation of Functions
COP4020 Programming Languages
Chapter 7: Runtime Environment –Run time memory organization. We need to use memory to store: –code –static data (global variables) –dynamic data objects.
CS3012: Formal Languages and Compilers The Runtime Environment After the analysis phases are complete, the compiler must generate executable code. The.
13/02/2009CA&O Lecture 04 by Engr. Umbreen Sabir Computer Architecture & Organization Instructions: Language of Computer Engr. Umbreen Sabir Computer Engineering.
Runtime Environments Compiler Construction Chapter 7.
Chapter 5: Programming Languages and Constructs by Ravi Sethi Activation Records Dolores Zage.
Lesson 13 CDT301 – Compiler Theory, Spring 2011 Teacher: Linus Källberg.
Storage Bindings Allocation is the process by which the memory cell or collection of memory cells is assigned to a variable. These cells are taken from.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 9.
CSE 425: Control Abstraction I Functions vs. Procedures It is useful to differentiate functions vs. procedures –Procedures have side effects but usually.
國立台灣大學 資訊工程學系 薛智文 98 Spring Run Time Environments (textbook ch# 7.1–7.3 )
ITEC 352 Lecture 19 Functions in Assembly. Functions + Assembly Review Questions? Project due on Friday Stacks Function activation / deactivation.
Programming Languages and Paradigms Activation Records in Java.
RUNTIME ENVIRONMENT AND VARIABLE BINDINGS How to manage local variables.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patterson and Hennessy Text.
Chapter 9 Life & Death of an Object Stacks & Heaps; Constructors Garbage Collector (gc)
LECTURE 13 Names, Scopes, and Bindings: Memory Management Schemes.
PZ09A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ09A - Activation records Programming Language Design.
Run-Time Environments Presented By: Seema Gupta 09MCA102.
1 Topic 6: Activation Records COS 320 Compiling Techniques Princeton University Spring 2016 Lennart Beringer.
Code Generation Instruction Selection Higher level instruction -> Low level instruction Register Allocation Which register to assign to hold which items?
Computer Architecture & Operations I
Storage Allocation Mechanisms
Lecture 7 Macro Review Stack Frames
Storage Classes There are three places in memory where data may be placed: In Data section declared with .data in assembly language in C - Static) On the.
Run-Time Environments Chapter 7
ENERGY 211 / CME 211 Lecture 25 November 17, 2008.
Stacks and Queues.
Run-time organization
Run-Time Storage Organization
Run-Time Storage Organization
Introduction to Compilers Tim Teitelbaum
Depth First Search—Backtracking
Stack Memory 2 (also called Call Stack)
Understanding Program Address Space
Binding Times Binding is an association between two things Examples:
UNIT V Run Time Environments.
TARGET CODE -Next Usage
Dynamic Memory And Objects
Run Time Environments 薛智文
RUN-TIME STORAGE Chuen-Liang Chen Department of Computer Science
Run-time environments
Presentation transcript:

CS383 Programming Languages Quiz 5

1. About runtime stack, which one is incorrect? a.The stack grows and shrinks as a process runs. b.The stack is used to hold activation records. c.For a function that has more statements, its stack frame should be larger. d.A function’s stack frame exists as long as the function is active.

2. Which rule is incorrect? a.b.c.d.a.b.c.d.

3. About the disadvantages of the mark-and-sweep GC algorithm, which is incorrect? a.Normal execution must be suspended. b.May touch all virtual memory pages. c.Fail to detect inaccessible circular structure. d. Heap may fragment.

a. b. c. d. All of them are correct. 4. Which rule is incorrect?

5. Which is not a major area of the memory? a. static area b. heap c. free list d. runtime stack

6. Which rule is incorrect? a. b. c. d.

7. What is not in the activation records? a.Reference counters b.Temporary variables c.Parameters and local variables d.Saved registers

8. Which rule is incorrect? a. b. c. d. All of them are correct.

9. Which rule is incorrect? a. b. c. d.

10. Which statement about run-time call stack is incorrect? a. When a called function returns control to the caller, its activation record is removed from the stack. b. The activation records are removed in the same order in which they are pushed onto the stack. c. Many activation records can be active on the run- time stack at any time. d. Each activation record contains a static link to the global variables.