SlideShare a Scribd company logo
1 of 2
Download to read offline
An Optimising Compiler for Generated Tiny Virtual Machines
Doug Palmer Pavan Sikka Philip Valencia
Peter Corke
CSIRO ICT Centre
{Doug.Palmer,Pavan.Sikka,Philip.Valencia,Peter.Corke}@csiro.au
Abstract
VMSCRIPT is a scripting language designed to allow
small programs to be compiled for a range of generated tiny
virtual machines, suitable for sensor network devices. The
VMSCRIPT compiler is an optimising compiler designed to
allow quick re-targeting, based on a template, code rewrit-
ing model. A compiler backend can be specified at the same
time as a virtual machine, with the compiler reading the
specification and using it as a code generator.
1. Introduction
Many experimental sensor networks are designed to be
essentially homogeneous, with identical sensor devices con-
necting to perhaps a single gateway. In many cases, each
node of the sensor network runs an identical program. How-
ever, commercially deployed sensor networks can be ex-
pected to be heterogeneous, for reasons of network life, ar-
chitectural issues and changing use of the environment the
network is part of. The broad motivation behind the work
described is to develop a software engineering stack that al-
lows application programmers to develop efficient applica-
tion programs, independent of the precise structure of the
sensor network that will host them.
As part of this aim, a technique of generating families
of virtual machines (VMs), suitable for hosting programs
in a heterogeneous environment has been developed.[5] We
have completed an initial implementation that allows us to
run programs on a Fleck.[6] The target virtual machines
can differ greatly in terms of instruction set, storage man-
agement and other features, ranging from minimal systems
that support a handful of instructions and pieces of data
to garbage-collected heaps. A specific feature of this ap-
proach is that subsets of a specification can be generated,
allowing families of related VMs to be generated. This flex-
ibility allows experimentation (either by a human or a ma-
chine) in finding the right mix of generic and environment-
and platform-specific features for an environment. The ex-
VMSCRIPT
Application
VM XML
Specification
VM (C)
VM (C support)
VM Target
Application
VM Assembly
VM Bytecode
VMSCRIPT
Compiler
Figure 1. Overview of VMSCRIPT Tools and
Objects
treme flexibility of the generated virtual machines results in
different orientation to the Mateฬ/Bombilla/TinyScript pro-
gramming model.[3]
This paper presents the next step of this work, a com-
piler for a simple scripting language, VMSCRIPT, that can
be used to generate efficient byte code for the broad class of
virtual machines that can be generated. When specifying a
VM, the designer supplies a description to a generator. An
extension to the description allows the designer to also de-
scribe the instruction sequences that will implement a small
number of basic operations. Ideally, specifying an accept-
ably efficient compiler for a virtual machine should take no
more effort than specifying the virtual machine itself.
Figure 1 shows the various VMSCRIPT-related tools and
objects.
2. The Compiler
An initial version of the VMSCRIPT compiler simply re-
lied on the stack architecture of the generated VMs and
generated code based on a simple parse tree traversal and
templating process. While correct, the generated programs
could hardly be described as efficient and a rewrite was un-
dertaken to allow more sophisticated analysis and code gen-
0-7803-9246-9/05/$20.00 ยฉ 2005 IEEE 161 EmNetS-II
<template>
<cost domain="size"
priority="1" cost="2"/>
<pattern>
<get source="2" target="?Mul"/>
<op type="multiply"
arg1="?Source:integer"
arg2="?Mul" output="?Target"/>
</pattern>
<transform>
<acquire source="?Source"/>
<opcode code="dup"/>
<opcode code="add"/>
<place output="?Target"/>
</transform>
<template>
Figure 2. Example Code Generation Template
eration. The compiler now uses a number of compilation
techniques, derived from the extensive literature on compil-
ers, such as intermediate representation, abstract interpreta-
tion and single static assignment form to globally analyse
an input program and produce optimal code.[4, 1, 2]
A key feature of the IR chosen for VMSCRIPT is the
need to provide support for easy specification of multiple
targets. To allow this, a relatively small set of intermedi-
ate forms are permitted, something the simplicity of VM-
SCRIPT allows. Despite the generated virtual machines be-
ing stack-based, named temporary variables are used in the
intermediate form, since these are easier to manipulate dur-
ing most operations, with stack mapping occurring at code
generation.[7]
Abstract interpretation is used in a number of optimisa-
tions in the compiler: type inference, stack estimation, con-
stant propagation and dead code removal.
2.1. Code Generation
Peephole optimsation at several levels and code genera-
tion uses a uniform rewriting strategy.[8] The compiler uses
techniques inspired by logic programming.[9] Transforma-
tions are encoded using logical variables. Any input that
unifies with the input pattern is transformed into the cor-
responding output pattern. Sequences of arbitrary interme-
diate representation code are repeatedly replaced by more
basic IR sequences until just ground forms that can be di-
rectly translated into assembly, remain. Figure 2 shows an
example code generation template, in this case one which
generates special case code for multiplication by two. Vir-
tual machine subsets are handled by ignoring templates that
would generate instructions or store references that are not
present in the subset.
The IR uses temporary variables instead of stack posi-
tions for intermediate values. During code generation, the
compiler tracks the stack position of temporary variables,
which can then be used with the special Place and Acquire
IRs to generate stack manipulation sequences.
3. Conclusions and Further Work
The VMSCRIPT compiler is a very flexible compiler for
generated virtual machines. In order to use the compiler
with a virtual machine, approximately 45โ€“60 simple rewrit-
ing templates need to be specified; A typical generated vir-
tual machine will have some 30โ€“40 instructions. The tem-
plates can be incrementally added to, allowing a repository
of optimal sequences to be built up over time.
There are a number of parts of the compiler that can be
made more sophisticated: the handling of ambiguous types,
stack estimation techniques, code generation cost analysis
and constant propagation cost analysis.
References
[1] R. Allen and K. Kennedy. Optimizing Compilers for Modern
Architectures. Morgan Kaufmann, 2002.
[2] P. Cousot and R. Cousot. Abstract interpretation: A unified lat-
tice model for static analysis of programs by construction or
approximation of fixpoints. In Proceedings of the 4th Sym-
posium on Principles of Programming Languages (POPL),
pages 238โ€“252, Los Angeles, California, 1977.
[3] P. Levis, D. Gay, and D. Culler. Bridging the gap: Program-
ming sensor networks with application specific virtual ma-
chines. Technical Report UCB//CSD-04-1343, UC Berkeley,
Aug. 2004. http://www.cs.berkeley.edu/หœpal/
pubs/mate-tr.pdf.
[4] S. S. Muchnick. Advanced Compiler Design and Implemen-
tation. Morgan Kaufmann, 1997.
[5] D. Palmer. A virtual machine generator for heterogeneous
smart spaces. In Proceedings of the 3rd Virtual Machine Re-
search and Technology Symposium (VM04), pages 1โ€“11, San
Jose, California, May 2004.
[6] P. Sikka, P. Corke, and L. Overs. Wireless sensor devices for
animal tracking and control. In Proceedings of the 29th Con-
ference on Local Computer Networks, Workshop on Embed-
ded Networked Sensors (EmNetS-I), pages 446โ€“454, Tampa,
Florida, Nov. 2004.
[7] R. Valleฬe-Rai, P. Co, E. Gagnon, L. Hedren, P. Lam, and
V. Sundaresan. Soot โ€” a Java bytecode optimization frame-
work. In Proceedings of the 1999 Conference of the Centre
for Advanced Studies on Collaborative Research, pages 13โ€“
23, Mississauga, Canada, 1999.
[8] E. Visser. A survey of rewriting strategies in program trans-
formation systems. In Proceedings of the Workshop on Re-
duction Strategies in Rewriting and Programming (WRS 01),
Utrecht, The Netherlands, May 2001.
[9] D. H. D. Warren. Logic programming and compiler writing.
Software, Practice and Experience, 10(2):97โ€“125, 1980.
162

