• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15declare function print(arg: any): string;
16declare interface ArkTools {
17    isAOTCompiled(args: any): boolean;
18}
19let buffer = new ArrayBuffer(4);
20let sample = new DataView(buffer, 0);
21
22//aot: [trace] aot inline builtin: DataView.prototype.SetFloat32, caller function name:func_main_0@builtinDataViewFloat32
23sample.setFloat32(0);
24//aot: [trace] aot inline builtin: DataView.prototype.GetFloat32, caller function name:func_main_0@builtinDataViewFloat32
25print(sample.getFloat32(0)) //: NaN
26//aot: [trace] aot inline builtin: DataView.prototype.GetUint32, caller function name:func_main_0@builtinDataViewFloat32
27//aot: [trace] aot call builtin: Number.ToStringFunc, caller function name:func_main_0@builtinDataViewFloat32
28print(sample.getUint32(0).toString(16)) //: 7fc00000
29
30//aot: [trace] aot inline builtin: DataView.prototype.SetFloat32, caller function name:func_main_0@builtinDataViewFloat32
31sample.setFloat32(0, NaN, true);
32//aot: [trace] aot inline builtin: DataView.prototype.GetFloat32, caller function name:func_main_0@builtinDataViewFloat32
33print(sample.getFloat32(0, true)) //: NaN
34//aot: [trace] aot inline builtin: DataView.prototype.GetUint32, caller function name:func_main_0@builtinDataViewFloat32
35//aot: [trace] aot call builtin: Number.ToStringFunc, caller function name:func_main_0@builtinDataViewFloat32
36print(sample.getUint32(0, true).toString(16)) //: 7fc00000
37
38//aot: [trace] aot inline builtin: DataView.prototype.SetUint32, caller function name:func_main_0@builtinDataViewFloat32
39sample.setUint32(0, 0xC07F);
40//aot: [trace] aot inline builtin: DataView.prototype.GetFloat32, caller function name:func_main_0@builtinDataViewFloat32
41print(sample.getFloat32(0)) //: 6.905458702346266e-41
42//aot: [trace] aot inline builtin: DataView.prototype.GetUint32, caller function name:func_main_0@builtinDataViewFloat32
43//aot: [trace] aot call builtin: Number.ToStringFunc, caller function name:func_main_0@builtinDataViewFloat32
44print(sample.getUint32(0).toString(16)) //: c07f
45
46//aot: [trace] aot inline builtin: DataView.prototype.SetUint32, caller function name:func_main_0@builtinDataViewFloat32
47sample.setUint32(0, 0xC07F, true);
48//aot: [trace] aot inline builtin: DataView.prototype.GetFloat32, caller function name:func_main_0@builtinDataViewFloat32
49print(sample.getFloat32(0, true)) //: 6.905458702346266e-41
50//aot: [trace] aot inline builtin: DataView.prototype.GetUint32, caller function name:func_main_0@builtinDataViewFloat32
51//aot: [trace] aot call builtin: Number.ToStringFunc, caller function name:func_main_0@builtinDataViewFloat32
52print(sample.getUint32(0, true).toString(16)) //: c07f
53
54//aot: [trace] aot inline builtin: DataView.prototype.SetUint8, caller function name:func_main_0@builtinDataViewFloat32
55sample.setUint8(0, 0x00);
56//aot: [trace] aot inline builtin: DataView.prototype.SetUint8, caller function name:func_main_0@builtinDataViewFloat32
57sample.setUint8(1, 0x00);
58//aot: [trace] aot inline builtin: DataView.prototype.SetUint8, caller function name:func_main_0@builtinDataViewFloat32
59sample.setUint8(2, 0xC0);
60//aot: [trace] aot inline builtin: DataView.prototype.SetUint8, caller function name:func_main_0@builtinDataViewFloat32
61sample.setUint8(3, 0x7F);
62//aot: [trace] aot inline builtin: DataView.prototype.GetFloat32, caller function name:func_main_0@builtinDataViewFloat32
63print(sample.getFloat32(0)) //: 6.905458702346266e-41
64//aot: [trace] aot inline builtin: DataView.prototype.GetUint32, caller function name:func_main_0@builtinDataViewFloat32
65//aot: [trace] aot call builtin: Number.ToStringFunc, caller function name:func_main_0@builtinDataViewFloat32
66print(sample.getUint32(0).toString(16)) //: c07f
67
68//aot: [trace] aot inline builtin: DataView.prototype.SetUint8, caller function name:func_main_0@builtinDataViewFloat32
69sample.setUint8(0, 0x00);
70//aot: [trace] aot inline builtin: DataView.prototype.SetUint8, caller function name:func_main_0@builtinDataViewFloat32
71sample.setUint8(1, 0x00);
72//aot: [trace] aot inline builtin: DataView.prototype.SetUint8, caller function name:func_main_0@builtinDataViewFloat32
73sample.setUint8(2, 0xC0);
74//aot: [trace] aot inline builtin: DataView.prototype.SetUint8, caller function name:func_main_0@builtinDataViewFloat32
75sample.setUint8(3, 0x7F);
76//aot: [trace] aot inline builtin: DataView.prototype.GetFloat32, caller function name:func_main_0@builtinDataViewFloat32
77print(sample.getFloat32(0, true)) //: NaN
78//aot: [trace] aot inline builtin: DataView.prototype.GetUint32, caller function name:func_main_0@builtinDataViewFloat32
79//aot: [trace] aot call builtin: Number.ToStringFunc, caller function name:func_main_0@builtinDataViewFloat32
80print(sample.getUint32(0, true).toString(16)) //: 7fc00000
81
82//aot: [trace] aot inline builtin: DataView.prototype.SetUint8, caller function name:func_main_0@builtinDataViewFloat32
83sample.setUint8(0, 0x7F);
84//aot: [trace] aot inline builtin: DataView.prototype.SetUint8, caller function name:func_main_0@builtinDataViewFloat32
85sample.setUint8(1, 0xC0);
86//aot: [trace] aot inline builtin: DataView.prototype.SetUint8, caller function name:func_main_0@builtinDataViewFloat32
87sample.setUint8(2, 0x00);
88//aot: [trace] aot inline builtin: DataView.prototype.SetUint8, caller function name:func_main_0@builtinDataViewFloat32
89sample.setUint8(3, 0x00);
90//aot: [trace] aot inline builtin: DataView.prototype.GetFloat32, caller function name:func_main_0@builtinDataViewFloat32
91print(sample.getFloat32(0)) //: NaN
92//aot: [trace] aot inline builtin: DataView.prototype.GetUint32, caller function name:func_main_0@builtinDataViewFloat32
93//aot: [trace] aot call builtin: Number.ToStringFunc, caller function name:func_main_0@builtinDataViewFloat32
94print(sample.getUint32(0).toString(16)) //: 7fc00000
95
96//aot: [trace] aot inline builtin: DataView.prototype.SetUint8, caller function name:func_main_0@builtinDataViewFloat32
97sample.setUint8(0, 0x7F);
98//aot: [trace] aot inline builtin: DataView.prototype.SetUint8, caller function name:func_main_0@builtinDataViewFloat32
99sample.setUint8(1, 0xC0);
100//aot: [trace] aot inline builtin: DataView.prototype.SetUint8, caller function name:func_main_0@builtinDataViewFloat32
101sample.setUint8(2, 0x00);
102//aot: [trace] aot inline builtin: DataView.prototype.SetUint8, caller function name:func_main_0@builtinDataViewFloat32
103sample.setUint8(3, 0x00);
104//aot: [trace] aot inline builtin: DataView.prototype.GetFloat32, caller function name:func_main_0@builtinDataViewFloat32
105print(sample.getFloat32(0, true)) //: 6.905458702346266e-41
106//aot: [trace] aot inline builtin: DataView.prototype.GetUint32, caller function name:func_main_0@builtinDataViewFloat32
107//aot: [trace] aot call builtin: Number.ToStringFunc, caller function name:func_main_0@builtinDataViewFloat32
108print(sample.getUint32(0, true).toString(16)) //: c07f