Add result of mathmatical calculations and show result in AST · Pull Request !1203 · OpenHarmony/arkcompiler

您所在的位置:网站首页 ets1203 Add result of mathmatical calculations and show result in AST · Pull Request !1203 · OpenHarmony/arkcompiler

Add result of mathmatical calculations and show result in AST · Pull Request !1203 · OpenHarmony/arkcompiler

2024-03-11 17:23| 来源: 网络整理| 查看: 265

Description Add result of mathmatical calculations and show result in AST

1 Background Arkcompiler loads numbers and operators sequentially in the parser stage. If AST contains too many calculation processes, it can lead to complex generated bytecodes and poor execution performance in runtime. 1.1 Phenomenon Case

var a = 6*7;

Actual and expected print in ast 输入图片说明 Actual and expected print in bytecode 输入图片说明

2 Research

2.1 V8

V8 keep calculation results in AST 输入图片说明

2.2 ToInt32() && ToUint32() https://tc39.es/ecma262/#sec-toint32 输入图片说明

Issue #I7ESMP:Add result of mathmatical calculations and show result in AST

Tests Tests262 输入图片说明 Compiler 输入图片说明 Parser 输入图片说明 Tsc 输入图片说明 Hotfix 输入图片说明 Base64 输入图片说明 Type-extractor known problem 输入图片说明 Bytecode 输入图片说明



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3