Back to home page

Android Cross Reference



This directory contains the Dalvik virtual machine and core class library, as well as related tools, libraries, and tests.
A note about the licenses and header comments
Much of the code under this directory originally came from the Apache Harmony project, and as such contains the standard Apache header comment. Some of the code was written originally for the Android project, and as such contains the standard Android header comment. Some files contain code from both projects. In these cases, the header comment is a combination of the other two, and the portions of the code from Harmony are identified as indicated in the comment.


  Name Size Date (UTC) Last indexed Description
  Name Size Date (UTC) Last indexed Description
folder ../ Parent directory - 2013-05-25 01:49:29  
folder dalvikvm/ dalvikvm/ - 2013-05-25 01:42:59  
folder dexdump/ dexdump/ - 2013-05-25 01:43:00  
folder dexgen/ dexgen/ - 2013-05-25 01:43:01

Home of dexgen, the dex code generator project. It provides API for creating dex classes in runtime which is needed e.g. for class mocking. This solution is based on the dx tool and uses its classes extensively.

folder dexlist/ dexlist/ - 2013-05-25 01:42:59  
folder dexopt/ dexopt/ - 2013-05-25 01:42:59  
folder docs/ docs/ - 2013-05-25 01:43:00  
folder dvz/ dvz/ - 2013-05-25 01:43:01  
folder dx/ dx/ - 2013-05-25 01:43:01

Home of Dalvik eXchange, the thing that takes in class files and reformulates them for consumption in the VM. It also does a few other things; use "dx --help" to see a modicum of self-documentation.

folder hit/ hit/ - 2013-05-25 01:43:00  
folder libdex/ libdex/ - 2013-05-25 01:43:00  
folder opcode-gen/ opcode-gen/ - 2013-05-25 01:43:00

# Copyright (C) 2010 The Android Open Source Project
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.


folder tests/ tests/ - 2013-05-25 01:43:01

VM test harness.
Use "./run-all-tests" to run all tests, or "./run-test <number>" to run a single test. Run "./run-test" with no arguments to see command flags; in particular, the tests can be run on the desktop, on a USB-attached device, or using the desktop "reference implementation".
For most tests, the sources are in the "src" subdirectory. Sources found in the "src2" directory are compiled separately but to the same output directory; this can be used to exercise "API mismatch" situations by replacing class files created in the first pass. The "src-ex" directory is built separately, and is intended for exercising class loaders.

folder tools/ tools/ - 2013-05-25 01:43:00  
folder unit-tests/ unit-tests/ - 2013-05-25 01:42:59  
folder vm/ vm/ - 2013-05-25 01:43:01

Dalvik Virtual Machine
Source code rules of the road:
- All externally-visible function names must start with "dvm" to avoid namespace clashes. Use static functions when possible.
- Do not create static variables (globally or locally). Do not create global variables. Keep everything with non-local lifespan in "gDvm", defined in Globals.h, so that all global VM state is in one place.
- Use "startup" and "shutdown" functions to clean up gDvm. The VM must exit cleanly in valgrind.
- The primary target is ARM Linux. Others are secondary, but must still work correctly.
- Use of gcc-specific and C99 constructs is allowed. 1919 bytes 2013-05-25 01:43:00 2013-05-26 00:55:28 2739 bytes 2013-05-25 01:43:01 2013-05-26 00:55:29  
MODULE_LICENSE_APACHE2 0 bytes 2013-05-25 01:43:01 -  
NOTICE 10695 bytes 2013-05-25 01:43:01 -  
README.txt 2522 bytes 2013-05-25 01:42:59 -