HELLO·Android
系统源代码
IT资讯
技术文章
我的收藏
注册
登录
-
我收藏的文章
创建代码块
我的代码块
我的账号
Android 10
|
10.0.0_r6
下载
查看原文件
收藏
根目录
art
test
706-checker-scheduler
src
Main.java
/* * Copyright (C) 2016 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. */ public class Main { public class ExampleObj { int n1; int n2; public ExampleObj(int n1, int n2) { this.n1 = n1; this.n2 = n2; } } static int static_variable = 0; public ExampleObj my_obj; public static int number1; public static int number2; public static volatile int number3; /// CHECK-START-ARM64: int Main.arrayAccess() scheduler (before) /// CHECK: <
> IntConstant 1 /// CHECK: <
> Phi /// CHECK: <
> Phi /// CHECK: <
> IntermediateAddress /// CHECK: <
> ArrayGet [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> ArrayGet [<
>,<
>] /// CHECK: Add [<
>,<
>] /// CHECK-START-ARM64: int Main.arrayAccess() scheduler (after) /// CHECK: <
> IntConstant 1 /// CHECK: <
> Phi /// CHECK: <
> Phi /// CHECK: <
> IntermediateAddress /// CHECK: <
> ArrayGet [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> ArrayGet [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: Add [<
>,<
>] public static int arrayAccess() { int res = 0; int [] array = new int[10]; for (int i = 0; i < 9; i++) { res += array[i]; res += array[i + 1]; } return res; } /// CHECK-START-ARM: void Main.arrayAccessVariable(int) scheduler (before) /// CHECK: <
> ParameterValue /// CHECK-DAG: <
> IntConstant 1 /// CHECK-DAG: <
> IntConstant 2 /// CHECK-DAG: <
> IntConstant -1 /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> IntermediateAddress /// CHECK: <
> ArrayGet [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> ArraySet [<
>,<
>,<
>] /// CHECK: <
> ArrayGet [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> ArraySet [<
>,<
>,<
>] /// CHECK: <
> ArrayGet [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> ArraySet [<
>,<
>,<
>] /// CHECK-START-ARM: void Main.arrayAccessVariable(int) scheduler (after) /// CHECK: <
> ParameterValue /// CHECK-DAG: <
> IntConstant 1 /// CHECK-DAG: <
> IntConstant 2 /// CHECK-DAG: <
> IntConstant -1 /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> IntermediateAddress /// CHECK: ArrayGet [<
>,{{i\d+}}] /// CHECK: ArrayGet [<
>,{{i\d+}}] /// CHECK: ArrayGet [<
>,{{i\d+}}] /// CHECK: Add /// CHECK: Add /// CHECK: Add /// CHECK: ArraySet /// CHECK: ArraySet /// CHECK: ArraySet /// CHECK-START-ARM64: void Main.arrayAccessVariable(int) scheduler (before) /// CHECK: <
> ParameterValue /// CHECK-DAG: <
> IntConstant 1 /// CHECK-DAG: <
> IntConstant 2 /// CHECK-DAG: <
> IntConstant -1 /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> IntermediateAddress /// CHECK: <
> ArrayGet [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> ArraySet [<
>,<
>,<
>] /// CHECK: <
> ArrayGet [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> ArraySet [<
>,<
>,<
>] /// CHECK: <
> ArrayGet [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> ArraySet [<
>,<
>,<
>] /// CHECK-START-ARM64: void Main.arrayAccessVariable(int) scheduler (after) /// CHECK: <
> ParameterValue /// CHECK-DAG: <
> IntConstant 1 /// CHECK-DAG: <
> IntConstant 2 /// CHECK-DAG: <
> IntConstant -1 /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> IntermediateAddress /// CHECK: ArrayGet [<
>,{{i\d+}}] /// CHECK: ArrayGet [<
>,{{i\d+}}] /// CHECK: ArrayGet [<
>,{{i\d+}}] /// CHECK: Add /// CHECK: Add /// CHECK: Add /// CHECK: ArraySet /// CHECK: ArraySet /// CHECK: ArraySet public static void arrayAccessVariable(int i) { int [] array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; for (int j = 0; j < 100; j++) { array[i + 1]++; array[i + 2]++; array[i - 1]++; } } /// CHECK-START-ARM: void Main.arrayAccessSub(int) scheduler (before) /// CHECK: <
> ParameterValue /// CHECK-DAG: <
> IntConstant -1 /// CHECK-DAG: <
> IntConstant 9 /// CHECK-DAG: <
> IntConstant 1 /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> Sub [<
>,<
>] /// CHECK: <
> IntermediateAddress /// CHECK: <
> ArrayGet [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> ArraySet [<
>,<
>,<
>] /// CHECK: <
> ArrayGet [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> ArraySet [<
>,<
>,<
>] /// CHECK-START-ARM: void Main.arrayAccessSub(int) scheduler (after) /// CHECK: <
> ParameterValue /// CHECK-DAG: <
> IntConstant -1 /// CHECK-DAG: <
> IntConstant 9 /// CHECK-DAG: <
> IntConstant 1 /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> Sub [<
>,<
>] /// CHECK: <
> IntermediateAddress /// CHECK: <
> ArrayGet [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> ArraySet [<
>,<
>,<
>] /// CHECK: <
> ArrayGet [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> ArraySet [<
>,<
>,<
>] /// CHECK-START-ARM64: void Main.arrayAccessSub(int) scheduler (before) /// CHECK: <
> ParameterValue /// CHECK-DAG: <
> IntConstant -1 /// CHECK-DAG: <
> IntConstant 9 /// CHECK-DAG: <
> IntConstant 1 /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> Sub [<
>,<
>] /// CHECK: <
> IntermediateAddress /// CHECK: <
> ArrayGet [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> ArraySet [<
>,<
>,<
>] /// CHECK: <
> ArrayGet [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> ArraySet [<
>,<
>,<
>] /// CHECK-START-ARM64: void Main.arrayAccessSub(int) scheduler (after) /// CHECK: <
> ParameterValue /// CHECK-DAG: <
> IntConstant -1 /// CHECK-DAG: <
> IntConstant 9 /// CHECK-DAG: <
> IntConstant 1 /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> Sub [<
>,<
>] /// CHECK: <
> IntermediateAddress /// CHECK: <
> ArrayGet [<
>,<
>] /// CHECK: <
> Add [<
>,<
>] /// CHECK: <
> ArraySet [<
>,<
>,<
>] /// CHECK: <
> ArrayGet [<