Top Banner
PNaCl/LLVM Go Compiler Jason Hickey, Herbert Czymontic, Michal Cierniak {jyh,herbertc,cierniak}@google.com
9

PNaCl/LLVM Go Compiler

Jan 19, 2017

Download

Software

Jason Hickey
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: PNaCl/LLVM Go Compiler

PNaCl/LLVM Go CompilerJason Hickey, Herbert Czymontic, Michal Cierniak

{jyh,herbertc,cierniak}@google.com

Page 2: PNaCl/LLVM Go Compiler

Vision• Apps run anywhere and

everywhere

• Your browser is a full featured development environment

• Includes code development, compilation, debugging, security

• How do we run anywhere?

• How do we develop anywhere?

• How do we debug anywhere?

Page 3: PNaCl/LLVM Go Compiler

Running Go in Chrome

Page 4: PNaCl/LLVM Go Compiler

Future Directions

Page 5: PNaCl/LLVM Go Compiler

Basic Strategy• Want 100% compatibility with standard gc runtime

• Full support for goroutines, stack extension, precise garbage collection, etc.

• Can’t use the LLVM stack• Can’t be extended, doesn’t support inspection, garbage collection, or stack

switching

• Solution• Custom compiler (written in Go)• Ignore the LLVM stack and use our own

Page 6: PNaCl/LLVM Go Compiler

Go calling convention• All arguments and return values are passed on the stack • All registers are caller-save (the callee can trash them)

Page 7: PNaCl/LLVM Go Compiler

LLVM: introduce an explicit stack

Page 8: PNaCl/LLVM Go Compiler

Phases

Page 9: PNaCl/LLVM Go Compiler

Status• Available in the Vanadium Internet of Things project

Complete Go-based development env, security, networking

https://vanadium.googlesource.com/release.go.pnacl Vanadium: http://v.io

• Most features are implemented, aiming for Dec.