The document discusses run-time environments and how compilers support program execution through run-time environments. It covers:
1) The compiler cooperates with the OS and system software through a run-time environment to implement language abstractions during execution.
2) The run-time environment handles storage layout/allocation, variable access, procedure linkage, parameter passing and interfacing with the OS.
3) Memory is typically divided into code, static storage, heap and stack areas, with the stack and heap growing towards opposite ends of memory dynamically during execution.
The purpose of types:
To define what the program should do.
e.g. read an array of integers and return a double
To guarantee that the program is meaningful.
that it does not add a string to an integer
that variables are declared before they are used
To document the programmer's intentions.
better than comments, which are not checked by the compiler
To optimize the use of hardware.
reserve the minimal amount of memory, but not more
use the most appropriate machine instructions.
Run-Time Environments: Storage organization, Stack Allocation of Space, Access to Nonlocal Data on the Stack, Heap Management, Introduction to Garbage Collection, Introduction to Trace-Based Collection. Code Generation: Issues in the Design of a Code Generator, The Target Language, Addresses in the Target Code, Basic Blocks and Flow Graphs, Optimization of Basic Blocks, A Simple Code Generator, Peephole Optimization, Register Allocation and Assignment, Dynamic Programming Code-Generation
The purpose of types:
To define what the program should do.
e.g. read an array of integers and return a double
To guarantee that the program is meaningful.
that it does not add a string to an integer
that variables are declared before they are used
To document the programmer's intentions.
better than comments, which are not checked by the compiler
To optimize the use of hardware.
reserve the minimal amount of memory, but not more
use the most appropriate machine instructions.
Run-Time Environments: Storage organization, Stack Allocation of Space, Access to Nonlocal Data on the Stack, Heap Management, Introduction to Garbage Collection, Introduction to Trace-Based Collection. Code Generation: Issues in the Design of a Code Generator, The Target Language, Addresses in the Target Code, Basic Blocks and Flow Graphs, Optimization of Basic Blocks, A Simple Code Generator, Peephole Optimization, Register Allocation and Assignment, Dynamic Programming Code-Generation
Artificial Intelligence: Introduction, Typical Applications. State Space Search: Depth Bounded
DFS, Depth First Iterative Deepening. Heuristic Search: Heuristic Functions, Best First Search,
Hill Climbing, Variable Neighborhood Descent, Beam Search, Tabu Search. Optimal Search: A
*
algorithm, Iterative Deepening A*
, Recursive Best First Search, Pruning the CLOSED and OPEN
Lists
In this slide you will explore more about how to make derivations ,design parse tree ,what is ambiguity and how to remove ambiguity ,left recursion ,left factoring .
Machine-Independent Optimizations: The Principal Sources of Optimization, Introduction to Data-Flow Analysis, Foundations of Data-Flow Analysis, Constant Propagation, Partial Redundancy Elimination, Loops in Flow Graphs
Artificial Intelligence: Introduction, Typical Applications. State Space Search: Depth Bounded
DFS, Depth First Iterative Deepening. Heuristic Search: Heuristic Functions, Best First Search,
Hill Climbing, Variable Neighborhood Descent, Beam Search, Tabu Search. Optimal Search: A
*
algorithm, Iterative Deepening A*
, Recursive Best First Search, Pruning the CLOSED and OPEN
Lists
In this slide you will explore more about how to make derivations ,design parse tree ,what is ambiguity and how to remove ambiguity ,left recursion ,left factoring .
Machine-Independent Optimizations: The Principal Sources of Optimization, Introduction to Data-Flow Analysis, Foundations of Data-Flow Analysis, Constant Propagation, Partial Redundancy Elimination, Loops in Flow Graphs
A microprocessor is an electronic component that is used by a computer to do its work. It is a central processing unit on a single integrated circuit chip containing millions of very small components including transistors, resistors, and diodes that work together.
In this presentation we introduce a family of gossiping algorithms whose members share the same structure though they vary their performance in function of a combinatorial parameter. We show that such parameter may be considered as a “knob” controlling the amount of communication parallelism characterizing the algorithms. After this we introduce procedures to operate the knob and choose parameters matching the amount of communication channels currently provided by the available communication system(s). In so doing we provide a robust mechanism to tune the production of requests for communication after the current operational conditions of the consumers of such requests. This can be used to achieve high performance and programmatic avoidance of undesirable events such as message collisions.
Paper available at https://dl.dropboxusercontent.com/u/67040428/Articles/pdp12.pdf
TAU for Accelerating AI Applications at OpenPOWER Summit Europe OpenPOWERorg
Sameer Shende, director, Performance Research Laboratory, University of Oregon, presents TAU for Accelerating AI Applications at OpenPOWER Summit Europe 2018.
Distributed contention based mac protocol for cognitive radioIffat Anjum
Introduction
System Model
DC-MAC Design
Network Initialization
DC-MAC Working
Data Transfer on Home Channel
Data Transfer on a Foreign Channel
Performance Analysis
Conclusion
References
Pnp mac preemptive slot allocation and non preemptive transmission for provid...Iffat Anjum
Contribution.
Problem Definition.
Overview of PNP-MAC.
Features of PNP-MAC.
Priority Classification.
Fast, Preemptive DTS allocation.
Non-Preemptive transmission.
Prioritized CCA in ETS.
Prioritized random back-off in CAP.
Performance Evaluation.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
2. Run-time Environment
• Compiler must cooperate with OS and other system
software to support implementation of different
abstractions (names, scopes, bindings, data types,
operators, procedures, parameters, flow-of-control) on
the target machine
• Compiler does this by Run-Time Environment in
which it assumes its target programs are being
executed
• Run-Time Environment deals with
– Layout and allocation of storage
– Access to variable and data
– Linkage between procedures
– Parameter passing
– Interface to OS, I/O devices etc
3. Storage Organization
Code
Static
Heap
Free Memory
Stack
• Compiler deals with logical address space
• OS maps the logical addresses to physical addresses
Memory locations for code are determined at compile
time. Usually placed in the low end of memory
Size of some program data are known at compile time –
can be placed another statically determined area
Dynamic space areas – size changes during
program execution.
• Heap
• Grows towards higher address
• Stores data allocated under program control
• Stack
• Grows towards lower address
• Stores activation records
Typical subdivision of run-time memory
4. Run-Time Environments
• How do we allocate the space for the generated target
code and the data object of our source programs?
• The places of the data objects that can be determined at
compile time will be allocated statically.
• But the places for the some of data objects will be
allocated at run-time.
• The allocation and de-allocation of the data objects is
managed by the run-time support package.
– run-time support package is loaded together with the
generated target code.
– the structure of the run-time support package depends on the
semantics of the programming language (especially the
semantics of procedures in that language).
5. Procedure Activations
• Each execution of a procedure is called as activation of
that procedure.
• An execution of a procedure P starts at the beginning of
the procedure body;
• When a procedure P is completed, it returns control to the
point immediately after the place where P was called.
• Lifetime of an activation of a procedure P is the sequence of
steps between the first and the last steps in execution of P
(including the other procedures called by P).
• If A and B are procedure activations, then their lifetimes
are either non-overlapping or are nested.
• If a procedure is recursive, a new activation can begin
before an earlier activation of the same procedure has
ended.
6. A call graph is a directed multi-graph where:
• the nodes are the procedures of the program and
• the edges represent calls between these procedures.
Used in optimization phase.
Acyclic € no recursion in the program Can
be computed statically.
Call Graph
7. var a: array [0 .. 10] of integer;
procedure main
begin readarray(); quicksort(1,9); end
procedure readarray
var i: integer
begin … a[i] … end
function partition(y,z: integer): integer
var i,j,x,v: integer
begin … end
procedure quicksort(m,n: integer)
var i: integer
begin i := partition(m,n); quicksort(m,i-1); quicksort(i+1,n) end
Main
quicksort
readarray
partition
Example: Call Graph
8. Activation Tree/ Call Tree
• We can use a tree (called activation tree) to show
the way control enters and leaves activations.
• In an activation tree:
– Each node represents an activation of a procedure.
– The root represents the activation of the main program.
– The node A is a parent of the node B iff the control
flows from A to B.
– The node A is left to to the node B iff the lifetime of A
occurs before the lifetime of B.
9. Activation Tree (cont.)
program main;
procedure s;
begin ... end;
procedure p;
procedure q;
begin ... end;
begin q; s; end;
begin p; s; end;
enter main
enter p
enter q
exit q
enter s
exit s
exit p
enter s
exit s
exit main
A Nested Structure
11. • Activation Tree - cannot be computed statically
• Dynamic – may be different every time the
program is run
main
r() q (1,9)
p (1,9) q(1,3) q (5,9)
p (1,3) q(1,0) q (2,3) p (5,9) q(5,5) q (7,9)
p (2,3) q(2,1) q (3,3) p (7,9) q(7,7) q (9,9)
Activation Tree
12. Paths in the activation tree from root to some node
represent a sequence of active calls at runtime
main
r() q (1,9)
p (1,9) q(1,3) q (5,9)
p (1,3) q(1,0) q (2,3) p (5,9) q(5,5) q (7,9)
p (2,3) q(2,1) q (3,3) p (7,9) q(7,7) q (9,9)
Run-time Control Flow
13. • Procedure call/return – when a procedure
activation terminates, control returns to the
caller of this procedure.
• Parameter/return value – values are passed
into a procedure activation upon call. For a
function, a value may be returned to the caller.
• Variable addressing – when using an
identifier, language scope rules dictate the
binding.
Implementing Run-time control flow
14. • Historically, the first approach to solve the run-
time control flow problem (Fortran)
• All space allocated at compile time
– Code area – machine instructions for each
procedure
– Static area / procedure call frame/ activation
record
• single data area allocated for each procedure.
– local vars, parameters, return value, saved registers
• return address for each procedure.
Static Allocation
15. Code area
Data area
for procedure
A
Data area
for procedure
BCode
generated
for A
Code
generated
for B
return addr return addr
Local data,
parameters,
return
value,
registers
for A
Local data,
parameters,
return
value,
registers
for B
Static Allocation
16. • When A calls B:
– in A: evaluate actual parameters and place into B’s
data area, place RA in B’s data area, save any
registers or status data needed, update the program
counter (PC) to B’s code
• When the call returns
– in B: move return value to known place in data area,
update PC to value in RA
– in A: get return value, restore any saved registers or
status data
Call/Return processing in Static Allocation
17. Code area Activation
for procedure
A
Activation
for procedure
B
A:
call B
L1:
B:
…
return
PC
Call tree:
A
Local data,
parameters,
return
value,
registers
for A
Local data,
parameters,
return
value,
registers
for B
Static Allocation
18. Static Allocation
Code area Activation
for procedure
A
Activation
for procedure
B
A:
call B
L1:
B:
…
return
L1
dataLocal
for A
Local data
for B
PC
Call tree:
A
B
19. Static Allocation
Code area Activation Activation
A:
call B
L1:
B:
…
return
for pro
A
cedure for procedure
B
L1
Local
for A
data Local data
for B
PC
Call tree:
A
20. Activation
for procedure
A
Code area
A:
call B
return addr
dataLocal
for A
Activation
for procedure
B
return addr
Local data
for B
B:
call B
L2:
What happens???
Static Allocation: Recursion?
21. Code area Activation
for procedure
A
Activation
for procedure
B
A:
call B
L1:
B:
call B
L2:
return
dataLocal
for A
Local data
for B
PC
Call tree:
A
Static Allocation: Recursion
22. Code area Activation
for procedure
A
Activation
for procedure
B
A:
call B
L1:
B:
call B
L2:
return
dataLocal
for A
Local data
for B
PC L1
Call tree:
A
B
Static Allocation: Recursion
23. Code area Activation
for procedure
A
Activation
for procedure
B
A:
call B
L1:
B:
call B
L2:
return
dataLocal
for A
Local data
for B
PC L2
Call tree:
A
B
B
Static Allocation: Recursion
24. Code area Activation
for procedure
A
Activation
for procedure
B
A:
call B
L1:
B:
call B
L2:
return
dataLocal
for A
Local data
for B
PC L2
Call tree:
A
B
Static Allocation: Recursion
25. Code area Activation
for procedure
A
Activation
for procedure
B
A:
call B
L1:
B:
call B
L2:
return
dataLocal
for A
dataLocal
for B
PC L2
Call tree:
A
B
We’ve lost
the L1 label
so we can’t
get back to
A
Static Allocation: Recursion
26. • Variable addresses hard-coded, usually as
offset from data area where variable is
declared.
addr(x) = start of x's local scope + x's offset
Runtime Addressing in Static Allocation
27. Need a different approach to handle recursion.
• Code area – machine code for procedures
• Static data – often not associated with
procedures
• Stack (Control Stack) – runtime information
Stack Allocation
28. Control Stack
• The flow of the control in a program corresponds to a
depth-first traversal of the activation tree that:
– starts at the root,
– visits a node before its children, and
– recursively visits children at each node an a left-to-right
order.
• A stack (called control stack) can be used to keep track
of live procedure activations.
– An activation record is pushed onto the control stack as the
activation starts.
– That activation record is popped when that activation ends.
– Dynamic – grows and shrinks
• When node n is at the top of the control stack, the stack
contains the nodes along the path from n to the root.
29. Variable Scopes
• The same variable name can be used in the different parts of
the program.
• The scope rules of the language determine which declaration of
a name applies when the name appears in the program.
• An occurrence of a variable (a name) is:
– local: If that occurrence is in the same procedure in
which that name is declared.
– non-local: Otherwise (ie. it is declared outside of that
procedure)
a is local
b is non-local
procedure p;
var b:real;
procedure q;
var a: integer;
begin a := 1; b := 2; end;
begin ... end;
30. Activation Records
• Information needed by a single execution of a
procedure is managed using a contiguous block of
storage called activation record.
• An activation record is allocated when a procedure is
entered, and it is de-allocated when that procedure
exited.
• Size of each field can be determined at compile
time (Although actual location of the activation
record is determined at run-time).
– Except that if the procedure has a local variable
and its size depends on a parameter, its size is
determined at the run time.
31. Activation Records (cont.)
return value
actual
parameters
optional control
link
optional access
link
saved machine
status
local data
temporaries
The returned value of the called procedure is returned
in this field to the calling procedure. In practice, we may
use a machine register for the return value.
The field for actual parameters is used by the calling
procedure to supply parameters to the called procedure.
The optional control link points to the activation record
of the caller.
The optional access link is used to refer to nonlocal data
held in other activation records.
The field for saved machine status holds information about
the state of the machine before the procedure is called.
The field of local data holds data that local to an execution
of a procedure..
Temporary variables is stored in the field of temporaries.
32. Activation Records (Ex1)
program main;
procedure p;
var a:real;
procedure q;
var b:integer;
begin ... end;
begin q; end;
procedure s;
var c:integer;
begin ... end;
begin p; s; end;
main
p
a:
q
b:
stack
main
p
q
s
33. Activation Records for Recursive Procedures
program main;
procedure p;
function q(a:integer):integer;
begin
if (a=1) then q:=1;
else q:=a+q(a-1);
end;
begin q(3); end;
begin p; end;
main
p
a: 3
q(3)
a:2
q(2)
a:1
q(1)
34. Stack (growing downward)Call Tree
Main
readarray
Main
a: array
readarray
i: integer
Stack Allocation for quicksort 1
35. Stack (growing downward)
Main
a: array
quick(1,9)
i: integer
Call Tree
Main
readarray quick(1,9)
Stack Allocation for quicksort 2
36. Stack (growing downward)Call Tree
Main
readarray quick(1,9)
quick(1,3)
quick(1,0)
p(1,9)
p(1,9)
Main
a: array
quick(1,9)
i: integer
quick(1,3)
i: integer
quick(1,0)
i: integer
Stack Allocation for quicksort 3
37. Frame pointer $fp:
points to the first
word of the frame,
Stack pointer ($sp):
points to the last
word of the frame.
The frame consists of
the memory between
locations pointed by
$fp and $sp
Layout of the stack frame
38. Creation of An Activation Record
• Who allocates an activation record of a procedure?
– Some part of the activation record of a procedure is
created by that procedure immediately after that
procedure is entered.
– Some part is created by the caller of that procedure
before that procedure is entered.
• Who deallocates?
– Callee de-allocates the part allocated by Callee.
– Caller de-allocates the part allocated by Caller.
39. Creation of An Activation Record (cont.)
return value
actual parameters
optional control link
optional access link
saved machine status
local data
temporaries
return value
actual parameters
optional control link
optional access link
saved machine status
local data
temporaries
Callee’s Responsibility
Caller’s Activation Record
Caller’s Responsibility
Callee’s Activation Record
40. Callee’s responsibilities before running
• Allocate memory for the activation record/frame by
subtracting the frame’s size from $sp
• Save callee-saved registers in the frame. A callee must save
the values in these registers ($s0–$s7, $fp, and $ra) before
altering them
[since the caller expects to find these registers unchanged after
the call.]
– Register $fp is saved by every procedure that allocates a new
stack frame.
– $ra only needs to be saved if the callee itself makes a call.
– The other callee-saved registers that are used also must be saved.
• Establish the frame pointer by adding the stack frame’s size
minus four to $sp and storing the sum in $fp.
41. • Pass arguments: By convention, the first four arguments
are passed in registers $a0–$a3.
Any remaining arguments are pushed on the stack and
appear at the beginning of the called procedure’s stack
frame.
• Save caller-saved registers: The called procedure can
use these registers ($a0–$a3 and $t0–$t9) without first
saving their value. If the caller expects to use one of these
registers after a call, it must save its value before the call.
• Execute a jal instructionwhich jumps to the callee’s first
instruction and saves the return address in register $ra.
Caller’s Responsibility
42. Call Processing: Callee
• Initializes local data, calculate the offset of each
variable from the start of the frame
• The executing procedure uses the frame pointer
to quickly access values in its stack frame.
For example, an argument in the stack frame can
be loaded into register $v0 with the instruction
lw $v0, 0($fp)
• Begins local execution
43. • If the callee is a function that returns a value, place
the returned value in a special register e.g. $v0.
• Restore all callee-saved registers that were saved
upon procedure entry.
• Pop the stack frame by adding the frame size to
$sp.
• Return by jumping to the address in register $ra.
Added at the ‘return’ point(s) of the function
Callee’s responsibilities on returning
44. • Restore registers and status
• Copy the return value (if any) from activation
• Continue local execution
Added after the point of the call
Return Processing: Caller