| Introduction | p. 1 |
| Introduction | p. 1 |
| Interpreters | p. 3 |
| Landin's SECD Machine | p. 3 |
| The Organisation of this Book | p. 5 |
| Omissions | p. 7 |
| VMs for Portability: BCPL | p. 11 |
| Introduction | p. 11 |
| BCPL the Language | p. 12 |
| VM Operations | p. 15 |
| The OCODE Machine | p. 17 |
| OCODE Instructions and their Implementation | p. 18 |
| Expression Instructions | p. 18 |
| Load and Store Instructions | p. 20 |
| Instructions Relating to Routines | p. 20 |
| Control Instructions | p. 22 |
| Directives | p. 23 |
| The Intcode/Cintcode Machine | p. 24 |
| The Java Virtual Machine | p. 27 |
| Introduction | p. 27 |
| JVM Organisation: An Overview | p. 28 |
| The stack | p. 29 |
| Method areas | p. 30 |
| The PC register | p. 31 |
| Other structures | p. 32 |
| Class Files | p. 32 |
| Object Representation at Runtime | p. 40 |
| Initialisation | p. 42 |
| Object Deletion | p. 44 |
| JVM Termination | p. 45 |
| Exception Handling | p. 45 |
| Instructions | p. 46 |
| Data-manipulation instructions | p. 48 |
| Control instructions | p. 51 |
| Stack-manipulating instructions | p. 54 |
| Support for object orientation | p. 56 |
| Synchronisation | p. 59 |
| Concluding Remarks | p. 59 |
| DIY VMs | p. 61 |
| Introduction | p. 61 |
| ALEX | p. 62 |
| Language Overview | p. 62 |
| What the Virtual Machine Must Support | p. 65 |
| Virtual Machine-Storage Structures | p. 66 |
| Virtual Machine-Registers | p. 68 |
| Virtual Machine-Instruction Set | p. 70 |
| An Example | p. 79 |
| Implementation | p. 81 |
| Extensions | p. 85 |
| Alternatives | p. 88 |
| Specification | p. 93 |
| Issues | p. 96 |
| Indirect and Relative Jumps | p. 97 |
| More Data Types | p. 98 |
| Higher-Order Routines | p. 106 |
| Primitive Routines | p. 106 |
| Concluding Remarks | p. 107 |
| More Stack-Based VMs | p. 109 |
| Introduction | p. 109 |
| A Simple Object-Oriented Language | p. 110 |
| Language Overview | p. 110 |
| Virtual Machine-Storage Structures | p. 111 |
| Virtual Machine-Registers | p. 113 |
| Virtual Machine-Instruction Set | p. 113 |
| Extensions | p. 116 |
| Alternatives | p. 116 |
| A Parallel Language | p. 117 |
| Language Overview | p. 117 |
| Virtual Machine-Storage Structures | p. 119 |
| Virtual Machine-Registers | p. 121 |
| Virtual Machine-Instruction Set | p. 122 |
| Implementation | p. 124 |
| Extensions | p. 126 |
| Alternatives | p. 128 |
| Issues | p. 129 |
| Concluding Remarks | p. 129 |
| Some Optimisations | p. 129 |
| Combining the Languages | p. 130 |
| Case Study: An Event-Driven Language | p. 131 |
| Introduction | p. 131 |
| The Structure of Rules | p. 133 |
| Events | p. 136 |
| Execution Cycle | p. 136 |
| Interpretation Rules | p. 138 |
| VM Specification | p. 141 |
| States and Notational Conventions | p. 142 |
| Infra-Rule Transitions | p. 145 |
| Extra-Rule Transitions | p. 148 |
| VM-Only Transitions | p. 150 |
| Introspective Operations | p. 151 |
| Rule Equivalences | p. 153 |
| Concluding Remarks | p. 154 |
| Register-Based Machines | p. 157 |
| Introduction | p. 157 |
| The Register-Transfer Model | p. 158 |
| Register Machine Organisation | p. 161 |
| Parrot-General Organisation | p. 165 |
| Parrot Instruction Set | p. 168 |
| Control instructions | p. 169 |
| Data management instructions | p. 169 |
| Register and stack operations | p. 170 |
| DIY Register-Based Virtual Machine | p. 171 |
| Informal Design | p. 172 |
| Extensions | p. 176 |
| Transition Rules | p. 177 |
| Translating ALEXVM into RTM | p. 183 |
| Example Code | p. 186 |
| Correctness of the Translation | p. 186 |
| More Natural Compilation | p. 196 |
| Extensions | p. 200 |
| Implementation Techniques | p. 201 |
| Stack-Based Machines | p. 202 |
| Direct Implementation | p. 202 |
| Translation | p. 203 |
| Threaded Code | p. 207 |
| Register Machines | p. 209 |
| Register sets | p. 210 |
| Addressing | p. 210 |
| Translation to Another VM | p. 212 |
| Using Transitions | p. 212 |
| Concluding Remarks | p. 213 |
| Open Issues | p. 215 |
| Security | p. 215 |
| New Languages | p. 216 |
| Typed Instruction Sets and Intermediate Codes | p. 216 |
| High-Level Instructions | p. 218 |
| Additivity and Replacement | p. 218 |
| Compiler Correctness | p. 218 |
| Dynamic Code Insertion | p. 219 |
| Instrumentation | p. 220 |
| Including more Information about Source Code | p. 221 |
| Integration with Databases | p. 222 |
| Increased Inter-Operability | p. 222 |
| Code Mobility | p. 223 |
| Small Platforms | p. 224 |
| Real-Time VMs | p. 226 |
| Code Morphing | p. 227 |
| Greater Optimisation | p. 227 |
| Operating System Constructs | p. 228 |
| Virtual Machines for more General Portability | p. 229 |
| Distributed VMs | p. 229 |
| Objects and VMs | p. 229 |
| Virtual VMs | p. 230 |
| By Way of a Conclusion | p. 231 |
| Compiling ALEX | p. 233 |
| Introduction | p. 233 |
| Notational Conventions | p. 233 |
| Compilation Rules | p. 235 |
| Harrison Machine Compilation Rules | p. 241 |
| Introduction | p. 241 |
| Compilation Rules | p. 241 |
| Harrison Machine Instruction Set | p. 257 |
| References | p. 261 |
| Index | p. 265 |
| Table of Contents provided by Ingram. All Rights Reserved. |