• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023 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 */
15
16declare var ArkTools:any;
17for (let i = 0; i < 10; ++i) {
18    Math;
19}
20ArkTools.printTypedOpProfilerAndReset("LOAD_BUILTIN_OBJECT");
21ArkTools.printTypedOpProfilerAndReset("LOAD_PROPERTY");
22
23for (let i = 0; i < 1; ++i) {
24    for (let j = 0; j < 10; ++j) {
25        Math;
26    }
27}
28ArkTools.printTypedOpProfilerAndReset("LOAD_BUILTIN_OBJECT");
29ArkTools.printTypedOpProfilerAndReset("LOAD_PROPERTY");
30
31for (let i = 0; i < 10; ++i) {
32    Math.sqrt;
33}
34ArkTools.printTypedOpProfilerAndReset("LOAD_BUILTIN_OBJECT");
35ArkTools.printTypedOpProfilerAndReset("LOAD_PROPERTY");
36
37for (let i = 0; i < 1; ++i) {
38    for (let j = 0; j < 10; ++j) {
39        Math.sqrt;
40    }
41}
42ArkTools.printTypedOpProfilerAndReset("LOAD_BUILTIN_OBJECT");
43ArkTools.printTypedOpProfilerAndReset("LOAD_PROPERTY");
44
45for (let i = 0; i < 10; ++i) {
46    Math.sqrt(4);
47}
48ArkTools.printTypedOpProfilerAndReset("LOAD_BUILTIN_OBJECT");
49ArkTools.printTypedOpProfilerAndReset("LOAD_PROPERTY");
50
51for (let i = 0; i < 1; ++i) {
52    for (let j = 0; j < 10; ++j) {
53        Math.sqrt(4);
54    }
55}
56ArkTools.printTypedOpProfilerAndReset("LOAD_BUILTIN_OBJECT");
57ArkTools.printTypedOpProfilerAndReset("LOAD_PROPERTY");
58