More Related Content

Similar to An Optimising Compiler For Generated Tiny Virtual Machines

High Performance Computing (HPC) and Engineering Simulations in the Cloud
High Performance Computing (HPC) and Engineering Simulations in the CloudHigh Performance Computing (HPC) and Engineering Simulations in the Cloud
High Performance Computing (HPC) and Engineering Simulations in the CloudThe UberCloud
ย 
Cisco project ideas
Cisco   project ideasCisco   project ideas
Cisco project ideasVIT University
ย 
Fpga based 128 bit customised vliw processor for executing dual scalarvector ...
Fpga based 128 bit customised vliw processor for executing dual scalarvector ...Fpga based 128 bit customised vliw processor for executing dual scalarvector ...
Fpga based 128 bit customised vliw processor for executing dual scalarvector ...eSAT Publishing House
ย 
Virtual appliance creation and optimization in cloud
Virtual appliance creation and optimization in cloudVirtual appliance creation and optimization in cloud
Virtual appliance creation and optimization in cloudeSAT Journals
ย 
Virtual appliance creation and optimization in cloud
Virtual appliance creation and optimization in cloudVirtual appliance creation and optimization in cloud
Virtual appliance creation and optimization in cloudeSAT Publishing House
ย 
Iisrt sinthuja mepco (ec)
Iisrt sinthuja mepco (ec)Iisrt sinthuja mepco (ec)
Iisrt sinthuja mepco (ec)IISRT
ย 
Kostiantyn Bokhan, N-iX. CD4ML based on Azure and Kubeflow
Kostiantyn Bokhan, N-iX. CD4ML based on Azure and KubeflowKostiantyn Bokhan, N-iX. CD4ML based on Azure and Kubeflow
Kostiantyn Bokhan, N-iX. CD4ML based on Azure and KubeflowIT Arena
ย 
IRJET- Development of Uncrackable Software
IRJET- Development of Uncrackable SoftwareIRJET- Development of Uncrackable Software
IRJET- Development of Uncrackable SoftwareIRJET Journal
ย 
Rishikesh Sharma Portfolio
Rishikesh Sharma PortfolioRishikesh Sharma Portfolio
Rishikesh Sharma Portfoliosharmarishikesh
ย 
William Impey CV
William Impey CVWilliam Impey CV
William Impey CVWill Impey
ย 
Kubecon 2023 EU - KServe - The State and Future of Cloud-Native Model Serving
Kubecon 2023 EU - KServe - The State and Future of Cloud-Native Model ServingKubecon 2023 EU - KServe - The State and Future of Cloud-Native Model Serving
Kubecon 2023 EU - KServe - The State and Future of Cloud-Native Model ServingTheofilos Papapanagiotou
ย 
Towards a metamodel for the Rubus Component Model
Towards a metamodel for the Rubus Component ModelTowards a metamodel for the Rubus Component Model
Towards a metamodel for the Rubus Component ModelAlessio Bucaioni
ย 
Divide and Conquer โ€“ Microservices with Node.js
Divide and Conquer โ€“ Microservices with Node.jsDivide and Conquer โ€“ Microservices with Node.js
Divide and Conquer โ€“ Microservices with Node.jsSebastian Springer
ย 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)IJERD Editor
ย 
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...Qualcomm Developer Network
ย 
Accelerating Spark MLlib and DataFrame with Vector Processor โ€œSX-Aurora TSUBASAโ€
Accelerating Spark MLlib and DataFrame with Vector Processor โ€œSX-Aurora TSUBASAโ€Accelerating Spark MLlib and DataFrame with Vector Processor โ€œSX-Aurora TSUBASAโ€
Accelerating Spark MLlib and DataFrame with Vector Processor โ€œSX-Aurora TSUBASAโ€Databricks
ย 
Dot Net Fundamentals
Dot Net FundamentalsDot Net Fundamentals
Dot Net FundamentalsLiquidHub
ย 
djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...
djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...
djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...Dr. Thippeswamy S.
ย 
Lightening the burden of cloud resources administration: from VMs to Functions
Lightening the burden of cloud resources administration: from VMs to FunctionsLightening the burden of cloud resources administration: from VMs to Functions
Lightening the burden of cloud resources administration: from VMs to FunctionsEUBrasilCloudFORUM .
ย 

