Merge "Libcore VarHandle generator script and tests." am: 2427797def am: 14a7d644a3 am: d6ba065aef
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2079622 Change-Id: I1ce761000eb2890dd06d30caf0fa0e52b5b42e04 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class ReflectGetFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
Field mField;
|
||||
int mValue;
|
||||
|
||||
public ReflectGetFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mField = this.getClass().getDeclaredField("mValue");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() throws Throwable {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mField.getInt(this);
|
||||
x = (int) mField.getInt(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class ReflectGetFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
Field mField;
|
||||
String mValue;
|
||||
|
||||
public ReflectGetFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mField = this.getClass().getDeclaredField("mValue");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() throws Throwable {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mField.get(this);
|
||||
x = (String) mField.get(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class ReflectGetStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
Field mField;
|
||||
static int sValue;
|
||||
|
||||
public ReflectGetStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mField = this.getClass().getDeclaredField("sValue");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() throws Throwable {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mField.getInt(null);
|
||||
x = (int) mField.getInt(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class ReflectGetStaticFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
Field mField;
|
||||
static String sValue;
|
||||
|
||||
public ReflectGetStaticFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mField = this.getClass().getDeclaredField("sValue");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() throws Throwable {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mField.get(null);
|
||||
x = (String) mField.get(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class ReflectSetFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
Field mField;
|
||||
int mValue;
|
||||
|
||||
public ReflectSetFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mField = this.getClass().getDeclaredField("mValue");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() throws Throwable {
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
mField.setInt(this, 42);
|
||||
mField.setInt(this, 42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class ReflectSetFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
Field mField;
|
||||
String mValue;
|
||||
|
||||
public ReflectSetFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mField = this.getClass().getDeclaredField("mValue");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() throws Throwable {
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
mField.set(this, "qwerty");
|
||||
mField.set(this, "qwerty");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class ReflectSetStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
Field mField;
|
||||
static int sValue;
|
||||
|
||||
public ReflectSetStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mField = this.getClass().getDeclaredField("sValue");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() throws Throwable {
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
mField.setInt(null, 42);
|
||||
mField.setInt(null, 42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class ReflectSetStaticFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
Field mField;
|
||||
static String sValue;
|
||||
|
||||
public ReflectSetStaticFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mField = this.getClass().getDeclaredField("sValue");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() throws Throwable {
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
mField.set(null, "qwerty");
|
||||
mField.set(null, "qwerty");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleCompareandexchangeAcquireFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleCompareandexchangeAcquireFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.compareAndExchangeAcquire(this, mField, ~42);
|
||||
x = (int) mVh.compareAndExchangeAcquire(this, mField, 42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleCompareandexchangeAcquireFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
String mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleCompareandexchangeAcquireFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.compareAndExchangeAcquire(this, mField, null);
|
||||
x = (String) mVh.compareAndExchangeAcquire(this, mField, "qwerty");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleCompareandexchangeAcquireStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleCompareandexchangeAcquireStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.compareAndExchangeAcquire(sField, ~42);
|
||||
x = (int) mVh.compareAndExchangeAcquire(sField, 42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleCompareandexchangeAcquireStaticFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
static String sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleCompareandexchangeAcquireStaticFieldLittleEndianStringPerfTest()
|
||||
throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.compareAndExchangeAcquire(sField, null);
|
||||
x = (String) mVh.compareAndExchangeAcquire(sField, "qwerty");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleCompareandexchangeFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleCompareandexchangeFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.compareAndExchange(this, mField, ~42);
|
||||
x = (int) mVh.compareAndExchange(this, mField, 42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleCompareandexchangeFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
String mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleCompareandexchangeFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.compareAndExchange(this, mField, null);
|
||||
x = (String) mVh.compareAndExchange(this, mField, "qwerty");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleCompareandexchangeReleaseFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleCompareandexchangeReleaseFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.compareAndExchangeRelease(this, mField, ~42);
|
||||
x = (int) mVh.compareAndExchangeRelease(this, mField, 42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleCompareandexchangeReleaseFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
String mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleCompareandexchangeReleaseFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.compareAndExchangeRelease(this, mField, null);
|
||||
x = (String) mVh.compareAndExchangeRelease(this, mField, "qwerty");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleCompareandexchangeReleaseStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleCompareandexchangeReleaseStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.compareAndExchangeRelease(sField, ~42);
|
||||
x = (int) mVh.compareAndExchangeRelease(sField, 42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleCompareandexchangeReleaseStaticFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
static String sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleCompareandexchangeReleaseStaticFieldLittleEndianStringPerfTest()
|
||||
throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.compareAndExchangeRelease(sField, null);
|
||||
x = (String) mVh.compareAndExchangeRelease(sField, "qwerty");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleCompareandexchangeStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleCompareandexchangeStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.compareAndExchange(sField, ~42);
|
||||
x = (int) mVh.compareAndExchange(sField, 42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleCompareandexchangeStaticFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
static String sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleCompareandexchangeStaticFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.compareAndExchange(sField, null);
|
||||
x = (String) mVh.compareAndExchange(sField, "qwerty");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleCompareandsetFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleCompareandsetFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
boolean success;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
success = mVh.compareAndSet(this, mField, ~42);
|
||||
success = mVh.compareAndSet(this, mField, 42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleCompareandsetFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
String mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleCompareandsetFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
boolean success;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
success = mVh.compareAndSet(this, mField, null);
|
||||
success = mVh.compareAndSet(this, mField, "qwerty");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleCompareandsetStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleCompareandsetStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
boolean success;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
success = mVh.compareAndSet(sField, ~42);
|
||||
success = mVh.compareAndSet(sField, 42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleCompareandsetStaticFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
static String sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleCompareandsetStaticFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
boolean success;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
success = mVh.compareAndSet(sField, null);
|
||||
success = mVh.compareAndSet(sField, "qwerty");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetAcquireFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetAcquireFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
int v = (int) mVh.getAcquire(this);
|
||||
if (v != FIELD_VALUE) {
|
||||
throw new RuntimeException("field has unexpected value " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAcquire(this);
|
||||
x = (int) mVh.getAcquire(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetAcquireFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
String mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetAcquireFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", String.class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
String v = (String) mVh.getAcquire(this);
|
||||
if (v != FIELD_VALUE) {
|
||||
throw new RuntimeException("field has unexpected value " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.getAcquire(this);
|
||||
x = (String) mVh.getAcquire(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetAcquireStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetAcquireStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
int v = (int) mVh.getAcquire();
|
||||
if (v != FIELD_VALUE) {
|
||||
throw new RuntimeException("field has unexpected value " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAcquire();
|
||||
x = (int) mVh.getAcquire();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetAcquireStaticFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
static String sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetAcquireStaticFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", String.class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
String v = (String) mVh.getAcquire();
|
||||
if (v != FIELD_VALUE) {
|
||||
throw new RuntimeException("field has unexpected value " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.getAcquire();
|
||||
x = (String) mVh.getAcquire();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetArrayLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int ELEMENT_VALUE = 42;
|
||||
int[] mArray = {ELEMENT_VALUE};
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetArrayLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.arrayElementVarHandle(int[].class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
int v = (int) mVh.get(mArray, 0);
|
||||
if (v != ELEMENT_VALUE) {
|
||||
throw new RuntimeException("array element has unexpected value: " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int[] a = mArray;
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.get(a, 0);
|
||||
x = (int) mVh.get(a, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetArrayLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String ELEMENT_VALUE = "qwerty";
|
||||
String[] mArray = {ELEMENT_VALUE};
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetArrayLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.arrayElementVarHandle(String[].class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
String v = (String) mVh.get(mArray, 0);
|
||||
if (v != ELEMENT_VALUE) {
|
||||
throw new RuntimeException("array element has unexpected value: " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String[] a = mArray;
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.get(a, 0);
|
||||
x = (String) mVh.get(a, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetByteArrayViewBigEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int VALUE = 42;
|
||||
byte[] mArray1 = {
|
||||
(byte) (VALUE >> 24), (byte) (VALUE >> 16), (byte) (VALUE >> 8), (byte) VALUE
|
||||
};
|
||||
byte[] mArray2 = {(byte) (-1 >> 24), (byte) (-1 >> 16), (byte) (-1 >> 8), (byte) VALUE};
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetByteArrayViewBigEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.byteArrayViewVarHandle(int[].class, ByteOrder.BIG_ENDIAN);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
int v = (int) mVh.get(mArray1, 0);
|
||||
if (v != VALUE) {
|
||||
throw new RuntimeException("array has unexpected value: " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
byte[] a = mArray1;
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.get(a, 0);
|
||||
x = (int) mVh.get(a, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetByteArrayViewLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int VALUE = 42;
|
||||
byte[] mArray1 = {
|
||||
(byte) VALUE, (byte) (VALUE >> 8), (byte) (VALUE >> 16), (byte) (VALUE >> 24)
|
||||
};
|
||||
byte[] mArray2 = {(byte) VALUE, (byte) (-1 >> 8), (byte) (-1 >> 16), (byte) (-1 >> 24)};
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetByteArrayViewLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.byteArrayViewVarHandle(int[].class, ByteOrder.LITTLE_ENDIAN);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
int v = (int) mVh.get(mArray1, 0);
|
||||
if (v != VALUE) {
|
||||
throw new RuntimeException("array has unexpected value: " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
byte[] a = mArray1;
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.get(a, 0);
|
||||
x = (int) mVh.get(a, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
int v = (int) mVh.get(this);
|
||||
if (v != FIELD_VALUE) {
|
||||
throw new RuntimeException("field has unexpected value " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.get(this);
|
||||
x = (int) mVh.get(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
String mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", String.class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
String v = (String) mVh.get(this);
|
||||
if (v != FIELD_VALUE) {
|
||||
throw new RuntimeException("field has unexpected value " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.get(this);
|
||||
x = (String) mVh.get(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetOpaqueFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetOpaqueFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
int v = (int) mVh.getOpaque(this);
|
||||
if (v != FIELD_VALUE) {
|
||||
throw new RuntimeException("field has unexpected value " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getOpaque(this);
|
||||
x = (int) mVh.getOpaque(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetOpaqueFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
String mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetOpaqueFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", String.class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
String v = (String) mVh.getOpaque(this);
|
||||
if (v != FIELD_VALUE) {
|
||||
throw new RuntimeException("field has unexpected value " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.getOpaque(this);
|
||||
x = (String) mVh.getOpaque(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetOpaqueStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetOpaqueStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
int v = (int) mVh.getOpaque();
|
||||
if (v != FIELD_VALUE) {
|
||||
throw new RuntimeException("field has unexpected value " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getOpaque();
|
||||
x = (int) mVh.getOpaque();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetOpaqueStaticFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
static String sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetOpaqueStaticFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", String.class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
String v = (String) mVh.getOpaque();
|
||||
if (v != FIELD_VALUE) {
|
||||
throw new RuntimeException("field has unexpected value " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.getOpaque();
|
||||
x = (String) mVh.getOpaque();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
int v = (int) mVh.get();
|
||||
if (v != FIELD_VALUE) {
|
||||
throw new RuntimeException("field has unexpected value " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.get();
|
||||
x = (int) mVh.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetStaticFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
static String sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetStaticFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", String.class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
String v = (String) mVh.get();
|
||||
if (v != FIELD_VALUE) {
|
||||
throw new RuntimeException("field has unexpected value " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.get();
|
||||
x = (String) mVh.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetVolatileFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetVolatileFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
int v = (int) mVh.getVolatile(this);
|
||||
if (v != FIELD_VALUE) {
|
||||
throw new RuntimeException("field has unexpected value " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getVolatile(this);
|
||||
x = (int) mVh.getVolatile(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetVolatileFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
String mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetVolatileFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", String.class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
String v = (String) mVh.getVolatile(this);
|
||||
if (v != FIELD_VALUE) {
|
||||
throw new RuntimeException("field has unexpected value " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.getVolatile(this);
|
||||
x = (String) mVh.getVolatile(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetVolatileStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetVolatileStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
int v = (int) mVh.getVolatile();
|
||||
if (v != FIELD_VALUE) {
|
||||
throw new RuntimeException("field has unexpected value " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getVolatile();
|
||||
x = (int) mVh.getVolatile();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetVolatileStaticFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
static String sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetVolatileStaticFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", String.class);
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
String v = (String) mVh.getVolatile();
|
||||
if (v != FIELD_VALUE) {
|
||||
throw new RuntimeException("field has unexpected value " + v);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.getVolatile();
|
||||
x = (String) mVh.getVolatile();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandaddAcquireFieldLittleEndianFloatPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final float FIELD_VALUE = 3.14f;
|
||||
float mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandaddAcquireFieldLittleEndianFloatPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", float.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
float x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (float) mVh.getAndAddAcquire(this, 2.17f);
|
||||
x = (float) mVh.getAndAddAcquire(this, 2.17f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandaddAcquireFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandaddAcquireFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndAddAcquire(this, ~42);
|
||||
x = (int) mVh.getAndAddAcquire(this, ~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandaddAcquireStaticFieldLittleEndianFloatPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final float FIELD_VALUE = 3.14f;
|
||||
static float sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandaddAcquireStaticFieldLittleEndianFloatPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", float.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
float x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (float) mVh.getAndAddAcquire(2.17f);
|
||||
x = (float) mVh.getAndAddAcquire(2.17f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandaddAcquireStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandaddAcquireStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndAddAcquire(~42);
|
||||
x = (int) mVh.getAndAddAcquire(~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandaddFieldLittleEndianFloatPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final float FIELD_VALUE = 3.14f;
|
||||
float mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandaddFieldLittleEndianFloatPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", float.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
float x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (float) mVh.getAndAdd(this, 2.17f);
|
||||
x = (float) mVh.getAndAdd(this, 2.17f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandaddFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandaddFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndAdd(this, ~42);
|
||||
x = (int) mVh.getAndAdd(this, ~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandaddReleaseFieldLittleEndianFloatPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final float FIELD_VALUE = 3.14f;
|
||||
float mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandaddReleaseFieldLittleEndianFloatPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", float.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
float x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (float) mVh.getAndAddRelease(this, 2.17f);
|
||||
x = (float) mVh.getAndAddRelease(this, 2.17f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandaddReleaseFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandaddReleaseFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndAddRelease(this, ~42);
|
||||
x = (int) mVh.getAndAddRelease(this, ~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandaddReleaseStaticFieldLittleEndianFloatPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final float FIELD_VALUE = 3.14f;
|
||||
static float sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandaddReleaseStaticFieldLittleEndianFloatPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", float.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
float x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (float) mVh.getAndAddRelease(2.17f);
|
||||
x = (float) mVh.getAndAddRelease(2.17f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandaddReleaseStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandaddReleaseStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndAddRelease(~42);
|
||||
x = (int) mVh.getAndAddRelease(~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandaddStaticFieldLittleEndianFloatPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final float FIELD_VALUE = 3.14f;
|
||||
static float sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandaddStaticFieldLittleEndianFloatPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", float.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
float x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (float) mVh.getAndAdd(2.17f);
|
||||
x = (float) mVh.getAndAdd(2.17f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandaddStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandaddStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndAdd(~42);
|
||||
x = (int) mVh.getAndAdd(~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandbitwiseAndAcquireFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandbitwiseAndAcquireFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndBitwiseAndAcquire(this, ~42);
|
||||
x = (int) mVh.getAndBitwiseAndAcquire(this, ~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandbitwiseAndAcquireStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandbitwiseAndAcquireStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndBitwiseAndAcquire(~42);
|
||||
x = (int) mVh.getAndBitwiseAndAcquire(~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandbitwiseAndFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandbitwiseAndFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndBitwiseAnd(this, ~42);
|
||||
x = (int) mVh.getAndBitwiseAnd(this, ~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandbitwiseAndReleaseFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandbitwiseAndReleaseFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndBitwiseAndRelease(this, ~42);
|
||||
x = (int) mVh.getAndBitwiseAndRelease(this, ~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandbitwiseAndReleaseStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandbitwiseAndReleaseStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndBitwiseAndRelease(~42);
|
||||
x = (int) mVh.getAndBitwiseAndRelease(~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandbitwiseAndStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandbitwiseAndStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndBitwiseAnd(~42);
|
||||
x = (int) mVh.getAndBitwiseAnd(~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandbitwiseOrAcquireFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandbitwiseOrAcquireFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndBitwiseOrAcquire(this, ~42);
|
||||
x = (int) mVh.getAndBitwiseOrAcquire(this, ~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandbitwiseOrAcquireStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandbitwiseOrAcquireStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndBitwiseOrAcquire(~42);
|
||||
x = (int) mVh.getAndBitwiseOrAcquire(~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandbitwiseOrFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandbitwiseOrFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndBitwiseOr(this, ~42);
|
||||
x = (int) mVh.getAndBitwiseOr(this, ~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandbitwiseOrReleaseFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandbitwiseOrReleaseFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndBitwiseOrRelease(this, ~42);
|
||||
x = (int) mVh.getAndBitwiseOrRelease(this, ~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandbitwiseOrReleaseStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandbitwiseOrReleaseStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndBitwiseOrRelease(~42);
|
||||
x = (int) mVh.getAndBitwiseOrRelease(~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandbitwiseOrStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandbitwiseOrStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndBitwiseOr(~42);
|
||||
x = (int) mVh.getAndBitwiseOr(~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandbitwiseXorAcquireFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandbitwiseXorAcquireFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndBitwiseXorAcquire(this, ~42);
|
||||
x = (int) mVh.getAndBitwiseXorAcquire(this, ~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandbitwiseXorAcquireStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandbitwiseXorAcquireStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndBitwiseXorAcquire(~42);
|
||||
x = (int) mVh.getAndBitwiseXorAcquire(~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandbitwiseXorFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandbitwiseXorFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndBitwiseXor(this, ~42);
|
||||
x = (int) mVh.getAndBitwiseXor(this, ~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandbitwiseXorReleaseFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandbitwiseXorReleaseFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndBitwiseXorRelease(this, ~42);
|
||||
x = (int) mVh.getAndBitwiseXorRelease(this, ~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandbitwiseXorReleaseStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandbitwiseXorReleaseStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndBitwiseXorRelease(~42);
|
||||
x = (int) mVh.getAndBitwiseXorRelease(~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandbitwiseXorStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandbitwiseXorStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndBitwiseXor(~42);
|
||||
x = (int) mVh.getAndBitwiseXor(~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandsetAcquireFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandsetAcquireFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndSetAcquire(this, ~42);
|
||||
x = (int) mVh.getAndSetAcquire(this, ~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandsetAcquireFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
String mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandsetAcquireFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.getAndSetAcquire(this, null);
|
||||
x = (String) mVh.getAndSetAcquire(this, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandsetAcquireStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandsetAcquireStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndSetAcquire(~42);
|
||||
x = (int) mVh.getAndSetAcquire(~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandsetAcquireStaticFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
static String sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandsetAcquireStaticFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.getAndSetAcquire(null);
|
||||
x = (String) mVh.getAndSetAcquire(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandsetFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandsetFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndSet(this, ~42);
|
||||
x = (int) mVh.getAndSet(this, ~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandsetFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
String mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandsetFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.getAndSet(this, null);
|
||||
x = (String) mVh.getAndSet(this, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandsetReleaseFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandsetReleaseFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndSetRelease(this, ~42);
|
||||
x = (int) mVh.getAndSetRelease(this, ~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandsetReleaseFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
String mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandsetReleaseFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.getAndSetRelease(this, null);
|
||||
x = (String) mVh.getAndSetRelease(this, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandsetReleaseStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandsetReleaseStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndSetRelease(~42);
|
||||
x = (int) mVh.getAndSetRelease(~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandsetReleaseStaticFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
static String sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandsetReleaseStaticFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.getAndSetRelease(null);
|
||||
x = (String) mVh.getAndSetRelease(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandsetStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandsetStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (int) mVh.getAndSet(~42);
|
||||
x = (int) mVh.getAndSet(~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleGetandsetStaticFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
static String sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleGetandsetStaticFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", String.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
x = (String) mVh.getAndSet(null);
|
||||
x = (String) mVh.getAndSet(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleSetArrayLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int ELEMENT_VALUE = 42;
|
||||
int[] mArray = {ELEMENT_VALUE};
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleSetArrayLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.arrayElementVarHandle(int[].class);
|
||||
}
|
||||
|
||||
@After
|
||||
public void teardown() {
|
||||
if (mArray[0] != ~42) {
|
||||
throw new RuntimeException("array element has unexpected value: " + mArray[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int[] a = mArray;
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
mVh.set(a, 0, ~42);
|
||||
mVh.set(a, 0, ~42);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleSetArrayLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String ELEMENT_VALUE = "qwerty";
|
||||
String[] mArray = {ELEMENT_VALUE};
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleSetArrayLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.arrayElementVarHandle(String[].class);
|
||||
}
|
||||
|
||||
@After
|
||||
public void teardown() {
|
||||
if (mArray[0] != null) {
|
||||
throw new RuntimeException("array element has unexpected value: " + mArray[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String[] a = mArray;
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
mVh.set(a, 0, null);
|
||||
mVh.set(a, 0, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.Arrays;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleSetByteArrayViewBigEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int VALUE = 42;
|
||||
byte[] mArray1 = {
|
||||
(byte) (VALUE >> 24), (byte) (VALUE >> 16), (byte) (VALUE >> 8), (byte) VALUE
|
||||
};
|
||||
byte[] mArray2 = {(byte) (-1 >> 24), (byte) (-1 >> 16), (byte) (-1 >> 8), (byte) VALUE};
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleSetByteArrayViewBigEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.byteArrayViewVarHandle(int[].class, ByteOrder.BIG_ENDIAN);
|
||||
}
|
||||
|
||||
@After
|
||||
public void teardown() {
|
||||
if (!Arrays.equals(mArray2, mArray1)) {
|
||||
throw new RuntimeException(
|
||||
"array has unexpected values: "
|
||||
+ mArray2[0]
|
||||
+ " "
|
||||
+ mArray2[1]
|
||||
+ " "
|
||||
+ mArray2[2]
|
||||
+ " "
|
||||
+ mArray2[3]);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
byte[] a = mArray2;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
mVh.set(a, 0, VALUE);
|
||||
mVh.set(a, 0, VALUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.Arrays;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleSetByteArrayViewLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int VALUE = 42;
|
||||
byte[] mArray1 = {
|
||||
(byte) VALUE, (byte) (VALUE >> 8), (byte) (VALUE >> 16), (byte) (VALUE >> 24)
|
||||
};
|
||||
byte[] mArray2 = {(byte) VALUE, (byte) (-1 >> 8), (byte) (-1 >> 16), (byte) (-1 >> 24)};
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleSetByteArrayViewLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.byteArrayViewVarHandle(int[].class, ByteOrder.LITTLE_ENDIAN);
|
||||
}
|
||||
|
||||
@After
|
||||
public void teardown() {
|
||||
if (!Arrays.equals(mArray2, mArray1)) {
|
||||
throw new RuntimeException(
|
||||
"array has unexpected values: "
|
||||
+ mArray2[0]
|
||||
+ " "
|
||||
+ mArray2[1]
|
||||
+ " "
|
||||
+ mArray2[2]
|
||||
+ " "
|
||||
+ mArray2[3]);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
byte[] a = mArray2;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
mVh.set(a, 0, VALUE);
|
||||
mVh.set(a, 0, VALUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleSetFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleSetFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@After
|
||||
public void teardown() {
|
||||
if (mField != FIELD_VALUE) {
|
||||
throw new RuntimeException("mField has unexpected value " + mField);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
mVh.set(this, FIELD_VALUE);
|
||||
mVh.set(this, FIELD_VALUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleSetFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
String mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleSetFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", String.class);
|
||||
}
|
||||
|
||||
@After
|
||||
public void teardown() {
|
||||
if (mField != FIELD_VALUE) {
|
||||
throw new RuntimeException("mField has unexpected value " + mField);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
mVh.set(this, FIELD_VALUE);
|
||||
mVh.set(this, FIELD_VALUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleSetOpaqueFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleSetOpaqueFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@After
|
||||
public void teardown() {
|
||||
if (mField != FIELD_VALUE) {
|
||||
throw new RuntimeException("mField has unexpected value " + mField);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
mVh.setOpaque(this, FIELD_VALUE);
|
||||
mVh.setOpaque(this, FIELD_VALUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleSetOpaqueFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
String mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleSetOpaqueFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", String.class);
|
||||
}
|
||||
|
||||
@After
|
||||
public void teardown() {
|
||||
if (mField != FIELD_VALUE) {
|
||||
throw new RuntimeException("mField has unexpected value " + mField);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
mVh.setOpaque(this, FIELD_VALUE);
|
||||
mVh.setOpaque(this, FIELD_VALUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleSetOpaqueStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleSetOpaqueStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@After
|
||||
public void teardown() {
|
||||
if (sField != FIELD_VALUE) {
|
||||
throw new RuntimeException("sField has unexpected value " + sField);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
mVh.setOpaque(FIELD_VALUE);
|
||||
mVh.setOpaque(FIELD_VALUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleSetOpaqueStaticFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
static String sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleSetOpaqueStaticFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", String.class);
|
||||
}
|
||||
|
||||
@After
|
||||
public void teardown() {
|
||||
if (sField != FIELD_VALUE) {
|
||||
throw new RuntimeException("sField has unexpected value " + sField);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
mVh.setOpaque(FIELD_VALUE);
|
||||
mVh.setOpaque(FIELD_VALUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleSetReleaseFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
int mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleSetReleaseFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", int.class);
|
||||
}
|
||||
|
||||
@After
|
||||
public void teardown() {
|
||||
if (mField != FIELD_VALUE) {
|
||||
throw new RuntimeException("mField has unexpected value " + mField);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
mVh.setRelease(this, FIELD_VALUE);
|
||||
mVh.setRelease(this, FIELD_VALUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleSetReleaseFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
String mField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleSetReleaseFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findVarHandle(this.getClass(), "mField", String.class);
|
||||
}
|
||||
|
||||
@After
|
||||
public void teardown() {
|
||||
if (mField != FIELD_VALUE) {
|
||||
throw new RuntimeException("mField has unexpected value " + mField);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
mVh.setRelease(this, FIELD_VALUE);
|
||||
mVh.setRelease(this, FIELD_VALUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleSetReleaseStaticFieldLittleEndianIntPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final int FIELD_VALUE = 42;
|
||||
static int sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleSetReleaseStaticFieldLittleEndianIntPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", int.class);
|
||||
}
|
||||
|
||||
@After
|
||||
public void teardown() {
|
||||
if (sField != FIELD_VALUE) {
|
||||
throw new RuntimeException("sField has unexpected value " + sField);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
int x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
mVh.setRelease(FIELD_VALUE);
|
||||
mVh.setRelease(FIELD_VALUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
// This file is generated by generate_java.py do not directly modify!
|
||||
package android.libcore.varhandles;
|
||||
|
||||
import android.perftests.utils.BenchmarkState;
|
||||
import android.perftests.utils.PerfStatusReporter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.VarHandle;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class VarHandleSetReleaseStaticFieldLittleEndianStringPerfTest {
|
||||
@Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
|
||||
static final String FIELD_VALUE = "qwerty";
|
||||
static String sField = FIELD_VALUE;
|
||||
VarHandle mVh;
|
||||
|
||||
public VarHandleSetReleaseStaticFieldLittleEndianStringPerfTest() throws Throwable {
|
||||
mVh = MethodHandles.lookup().findStaticVarHandle(this.getClass(), "sField", String.class);
|
||||
}
|
||||
|
||||
@After
|
||||
public void teardown() {
|
||||
if (sField != FIELD_VALUE) {
|
||||
throw new RuntimeException("sField has unexpected value " + sField);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
String x;
|
||||
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
|
||||
while (state.keepRunning()) {
|
||||
mVh.setRelease(FIELD_VALUE);
|
||||
mVh.setRelease(FIELD_VALUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user