1e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<?xml version="1.0" encoding="utf-8" ?>
2e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<head>
5e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
7cecdab21b205a7cd8910e25c540d57bf4c709aa4Shih-wei Liao<title>libbcc: A Versatile Bitcode Execution Engine for Mobile Devices</title>
8e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<style type="text/css">
9e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
10e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao/*
11e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao:Author: David Goodger (goodger@python.org)
12e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao:Id: $Id: html4css1.css 5951 2009-05-18 18:03:10Z milde $
13e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao:Copyright: This stylesheet has been placed in the public domain.
14e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
15e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei LiaoDefault cascading style sheet for the HTML output of Docutils.
16e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
17e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei LiaoSee http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
18e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaocustomize this style sheet.
19e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao*/
20e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
21e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao/* used to remove borders from tables and images */
22e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao.borderless, table.borderless td, table.borderless th {
23e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  border: 0 }
24e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
25e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaotable.borderless td, table.borderless th {
26e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  /* Override padding for "table.docutils td" with "! important".
27e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao     The right padding separates the table cells. */
28e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  padding: 0 0.5em 0 0 ! important }
29e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
30e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao.first {
31e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  /* Override more specific margin styles with "! important". */
32e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-top: 0 ! important }
33e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
34e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao.last, .with-subtitle {
35e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-bottom: 0 ! important }
36e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
37e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao.hidden {
38e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  display: none }
39e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
40e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaoa.toc-backref {
41e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  text-decoration: none ;
42e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  color: black }
43e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
44e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaoblockquote.epigraph {
45e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin: 2em 5em ; }
46e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
47e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodl.docutils dd {
48e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-bottom: 0.5em }
49e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
50e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao/* Uncomment (and remove this text!) to get bold-faced definition list terms
51e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodl.docutils dt {
52e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-weight: bold }
53e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao*/
54e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
55e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.abstract {
56e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin: 2em 5em }
57e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
58e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.abstract p.topic-title {
59e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-weight: bold ;
60e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  text-align: center }
61e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
62e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.admonition, div.attention, div.caution, div.danger, div.error,
63e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.hint, div.important, div.note, div.tip, div.warning {
64e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin: 2em ;
65e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  border: medium outset ;
66e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  padding: 1em }
67e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
68e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.admonition p.admonition-title, div.hint p.admonition-title,
69e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.important p.admonition-title, div.note p.admonition-title,
70e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.tip p.admonition-title {
71e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-weight: bold ;
72e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-family: sans-serif }
73e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
74e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.attention p.admonition-title, div.caution p.admonition-title,
75e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.danger p.admonition-title, div.error p.admonition-title,
76e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.warning p.admonition-title {
77e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  color: red ;
78e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-weight: bold ;
79e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-family: sans-serif }
80e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
81e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao/* Uncomment (and remove this text!) to get reduced vertical space in
82e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao   compound paragraphs.
83e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.compound .compound-first, div.compound .compound-middle {
84e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-bottom: 0.5em }
85e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
86e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.compound .compound-last, div.compound .compound-middle {
87e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-top: 0.5em }
88e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao*/
89e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
90e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.dedication {
91e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin: 2em 5em ;
92e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  text-align: center ;
93e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-style: italic }
94e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
95e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.dedication p.topic-title {
96e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-weight: bold ;
97e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-style: normal }
98e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
99e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.figure {
100e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-left: 2em ;
101e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-right: 2em }
102e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
103e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.footer, div.header {
104e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  clear: both;
105e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-size: smaller }
106e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
107e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.line-block {
108e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  display: block ;
109e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-top: 1em ;
110e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-bottom: 1em }
111e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
112e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.line-block div.line-block {
113e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-top: 0 ;
114e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-bottom: 0 ;
115e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-left: 1.5em }
116e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
117e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.sidebar {
118e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin: 0 0 0.5em 1em ;
119e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  border: medium outset ;
120e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  padding: 1em ;
121e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  background-color: #ffffee ;
122e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  width: 40% ;
123e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  float: right ;
124e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  clear: right }
125e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
126e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.sidebar p.rubric {
127e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-family: sans-serif ;
128e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-size: medium }
129e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
130e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.system-messages {
131e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin: 5em }
132e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
133e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.system-messages h1 {
134e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  color: red }
135e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
136e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.system-message {
137e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  border: medium outset ;
138e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  padding: 1em }
139e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
140e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.system-message p.system-message-title {
141e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  color: red ;
142e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-weight: bold }
143e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
144e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.topic {
145e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin: 2em }
146e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
147e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaoh1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
148e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaoh4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
149e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-top: 0.4em }
150e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
151e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaoh1.title {
152e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  text-align: center }
153e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
154e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaoh2.subtitle {
155e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  text-align: center }
156e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
157e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaohr.docutils {
158e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  width: 75% }
159e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
160e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaoimg.align-left, .figure.align-left{
161e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  clear: left ;
162e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  float: left ;
163e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-right: 1em }
164e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
165e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaoimg.align-right, .figure.align-right {
166e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  clear: right ;
167e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  float: right ;
168e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-left: 1em }
169e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
170e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao.align-left {
171e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  text-align: left }
172e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
173e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao.align-center {
174e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  clear: both ;
175e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  text-align: center }
176e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
177e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao.align-right {
178e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  text-align: right }
179e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
180e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao/* reset inner alignment in figures */
181e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaodiv.align-right {
182e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  text-align: left }
183e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
184e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao/* div.align-center * { */
185e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao/*   text-align: left } */
186e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
187e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaool.simple, ul.simple {
188e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-bottom: 1em }
189e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
190e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaool.arabic {
191e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  list-style: decimal }
192e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
193e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaool.loweralpha {
194e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  list-style: lower-alpha }
195e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
196e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaool.upperalpha {
197e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  list-style: upper-alpha }
198e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
199e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaool.lowerroman {
200e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  list-style: lower-roman }
201e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
202e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaool.upperroman {
203e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  list-style: upper-roman }
204e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
205e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaop.attribution {
206e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  text-align: right ;
207e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-left: 50% }
208e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
209e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaop.caption {
210e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-style: italic }
211e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
212e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaop.credits {
213e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-style: italic ;
214e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-size: smaller }
215e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
216e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaop.label {
217e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  white-space: nowrap }
218e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
219e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaop.rubric {
220e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-weight: bold ;
221e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-size: larger ;
222e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  color: maroon ;
223e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  text-align: center }
224e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
225e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaop.sidebar-title {
226e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-family: sans-serif ;
227e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-weight: bold ;
228e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-size: larger }
229e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
230e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaop.sidebar-subtitle {
231e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-family: sans-serif ;
232e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-weight: bold }
233e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
234e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaop.topic-title {
235e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-weight: bold }
236e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
237e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaopre.address {
238e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-bottom: 0 ;
239e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-top: 0 ;
240e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font: inherit }
241e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
242e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaopre.literal-block, pre.doctest-block {
243e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-left: 2em ;
244e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-right: 2em }
245e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
246e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaospan.classifier {
247e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-family: sans-serif ;
248e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-style: oblique }
249e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
250e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaospan.classifier-delimiter {
251e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-family: sans-serif ;
252e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-weight: bold }
253e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
254e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaospan.interpreted {
255e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-family: sans-serif }
256e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
257e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaospan.option {
258e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  white-space: nowrap }
259e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
260e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaospan.pre {
261e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  white-space: pre }
262e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
263e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaospan.problematic {
264e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  color: red }
265e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
266e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaospan.section-subtitle {
267e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  /* font-size relative to parent (h1..h6 element) */
268e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-size: 80% }
269e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
270e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaotable.citation {
271e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  border-left: solid 1px gray;
272e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-left: 1px }
273e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
274e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaotable.docinfo {
275e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin: 2em 4em }
276e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
277e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaotable.docutils {
278e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-top: 0.5em ;
279e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-bottom: 0.5em }
280e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
281e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaotable.footnote {
282e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  border-left: solid 1px black;
283e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  margin-left: 1px }
284e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
285e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaotable.docutils td, table.docutils th,
286e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaotable.docinfo td, table.docinfo th {
287e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  padding-left: 0.5em ;
288e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  padding-right: 0.5em ;
289e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  vertical-align: top }
290e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
291e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaotable.docutils th.field-name, table.docinfo th.docinfo-name {
292e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-weight: bold ;
293e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  text-align: left ;
294e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  white-space: nowrap ;
295e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  padding-left: 0 }
296e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
297e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaoh1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
298e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaoh4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
299e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  font-size: 100% }
300e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
301e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaoul.auto-toc {
302e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao  list-style-type: none }
303e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
304e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</style>
305e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</head>
306e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<body>
307cecdab21b205a7cd8910e25c540d57bf4c709aa4Shih-wei Liao<div class="document" id="libbcc-a-versatile-bitcode-execution-engine-for-mobile-devices">
308cecdab21b205a7cd8910e25c540d57bf4c709aa4Shih-wei Liao<h1 class="title">libbcc: A Versatile Bitcode Execution Engine for Mobile Devices</h1>
309e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao
310e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<div class="section" id="introduction">
311e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<h1>Introduction</h1>
3127fff228542fa7dea6ea161063429b8152c57c488Shih-wei Liao<p>libbcc is an LLVM bitcode execution engine that compiles the bitcode
313cecdab21b205a7cd8910e25c540d57bf4c709aa4Shih-wei Liaoto an in-memory executable. libbcc is versatile because:</p>
314cecdab21b205a7cd8910e25c540d57bf4c709aa4Shih-wei Liao<ul class="simple">
315be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao<li>it implements both AOT (Ahead-of-Time) and JIT (Just-in-Time)
316be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaocompilation.</li>
317be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao<li>Android devices demand fast start-up time, small size, and high
318be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaoperformance <em>at the same time</em>. libbcc attempts to address these
319be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaodesign constraints.</li>
320be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao<li>it supports on-device linking. Each device vendor can supply his or
321be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaoher own runtime bitcode library (lib*.bc) that differentiates his or
322be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaoher system. Specialization becomes ecosystem-friendly.</li>
323cecdab21b205a7cd8910e25c540d57bf4c709aa4Shih-wei Liao</ul>
3247fff228542fa7dea6ea161063429b8152c57c488Shih-wei Liao<p>libbcc provides:</p>
325e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<ul class="simple">
326be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao<li>a <em>just-in-time bitcode compiler</em>, which translates the LLVM bitcode
327be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaointo machine code</li>
3287fff228542fa7dea6ea161063429b8152c57c488Shih-wei Liao<li>a <em>caching mechanism</em>, which can:<ul>
329be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao<li>after each compilation, serialize the in-memory executable into a
330be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaocache file.  Note that the compilation is triggered by a cache
331be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaomiss.</li>
3327fff228542fa7dea6ea161063429b8152c57c488Shih-wei Liao<li>load from the cache file upon cache-hit.</li>
3337fff228542fa7dea6ea161063429b8152c57c488Shih-wei Liao</ul>
3347fff228542fa7dea6ea161063429b8152c57c488Shih-wei Liao</li>
3357fff228542fa7dea6ea161063429b8152c57c488Shih-wei Liao</ul>
3360dc51b1873ba340722f483eb2a639922360fbaf9Shih-wei Liao<p>Highlights of libbcc are:</p>
337be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao<ul>
338be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao<li><p class="first">libbcc supports bitcode from various language frontends, such as
339e198abec6c5e3eab380ccf6897b0a0b9c2dd92ddStephen HinesRenderscript, GLSL (pixelflinger2).</p>
340be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao</li>
341be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao<li><p class="first">libbcc strives to balance between library size, launch time and
342be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaosteady-state performance:</p>
343be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao<ul>
344be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao<li><p class="first">The size of libbcc is aggressively reduced for mobile devices. We
345be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaocustomize and improve upon the default Execution Engine from
346be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaoupstream. Otherwise, libbcc's execution engine can easily become
347be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaoat least 2 times bigger.</p>
348be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao</li>
349be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao<li><p class="first">To reduce launch time, we support caching of
350be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaobinaries. Just-in-Time compilation are oftentimes Just-too-Late,
351be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaoif the given apps are performance-sensitive. Thus, we implemented
352be849444026ddd3b864164d96068b37c231440c1Shih-wei LiaoAOT to get the best of both worlds: Fast launch time and high
353be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaosteady-state performance.</p>
354be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao<p>AOT is also important for projects such as NDK on LLVM with
355be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaoportability enhancement. Launch time reduction after we
356be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaoimplemented AOT is signficant:</p>
357be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao<pre class="literal-block">
358be849444026ddd3b864164d96068b37c231440c1Shih-wei LiaoApps          libbcc without AOT       libbcc with AOT
359be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao              launch time in libbcc    launch time in libbcc
360be849444026ddd3b864164d96068b37c231440c1Shih-wei LiaoApp_1            1218ms                   9ms
361be849444026ddd3b864164d96068b37c231440c1Shih-wei LiaoApp_2            842ms                    4ms
362be849444026ddd3b864164d96068b37c231440c1Shih-wei LiaoWallpaper:
363be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao  MagicSmoke     182ms                    3ms
364be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao  Halo           127ms                    3ms
365be849444026ddd3b864164d96068b37c231440c1Shih-wei LiaoBalls            149ms                    3ms
366be849444026ddd3b864164d96068b37c231440c1Shih-wei LiaoSceneGraph       146ms                    90ms
367be849444026ddd3b864164d96068b37c231440c1Shih-wei LiaoModel            104ms                    4ms
368be849444026ddd3b864164d96068b37c231440c1Shih-wei LiaoFountain         57ms                     3ms
369be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao</pre>
370be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao<p>AOT also masks the launching time overhead of on-device linking
371be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaoand helps it become reality.</p>
372be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao</li>
373be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao<li><p class="first">For steady-state performance, we enable VFP3 and aggressive
374be849444026ddd3b864164d96068b37c231440c1Shih-wei Liaooptimizations.</p>
375be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao</li>
376e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</ul>
377e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</li>
378be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao<li><p class="first">Currently we disable Lazy JITting.</p>
379be849444026ddd3b864164d96068b37c231440c1Shih-wei Liao</li>
380e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</ul>
381e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</div>
382e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<div class="section" id="api">
383e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<h1>API</h1>
3847fff228542fa7dea6ea161063429b8152c57c488Shih-wei Liao<p><strong>Basic:</strong></p>
385e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<ul class="simple">
386e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<li><strong>bccCreateScript</strong> - Create new bcc script</li>
387e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<li><strong>bccRegisterSymbolCallback</strong> - Register the callback function for external
388e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaosymbol lookup</li>
389e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<li><strong>bccReadBC</strong> - Set the source bitcode for compilation</li>
390e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<li><strong>bccReadModule</strong> - Set the llvm::Module for compilation</li>
391e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<li><strong>bccLinkBC</strong> - Set the library bitcode for linking</li>
392d9db38a7163c471e00019091f5c2dc0f05d742efLogan Chien<li><strong>bccPrepareExecutable</strong> - <em>deprecated</em> - Use bccPrepareExecutableEx instead</li>
393d9db38a7163c471e00019091f5c2dc0f05d742efLogan Chien<li><strong>bccPrepareExecutableEx</strong> - Create the in-memory executable by either
394e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaojust-in-time compilation or cache loading</li>
395f340bf71ff377979d279132dcf5a801d76747d1fLogan<li><strong>bccGetFuncAddr</strong> - Get the entry address of the function</li>
396f340bf71ff377979d279132dcf5a801d76747d1fLogan<li><strong>bccDisposeScript</strong> - Destroy bcc script and release the resources</li>
397f340bf71ff377979d279132dcf5a801d76747d1fLogan<li><strong>bccGetError</strong> - <em>deprecated</em> - Don't use this</li>
398e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</ul>
3997fff228542fa7dea6ea161063429b8152c57c488Shih-wei Liao<p><strong>Reflection:</strong></p>
400e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<ul class="simple">
401f340bf71ff377979d279132dcf5a801d76747d1fLogan<li><strong>bccGetExportVarCount</strong> - Get the count of exported variables</li>
402f340bf71ff377979d279132dcf5a801d76747d1fLogan<li><strong>bccGetExportVarList</strong> - Get the addresses of exported variables</li>
403f340bf71ff377979d279132dcf5a801d76747d1fLogan<li><strong>bccGetExportFuncCount</strong> - Get the count of exported functions</li>
404f340bf71ff377979d279132dcf5a801d76747d1fLogan<li><strong>bccGetExportFuncList</strong> - Get the addresses of exported functions</li>
405f340bf71ff377979d279132dcf5a801d76747d1fLogan<li><strong>bccGetPragmaCount</strong> - Get the count of pragmas</li>
406f340bf71ff377979d279132dcf5a801d76747d1fLogan<li><strong>bccGetPragmaList</strong> - Get the pragmas</li>
407e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</ul>
4087fff228542fa7dea6ea161063429b8152c57c488Shih-wei Liao<p><strong>Debug:</strong></p>
409e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<ul class="simple">
410f340bf71ff377979d279132dcf5a801d76747d1fLogan<li><strong>bccGetFuncCount</strong> - Get the count of functions (including non-exported)</li>
411f340bf71ff377979d279132dcf5a801d76747d1fLogan<li><strong>bccGetFuncInfoList</strong> - Get the function information (name, base, size)</li>
412e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</ul>
413e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</div>
414e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<div class="section" id="cache-file-format">
415e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<h1>Cache File Format</h1>
416e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<p>A cache file (denoted as *.oBCC) for libbcc consists of several sections:
417e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaoheader, string pool, dependencies table, relocation table, exported
418e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaovariable list, exported function list, pragma list, function information
419e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaotable, and bcc context.  Every section should be aligned to a word size.
420e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei LiaoHere is the brief description of each sections:</p>
421e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<ul class="simple">
4220e56786df8c1d4828798f91fe2bf850d414ee04fStephen Hines<li><strong>Header</strong> (MCO_Header) - The header of a cache file. It contains the
423cecdab21b205a7cd8910e25c540d57bf4c709aa4Shih-wei Liaomagic word, version, machine integer type information (the endianness,
424cecdab21b205a7cd8910e25c540d57bf4c709aa4Shih-wei Liaothe size of off_t, size_t, and ptr_t), and the size
425cecdab21b205a7cd8910e25c540d57bf4c709aa4Shih-wei Liaoand offset of other sections.  The header section is guaranteed
426e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaoto be at the beginning of the cache file.</li>
4270e56786df8c1d4828798f91fe2bf850d414ee04fStephen Hines<li><strong>String Pool</strong> (MCO_StringPool) - A collection of serialized variable
428e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaolength strings.  The strp_index in the other part of the cache file
429e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaorepresents the index of such string in this string pool.</li>
4300e56786df8c1d4828798f91fe2bf850d414ee04fStephen Hines<li><strong>Dependencies Table</strong> (MCO_DependencyTable) - The dependencies table.
4318538dfa267837f95d83a0828e5c56a14d708b7b6Shih-wei LiaoThis table stores the resource name (or file path), the resource
432e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaotype (rather in APK or on the file system), and the SHA1 checksum.</li>
4330e56786df8c1d4828798f91fe2bf850d414ee04fStephen Hines<li><strong>Relocation Table</strong> (MCO_RelocationTable) - <em>not enabled</em></li>
4340e56786df8c1d4828798f91fe2bf850d414ee04fStephen Hines<li><strong>Exported Variable List</strong> (MCO_ExportVarList) -
435ac4e45840bade73558330a60ae26f3eab02f7db2Shih-wei LiaoThe list of the addresses of exported variables.</li>
4360e56786df8c1d4828798f91fe2bf850d414ee04fStephen Hines<li><strong>Exported Function List</strong> (MCO_ExportFuncList) -
437ac4e45840bade73558330a60ae26f3eab02f7db2Shih-wei LiaoThe list of the addresses of exported functions.</li>
4380e56786df8c1d4828798f91fe2bf850d414ee04fStephen Hines<li><strong>Pragma List</strong> (MCO_PragmaList) - The list of pragma key-value pair.</li>
4390e56786df8c1d4828798f91fe2bf850d414ee04fStephen Hines<li><strong>Function Information Table</strong> (MCO_FuncTable) - This is a table of
440e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaofunction information, such as function name, function entry address,
441e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaoand function binary size.  Besides, the table should be ordered by
442e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaofunction name.</li>
443e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<li><strong>Context</strong> - The context of the in-memory executable, including
444e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaothe code and the data.  The offset of context should aligned to
4450dc51b1873ba340722f483eb2a639922360fbaf9Shih-wei Liaoa page size, so that we can mmap the context directly into memory.</li>
446e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</ul>
447e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<p>For furthur information, you may read <a class="reference external" href="include/bcc/bcc_cache.h">bcc_cache.h</a>,
448e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<a class="reference external" href="lib/bcc/CacheReader.cpp">CacheReader.cpp</a>, and
449e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<a class="reference external" href="lib/bcc/CacheWriter.cpp">CacheWriter.cpp</a> for details.</p>
450e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</div>
451e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<div class="section" id="jit-ed-code-calling-conventions">
452e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<h1>JIT'ed Code Calling Conventions</h1>
453e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<ol class="arabic">
454e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<li><p class="first">Calls from Execution Environment or from/to within script:</p>
455e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<p>On ARM, the first 4 arguments will go into r0, r1, r2, and r3, in that order.
456e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei LiaoThe remaining (if any) will go through stack.</p>
457e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<p>For ext_vec_types such as float2, a set of registers will be used. In the case
458e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaoof float2, a register pair will be used. Specifically, if float2 is the first
459e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaoargument in the function prototype, float2.x will go into r0, and float2.y,
460e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaor1.</p>
461e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<p>Note: stack will be aligned to the coarsest-grained argument. In the case of
462e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaofloat2 above as an argument, parameter stack will be aligned to an 8-byte
463e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liaoboundary (if the sizes of other arguments are no greater than 8.)</p>
464e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</li>
465e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<li><p class="first">Calls from/to a separate compilation unit: (E.g., calls to Execution
466e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei LiaoEnvironment if those runtime library callees are not compiled using LLVM.)</p>
467e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao<p>On ARM, we use hardfp.  Note that double will be placed in a register pair.</p>
468e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</li>
469e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</ol>
470e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</div>
471e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</div>
472e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</body>
473e961c66347eb5dbe4f36004a71c58ca22e18d8c1Shih-wei Liao</html>
474