Similar to An Optimising Compiler For Generated Tiny Virtual Machines (20)

High Performance Computing (HPC) and Engineering Simulations in the Cloud
High Performance Computing (HPC) and Engineering Simulations in the CloudHigh Performance Computing (HPC) and Engineering Simulations in the Cloud
High Performance Computing (HPC) and Engineering Simulations in the Cloud
ย 
Micro Assembler
Micro AssemblerMicro Assembler
Micro Assembler
ย 
Cisco project ideas
Cisco   project ideasCisco   project ideas
Cisco project ideas
ย 
Fpga based 128 bit customised vliw processor for executing dual scalarvector ...
Fpga based 128 bit customised vliw processor for executing dual scalarvector ...Fpga based 128 bit customised vliw processor for executing dual scalarvector ...
Fpga based 128 bit customised vliw processor for executing dual scalarvector ...
ย 
Virtual appliance creation and optimization in cloud
Virtual appliance creation and optimization in cloudVirtual appliance creation and optimization in cloud
Virtual appliance creation and optimization in cloud
ย 
Virtual appliance creation and optimization in cloud
Virtual appliance creation and optimization in cloudVirtual appliance creation and optimization in cloud
Virtual appliance creation and optimization in cloud
ย 
Iisrt sinthuja mepco (ec)
Iisrt sinthuja mepco (ec)Iisrt sinthuja mepco (ec)
Iisrt sinthuja mepco (ec)
ย 
Kostiantyn Bokhan, N-iX. CD4ML based on Azure and Kubeflow
Kostiantyn Bokhan, N-iX. CD4ML based on Azure and KubeflowKostiantyn Bokhan, N-iX. CD4ML based on Azure and Kubeflow
Kostiantyn Bokhan, N-iX. CD4ML based on Azure and Kubeflow
ย 
IRJET- Development of Uncrackable Software
IRJET- Development of Uncrackable SoftwareIRJET- Development of Uncrackable Software
IRJET- Development of Uncrackable Software
ย 
Rishikesh Sharma Portfolio
Rishikesh Sharma PortfolioRishikesh Sharma Portfolio
Rishikesh Sharma Portfolio
ย 
William Impey CV
William Impey CVWilliam Impey CV
William Impey CV
ย 
Kubecon 2023 EU - KServe - The State and Future of Cloud-Native Model Serving
Kubecon 2023 EU - KServe - The State and Future of Cloud-Native Model ServingKubecon 2023 EU - KServe - The State and Future of Cloud-Native Model Serving
Kubecon 2023 EU - KServe - The State and Future of Cloud-Native Model Serving
ย 
Towards a metamodel for the Rubus Component Model
Towards a metamodel for the Rubus Component ModelTowards a metamodel for the Rubus Component Model
Towards a metamodel for the Rubus Component Model
ย 
Divide and Conquer โ€“ Microservices with Node.js
Divide and Conquer โ€“ Microservices with Node.jsDivide and Conquer โ€“ Microservices with Node.js
Divide and Conquer โ€“ Microservices with Node.js
ย 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
ย 
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...
ย 
Accelerating Spark MLlib and DataFrame with Vector Processor โ€œSX-Aurora TSUBASAโ€
Accelerating Spark MLlib and DataFrame with Vector Processor โ€œSX-Aurora TSUBASAโ€Accelerating Spark MLlib and DataFrame with Vector Processor โ€œSX-Aurora TSUBASAโ€
Accelerating Spark MLlib and DataFrame with Vector Processor โ€œSX-Aurora TSUBASAโ€
ย 
Dot Net Fundamentals
Dot Net FundamentalsDot Net Fundamentals
Dot Net Fundamentals
ย 
djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...
djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...
djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...
ย 
Lightening the burden of cloud resources administration: from VMs to Functions
Lightening the burden of cloud resources administration: from VMs to FunctionsLightening the burden of cloud resources administration: from VMs to Functions
Lightening the burden of cloud resources administration: from VMs to Functions
ย 

