Dalvik Source Code Structure and Components

摘要:阅读程序源代码是了解程序构架的途径之一。本文介绍了Android中Dalvik虚拟机目录层次结构,并从一个Java虚拟机的角度对dalvik目录结构下的每个文件夹功能作了一定解释。

关键字:Android,Dalvik,代码结构

 

Dalvik source code structure

This article gives an introduction of Dalvik VM source code structure and components on Dalvik system

There are two core components in dalvik VM, one is libdex, which gives the specification of dex file format. The other is VM, which runs the program. Below is the structure of dalvik system source code.

Dalvik
--Core
  --libdex: gives specification of dex file format
  --VM: dalvik vm excution engine
--Others
  --dalvikvm: only contains dalvik vm main function. (Make it easier for code reader to find main function?)
  --dx: a class2dex tool
  --dxopt: sounds like a static dx optimization tool
  --dexdump: sounds like a dex file dumper(imagining Javap)
  --dexlist: same as dexdump?
  --dvz: (Don't know yet)
  --hit: sounds like a tool which receive data from hprofile and produce profiles
  --tools
    --hprof: system profiler
    --dexdeps: (Don't know yet)
    --dmtrace: (Don't know yet)
    --gdbjithelper: sounds like a interface which help using gdb via JIT interface

In the dalvik structure, the libdex is the key(interface) for most external tools(dx, dexdump), but the most complex component is still VM. Below is the structure of dalvik vm source code. I separate the folders in a Java virtual machine's perspective.

VM
--ClassLoader parts
  --(there is no folder for this, perhaps in some separated files)
--JIT parts
  --analysis: sounds like gives some code analysis
  --interp: an interpreter
  --compiler: an just in time compiler (these is only arm dictionary below compiler's codegen dictionary, is that means for x86 and other architectures
              dalvik use only interpreter?)
  --mterp: a very architecture-based component, but don't know the function yet, may be a instruction set for interpreter.
--Memory parts
  --alloc: memory and GC components
--Object layout parts
  --OO: object layout
--Thread parts
  --(there is no folder for this, perhaps in some separated files)
--Debug UTIL parts
  --jdwp: Java debug wire protocol
  --hprofile: hprofile
--Others
  --reflect: Java reflecting
  --arch : (Don't know yet)
  --native : (Don't know yet)
  --other files

Next blog I will trace HelloWorld step by step and give the work-flow of entire dalvik system. And the blog after that will give the detail introduction of dex file format.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Android虚拟机Dalvik完整源码,宝贵资源,欢迎下载! 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. Here is the combined header comment: /* * Copyright (C) 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * 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. * * ---------- * * Portions of the code surrounded by "// BEGIN Harmony code" and * "// END Harmony code" are copyrighted and licensed separately, as * follows: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * 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. */ Native SH call bridge --------------------- Native SH call bridge is written by Shin-ichiro KAWASAKI and Contributed to Android by Hitachi, Ltd. and Renesas Solutions Corp.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值