鸿蒙ACE-资料和介绍

564 阅读3分钟

ACE是Ark Compiler Engine的缩写。即方舟编译器引擎等工具,主要包括以下的部分

arkcompiler_toolchain

方舟工具链组件为开发者提供调试(Debugger), 性能调优(CPUProfiler), 内存调优(HeapProfiler)等针对ArkTS应用程序的调试调优工具

image.png

arkui_ace_engine

布局引擎提供开发者进行应用UI开发时所必需的能力,包括UI组件、动画、绘制、交互事件、JS API扩展机制等。

image.png

arkcompiler_ets_runtime

运行时OpenHarmony上默认的ArkTS语言运行时。支持Ecmascript规范定义的标准库和高效container容器库,提供完备的C++交互ArkTS NAPI和各种高性能的垃圾回收器,驱动着万物互联时代的OpenHarmony应用程序

image.png

arkcompiler_runtime_core

方舟运行时公共组件主要由与语言无关的基础运行库组成,包含承载字节码以及执行字节码所需要相关信息的ArkCompiler File文件组件、支持运行时调试的Debugger Tooling工具组件、提供不同系统平台公共接口的ArkCompiler Base基础库组件、以及与语言无关的公共指令集体系结构ISA等

image.png

arkui_advanced_ui_component

一些高级UI组件

image.png

arkcompiler_ets_frontend

方舟运行时子系统的前端工具。结合ace-ets2bundle组件,支持将ets文件转换为方舟字节码文件

image.png

developtools_ace_ets2bundle

声明式范式的语法编译转换提供声明式范式的语法编译转换,语法验证

gitee.com/arkui-x

跨平台声明式UI

image.png

方舟编译器

编译工具链架构

以ArkTS/TS/JS源码作为输入,将其编译生成为abc(ArkCompiler Bytecode,即方舟字节码)文件

image.png

运行时

gitee.com/openharmony…

运行字节码文件,实现对应语言规范的语义逻辑。

  • 仅支持运行方舟eTS编译器(ts2abc或es2abc)生成的方舟字节码文件
  • 只支持ES2021标准和严格模式(use strict)
  • 不支持通过字符串动态创建函数(比如new Function("console.log(1);"))

主要由四个子系统组成:

Core Subsystem:方舟运行时公共组件

gitee.com/openharmony…

主要由与语言无关的基础运行库组成,包含承载字节码以及执行字节码所需要相关信息的ArkCompiler File文件组件、支持运行时调试的Debugger Tooling工具组件、提供不同系统平台公共接口的ArkCompiler Base基础库组件、以及与语言无关的公共指令集体系结构ISA等

Execution Subsystem:

包含执行字节码的解释器、快速路径内联缓存、以及抓取运行时信息的Profiler

关于方舟字节码和方舟字节码文件可以参考

方舟字节码基本原理 developer.huawei.com/consumer/cn…

方舟字节码文件格式 developer.huawei.com/consumer/cn…

Compiler Subsystem:

包含Stub编译器、基于IR的编译优化框架和代码生成器

Runtime subsystem:

包含ArkTS/TS/JS运行相关的模块。

  • 内存管理:对象分配器与垃圾回收器(并发标记和部分内存压缩的CMS-GC和Partial-Compressing-GC)
  • 分析工具:DFX工具、cpu和heap的profiling工具
  • 并发管理:actor并发模型中的abc文件管理器
  • 标准库:Ecmascript规范定义的标准库、高效的container容器库与对象模型
  • 其他:异步工作队列、TypeScript类型加载、跟C++交互的JSNAPI接口等。

实用链接

  1. OpenHarmony官仓 https://gitee.com/openharmony
  2. OpenHarmony文档 https://gitee.com/openharmony/docs/tree/master/zh-cn/readme
  3. ArkUI开发框架 引擎 https://gitee.com/openharmony/arkui_ace_engine
  4. 声明式范式的语法编译转换 https://gitee.com/openharmony/developtools_ace_ets2bundle
  5. advanced_ui_component gitee.com/openharmony…
  6. 方舟工具链组件 gitee.com/openharmony…
  7. 方舟运行时子系统 https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/ARK-Runtime-Subsystem-zh.md
  8. 方舟eTS运行时部件 https://gitee.com/openharmony/arkcompiler_ets_runtime
  9. 方舟运行时公共组件 gitee.com/openharmony…
  10. 图形UI组件 https://gitee.com/openharmony/arkui_ui_lite
  11. 2D图形 https://gitee.com/openharmony/graphic_graphic_2d
  12. 元能力子系统 gitee.com/openharmony…
  13. 元能力基础部件 gitee.com/openharmony…
  14. ArkUI-X gitee.com/arkui-x/doc…
  15. ArkUI-X仓库 https://gitee.com/arkui-x
  16. HDC-OpenHarmony设备连接器 https://gitee.com/openharmony/developtools_hdc
  17. 方舟运行时子系统的前端工具 gitee.com/openharmony…