More from Leslie Schulte

Sample Thesis Topics For Psychology STARREDO
Sample Thesis Topics For Psychology STARREDOSample Thesis Topics For Psychology STARREDO
Sample Thesis Topics For Psychology STARREDOLeslie Schulte
ย 
Strathmore Writing 25 Cotton Stationery Paper Wove Finish Ivor
Strathmore Writing 25 Cotton Stationery Paper Wove Finish IvorStrathmore Writing 25 Cotton Stationery Paper Wove Finish Ivor
Strathmore Writing 25 Cotton Stationery Paper Wove Finish IvorLeslie Schulte
ย 
005 Esl How To Write An Essay Example Of Writing
005 Esl How To Write An Essay Example Of Writing005 Esl How To Write An Essay Example Of Writing
005 Esl How To Write An Essay Example Of WritingLeslie Schulte
ย 
Reflective Essay Conclusion Example. Online assignment writing service.
Reflective Essay Conclusion Example. Online assignment writing service.Reflective Essay Conclusion Example. Online assignment writing service.
Reflective Essay Conclusion Example. Online assignment writing service.Leslie Schulte
ย 
How To Write A Literature Review Outline What Is A
How To Write A Literature Review Outline What Is AHow To Write A Literature Review Outline What Is A
How To Write A Literature Review Outline What Is ALeslie Schulte
ย 
Virginia Tech Application Essay Prompt 2012 - Proofr
Virginia Tech Application Essay Prompt 2012 - ProofrVirginia Tech Application Essay Prompt 2012 - Proofr
Virginia Tech Application Essay Prompt 2012 - ProofrLeslie Schulte
ย 
Introductory Paragraph Research Paper Introduction Sample - EXAMPLEPAPERS
Introductory Paragraph Research Paper Introduction Sample - EXAMPLEPAPERSIntroductory Paragraph Research Paper Introduction Sample - EXAMPLEPAPERS
Introductory Paragraph Research Paper Introduction Sample - EXAMPLEPAPERSLeslie Schulte
ย 
College Life Essay - College Homework Help And Online Tutoring.
College Life Essay - College Homework Help And Online Tutoring.College Life Essay - College Homework Help And Online Tutoring.
College Life Essay - College Homework Help And Online Tutoring.Leslie Schulte
ย 
Admission Essay. Online assignment writing service.
Admission Essay. Online assignment writing service.Admission Essay. Online assignment writing service.
Admission Essay. Online assignment writing service.Leslie Schulte
ย 
How To Start An Essay About Yourself Examples
How To Start An Essay About Yourself ExamplesHow To Start An Essay About Yourself Examples
How To Start An Essay About Yourself ExamplesLeslie Schulte
ย 
10 Ways To Make Name W. Online assignment writing service.
10 Ways To Make Name W. Online assignment writing service.10 Ways To Make Name W. Online assignment writing service.
10 Ways To Make Name W. Online assignment writing service.Leslie Schulte
ย 
Love Letter Template Design Free - Letter Daily Referen
Love Letter Template Design Free - Letter Daily ReferenLove Letter Template Design Free - Letter Daily Referen
Love Letter Template Design Free - Letter Daily ReferenLeslie Schulte
ย 
Sample Philosophy Papers Free Will Determinism
Sample Philosophy Papers Free Will DeterminismSample Philosophy Papers Free Will Determinism
Sample Philosophy Papers Free Will DeterminismLeslie Schulte
ย 
FREE 20 Scholarship Essay Examples S. Online assignment writing service.
FREE 20 Scholarship Essay Examples  S. Online assignment writing service.FREE 20 Scholarship Essay Examples  S. Online assignment writing service.
FREE 20 Scholarship Essay Examples S. Online assignment writing service.Leslie Schulte
ย 
021 Essay Introduction Paragraph Example Argumentative Format ...
021 Essay Introduction Paragraph Example Argumentative Format ...021 Essay Introduction Paragraph Example Argumentative Format ...
021 Essay Introduction Paragraph Example Argumentative Format ...Leslie Schulte
ย 
Different Types Of Essay Writing Examples. Example
Different Types Of Essay Writing Examples. ExampleDifferent Types Of Essay Writing Examples. Example
Different Types Of Essay Writing Examples. ExampleLeslie Schulte
ย 
My First College Experience Essay . Online assignment writing service.
My First College Experience Essay  . Online assignment writing service.My First College Experience Essay  . Online assignment writing service.
My First College Experience Essay . Online assignment writing service.Leslie Schulte
ย 
Write My Persuasive Speech 75 Persuasive Speech Top
Write My Persuasive Speech 75 Persuasive Speech TopWrite My Persuasive Speech 75 Persuasive Speech Top
Write My Persuasive Speech 75 Persuasive Speech TopLeslie Schulte
ย 
Self Writing Essay Telegraph. Online assignment writing service.
Self Writing Essay  Telegraph. Online assignment writing service.Self Writing Essay  Telegraph. Online assignment writing service.
Self Writing Essay Telegraph. Online assignment writing service.Leslie Schulte
ย 
Sample Bibliography Elementary Bibliography T
Sample Bibliography Elementary  Bibliography TSample Bibliography Elementary  Bibliography T
Sample Bibliography Elementary Bibliography TLeslie Schulte
ย 

More from Leslie Schulte (20)

Sample Thesis Topics For Psychology STARREDO
Sample Thesis Topics For Psychology STARREDOSample Thesis Topics For Psychology STARREDO
Sample Thesis Topics For Psychology STARREDO
ย 
Strathmore Writing 25 Cotton Stationery Paper Wove Finish Ivor
Strathmore Writing 25 Cotton Stationery Paper Wove Finish IvorStrathmore Writing 25 Cotton Stationery Paper Wove Finish Ivor
Strathmore Writing 25 Cotton Stationery Paper Wove Finish Ivor
ย 
005 Esl How To Write An Essay Example Of Writing
005 Esl How To Write An Essay Example Of Writing005 Esl How To Write An Essay Example Of Writing
005 Esl How To Write An Essay Example Of Writing
ย 
Reflective Essay Conclusion Example. Online assignment writing service.
Reflective Essay Conclusion Example. Online assignment writing service.Reflective Essay Conclusion Example. Online assignment writing service.
Reflective Essay Conclusion Example. Online assignment writing service.
ย 
How To Write A Literature Review Outline What Is A
How To Write A Literature Review Outline What Is AHow To Write A Literature Review Outline What Is A
How To Write A Literature Review Outline What Is A
ย 
Virginia Tech Application Essay Prompt 2012 - Proofr
Virginia Tech Application Essay Prompt 2012 - ProofrVirginia Tech Application Essay Prompt 2012 - Proofr
Virginia Tech Application Essay Prompt 2012 - Proofr
ย 
Introductory Paragraph Research Paper Introduction Sample - EXAMPLEPAPERS
Introductory Paragraph Research Paper Introduction Sample - EXAMPLEPAPERSIntroductory Paragraph Research Paper Introduction Sample - EXAMPLEPAPERS
Introductory Paragraph Research Paper Introduction Sample - EXAMPLEPAPERS
ย 
College Life Essay - College Homework Help And Online Tutoring.
College Life Essay - College Homework Help And Online Tutoring.College Life Essay - College Homework Help And Online Tutoring.
College Life Essay - College Homework Help And Online Tutoring.
ย 
Admission Essay. Online assignment writing service.
Admission Essay. Online assignment writing service.Admission Essay. Online assignment writing service.
Admission Essay. Online assignment writing service.
ย 
How To Start An Essay About Yourself Examples
How To Start An Essay About Yourself ExamplesHow To Start An Essay About Yourself Examples
How To Start An Essay About Yourself Examples
ย 
10 Ways To Make Name W. Online assignment writing service.
10 Ways To Make Name W. Online assignment writing service.10 Ways To Make Name W. Online assignment writing service.
10 Ways To Make Name W. Online assignment writing service.
ย 
Love Letter Template Design Free - Letter Daily Referen
Love Letter Template Design Free - Letter Daily ReferenLove Letter Template Design Free - Letter Daily Referen
Love Letter Template Design Free - Letter Daily Referen
ย 
Sample Philosophy Papers Free Will Determinism
Sample Philosophy Papers Free Will DeterminismSample Philosophy Papers Free Will Determinism
Sample Philosophy Papers Free Will Determinism
ย 
FREE 20 Scholarship Essay Examples S. Online assignment writing service.
FREE 20 Scholarship Essay Examples  S. Online assignment writing service.FREE 20 Scholarship Essay Examples  S. Online assignment writing service.
FREE 20 Scholarship Essay Examples S. Online assignment writing service.
ย 
021 Essay Introduction Paragraph Example Argumentative Format ...
021 Essay Introduction Paragraph Example Argumentative Format ...021 Essay Introduction Paragraph Example Argumentative Format ...
021 Essay Introduction Paragraph Example Argumentative Format ...
ย 
Different Types Of Essay Writing Examples. Example
Different Types Of Essay Writing Examples. ExampleDifferent Types Of Essay Writing Examples. Example
Different Types Of Essay Writing Examples. Example
ย 
My First College Experience Essay . Online assignment writing service.
My First College Experience Essay  . Online assignment writing service.My First College Experience Essay  . Online assignment writing service.
My First College Experience Essay . Online assignment writing service.
ย 
Write My Persuasive Speech 75 Persuasive Speech Top
Write My Persuasive Speech 75 Persuasive Speech TopWrite My Persuasive Speech 75 Persuasive Speech Top
Write My Persuasive Speech 75 Persuasive Speech Top
ย 
Self Writing Essay Telegraph. Online assignment writing service.
Self Writing Essay  Telegraph. Online assignment writing service.Self Writing Essay  Telegraph. Online assignment writing service.
Self Writing Essay Telegraph. Online assignment writing service.
ย 
Sample Bibliography Elementary Bibliography T
Sample Bibliography Elementary  Bibliography TSample Bibliography Elementary  Bibliography T
Sample Bibliography Elementary Bibliography T
ย 

Recently uploaded

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
ย 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
ย 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
ย 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
ย 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
ย 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
ย 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
ย 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
ย 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
ย 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)โ€”โ€”โ€”โ€”IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)โ€”โ€”โ€”โ€”IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)โ€”โ€”โ€”โ€”IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)โ€”โ€”โ€”โ€”IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
ย 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
ย 
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธcall girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
ย 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
ย 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
ย 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
ย 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
ย 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
ย 

Recently uploaded (20)

Model Call Girl in Bikash Puri Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
Model Call Girl in Bikash Puri  Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”Model Call Girl in Bikash Puri  Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
Model Call Girl in Bikash Puri Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
ย 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
ย 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
ย 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
ย 
Model Call Girl in Tilak Nagar Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
Model Call Girl in Tilak Nagar Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”Model Call Girl in Tilak Nagar Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
Model Call Girl in Tilak Nagar Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
ย 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
ย 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
ย 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
ย 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
ย 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
ย 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
ย 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)โ€”โ€”โ€”โ€”IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)โ€”โ€”โ€”โ€”IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)โ€”โ€”โ€”โ€”IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)โ€”โ€”โ€”โ€”IMP.OF KSHARA ...
ย 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
ย 
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธcall girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
ย 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
ย 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
ย 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
ย 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
ย 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
ย 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
ย 

An Optimising Compiler For Generated Tiny Virtual Machines

  • 1. An Optimising Compiler for Generated Tiny Virtual Machines Doug Palmer Pavan Sikka Philip Valencia Peter Corke CSIRO ICT Centre {Doug.Palmer,Pavan.Sikka,Philip.Valencia,Peter.Corke}@csiro.au Abstract VMSCRIPT is a scripting language designed to allow small programs to be compiled for a range of generated tiny virtual machines, suitable for sensor network devices. The VMSCRIPT compiler is an optimising compiler designed to allow quick re-targeting, based on a template, code rewrit- ing model. A compiler backend can be specified at the same time as a virtual machine, with the compiler reading the specification and using it as a code generator. 1. Introduction Many experimental sensor networks are designed to be essentially homogeneous, with identical sensor devices con- necting to perhaps a single gateway. In many cases, each node of the sensor network runs an identical program. How- ever, commercially deployed sensor networks can be ex- pected to be heterogeneous, for reasons of network life, ar- chitectural issues and changing use of the environment the network is part of. The broad motivation behind the work described is to develop a software engineering stack that al- lows application programmers to develop efficient applica- tion programs, independent of the precise structure of the sensor network that will host them. As part of this aim, a technique of generating families of virtual machines (VMs), suitable for hosting programs in a heterogeneous environment has been developed.[5] We have completed an initial implementation that allows us to run programs on a Fleck.[6] The target virtual machines can differ greatly in terms of instruction set, storage man- agement and other features, ranging from minimal systems that support a handful of instructions and pieces of data to garbage-collected heaps. A specific feature of this ap- proach is that subsets of a specification can be generated, allowing families of related VMs to be generated. This flex- ibility allows experimentation (either by a human or a ma- chine) in finding the right mix of generic and environment- and platform-specific features for an environment. The ex- VMSCRIPT Application VM XML Specification VM (C) VM (C support) VM Target Application VM Assembly VM Bytecode VMSCRIPT Compiler Figure 1. Overview of VMSCRIPT Tools and Objects treme flexibility of the generated virtual machines results in different orientation to the Mateฬ/Bombilla/TinyScript pro- gramming model.[3] This paper presents the next step of this work, a com- piler for a simple scripting language, VMSCRIPT, that can be used to generate efficient byte code for the broad class of virtual machines that can be generated. When specifying a VM, the designer supplies a description to a generator. An extension to the description allows the designer to also de- scribe the instruction sequences that will implement a small number of basic operations. Ideally, specifying an accept- ably efficient compiler for a virtual machine should take no more effort than specifying the virtual machine itself. Figure 1 shows the various VMSCRIPT-related tools and objects. 2. The Compiler An initial version of the VMSCRIPT compiler simply re- lied on the stack architecture of the generated VMs and generated code based on a simple parse tree traversal and templating process. While correct, the generated programs could hardly be described as efficient and a rewrite was un- dertaken to allow more sophisticated analysis and code gen- 0-7803-9246-9/05/$20.00 ยฉ 2005 IEEE 161 EmNetS-II
  • 2. <template> <cost domain="size" priority="1" cost="2"/> <pattern> <get source="2" target="?Mul"/> <op type="multiply" arg1="?Source:integer" arg2="?Mul" output="?Target"/> </pattern> <transform> <acquire source="?Source"/> <opcode code="dup"/> <opcode code="add"/> <place output="?Target"/> </transform> <template> Figure 2. Example Code Generation Template eration. The compiler now uses a number of compilation techniques, derived from the extensive literature on compil- ers, such as intermediate representation, abstract interpreta- tion and single static assignment form to globally analyse an input program and produce optimal code.[4, 1, 2] A key feature of the IR chosen for VMSCRIPT is the need to provide support for easy specification of multiple targets. To allow this, a relatively small set of intermedi- ate forms are permitted, something the simplicity of VM- SCRIPT allows. Despite the generated virtual machines be- ing stack-based, named temporary variables are used in the intermediate form, since these are easier to manipulate dur- ing most operations, with stack mapping occurring at code generation.[7] Abstract interpretation is used in a number of optimisa- tions in the compiler: type inference, stack estimation, con- stant propagation and dead code removal. 2.1. Code Generation Peephole optimsation at several levels and code genera- tion uses a uniform rewriting strategy.[8] The compiler uses techniques inspired by logic programming.[9] Transforma- tions are encoded using logical variables. Any input that unifies with the input pattern is transformed into the cor- responding output pattern. Sequences of arbitrary interme- diate representation code are repeatedly replaced by more basic IR sequences until just ground forms that can be di- rectly translated into assembly, remain. Figure 2 shows an example code generation template, in this case one which generates special case code for multiplication by two. Vir- tual machine subsets are handled by ignoring templates that would generate instructions or store references that are not present in the subset. The IR uses temporary variables instead of stack posi- tions for intermediate values. During code generation, the compiler tracks the stack position of temporary variables, which can then be used with the special Place and Acquire IRs to generate stack manipulation sequences. 3. Conclusions and Further Work The VMSCRIPT compiler is a very flexible compiler for generated virtual machines. In order to use the compiler with a virtual machine, approximately 45โ€“60 simple rewrit- ing templates need to be specified; A typical generated vir- tual machine will have some 30โ€“40 instructions. The tem- plates can be incrementally added to, allowing a repository of optimal sequences to be built up over time. There are a number of parts of the compiler that can be made more sophisticated: the handling of ambiguous types, stack estimation techniques, code generation cost analysis and constant propagation cost analysis. References [1] R. Allen and K. Kennedy. Optimizing Compilers for Modern Architectures. Morgan Kaufmann, 2002. [2] P. Cousot and R. Cousot. Abstract interpretation: A unified lat- tice model for static analysis of programs by construction or approximation of fixpoints. In Proceedings of the 4th Sym- posium on Principles of Programming Languages (POPL), pages 238โ€“252, Los Angeles, California, 1977. [3] P. Levis, D. Gay, and D. Culler. Bridging the gap: Program- ming sensor networks with application specific virtual ma- chines. Technical Report UCB//CSD-04-1343, UC Berkeley, Aug. 2004. http://www.cs.berkeley.edu/หœpal/ pubs/mate-tr.pdf. [4] S. S. Muchnick. Advanced Compiler Design and Implemen- tation. Morgan Kaufmann, 1997. [5] D. Palmer. A virtual machine generator for heterogeneous smart spaces. In Proceedings of the 3rd Virtual Machine Re- search and Technology Symposium (VM04), pages 1โ€“11, San Jose, California, May 2004. [6] P. Sikka, P. Corke, and L. Overs. Wireless sensor devices for animal tracking and control. In Proceedings of the 29th Con- ference on Local Computer Networks, Workshop on Embed- ded Networked Sensors (EmNetS-I), pages 446โ€“454, Tampa, Florida, Nov. 2004. [7] R. Valleฬe-Rai, P. Co, E. Gagnon, L. Hedren, P. Lam, and V. Sundaresan. Soot โ€” a Java bytecode optimization frame- work. In Proceedings of the 1999 Conference of the Centre for Advanced Studies on Collaborative Research, pages 13โ€“ 23, Mississauga, Canada, 1999. [8] E. Visser. A survey of rewriting strategies in program trans- formation systems. In Proceedings of the Workshop on Re- duction Strategies in Rewriting and Programming (WRS 01), Utrecht, The Netherlands, May 2001. [9] D. H. D. Warren. Logic programming and compiler writing. Software, Practice and Experience, 10(2):97โ€“125, 1980. 162