mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8230047: Remove legacy java.lang.reflect.ProxyGenerator_v49
Reviewed-by: rriggs, sundar
This commit is contained in:
parent
f1332640d4
commit
c0f23a8604
4 changed files with 5 additions and 2045 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -297,13 +297,6 @@ public class Proxy implements java.io.Serializable {
|
||||||
private static final ClassLoaderValue<Constructor<?>> proxyCache =
|
private static final ClassLoaderValue<Constructor<?>> proxyCache =
|
||||||
new ClassLoaderValue<>();
|
new ClassLoaderValue<>();
|
||||||
|
|
||||||
/**
|
|
||||||
* System property to revert to generation of proxy class files for version 1.5 (V49).
|
|
||||||
* Set to "true" to generate v49 class file format.
|
|
||||||
*/
|
|
||||||
private static final boolean PROXY_GENERATOR_V49 =
|
|
||||||
GetBooleanAction.privilegedGetProperty("jdk.proxy.ProxyGenerator.v49");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the invocation handler for this proxy instance.
|
* the invocation handler for this proxy instance.
|
||||||
* @serial
|
* @serial
|
||||||
|
@ -541,9 +534,7 @@ public class Proxy implements java.io.Serializable {
|
||||||
/*
|
/*
|
||||||
* Generate the specified proxy class.
|
* Generate the specified proxy class.
|
||||||
*/
|
*/
|
||||||
byte[] proxyClassFile = PROXY_GENERATOR_V49
|
byte[] proxyClassFile = ProxyGenerator.generateProxyClass(loader, proxyName, interfaces, accessFlags);
|
||||||
? ProxyGenerator_v49.generateProxyClass(proxyName, interfaces, accessFlags)
|
|
||||||
: ProxyGenerator.generateProxyClass(loader, proxyName, interfaces, accessFlags);
|
|
||||||
try {
|
try {
|
||||||
Class<?> pc = JLA.defineClass(loader, proxyName, proxyClassFile,
|
Class<?> pc = JLA.defineClass(loader, proxyName, proxyClassFile,
|
||||||
null, "__dynamic_proxy__");
|
null, "__dynamic_proxy__");
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -34,7 +34,6 @@
|
||||||
* jdk.compiler/com.sun.tools.javac.util
|
* jdk.compiler/com.sun.tools.javac.util
|
||||||
* @build combo.ComboTestHelper
|
* @build combo.ComboTestHelper
|
||||||
* @run main/othervm ProxyGeneratorCombo
|
* @run main/othervm ProxyGeneratorCombo
|
||||||
* @run main/othervm -Djdk.proxy.ProxyGenerator.v49=true ProxyGeneratorCombo
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
|
@ -40,13 +40,14 @@ public class ProxyBench {
|
||||||
/**
|
/**
|
||||||
* On Dell T7610:
|
* On Dell T7610:
|
||||||
*
|
*
|
||||||
* Benchmark w/ -Djdk.proxy.ProxyGenerator.v49=true
|
* Benchmark w/ the old ProxyGenerator
|
||||||
* Benchmark Mode Cnt Score Error Units
|
* Benchmark Mode Cnt Score Error Units
|
||||||
* ProxyBench.getProxyClass1i avgt 10 20.472 +/- 0.209 ns/op
|
* ProxyBench.getProxyClass1i avgt 10 20.472 +/- 0.209 ns/op
|
||||||
* ProxyBench.getProxyClass4i avgt 10 57.353 +/- 0.461 ns/op
|
* ProxyBench.getProxyClass4i avgt 10 57.353 +/- 0.461 ns/op
|
||||||
* ProxyBench.newProxyInstance1i avgt 10 31.459 +/- 0.516 ns/op
|
* ProxyBench.newProxyInstance1i avgt 10 31.459 +/- 0.516 ns/op
|
||||||
* ProxyBench.newProxyInstance4i avgt 10 66.580 +/- 0.983 ns/op
|
* ProxyBench.newProxyInstance4i avgt 10 66.580 +/- 0.983 ns/op
|
||||||
*
|
*
|
||||||
|
* Benchmark w/ the new ProxyGenerator using ASM
|
||||||
* Benchmark Mode Cnt Score Error Units
|
* Benchmark Mode Cnt Score Error Units
|
||||||
* ProxyBench.getProxyClass1i avgt 10 21.291 +/- 0.475 ns/op
|
* ProxyBench.getProxyClass1i avgt 10 21.291 +/- 0.475 ns/op
|
||||||
* ProxyBench.getProxyClass4i avgt 10 61.481 +/- 4.709 ns/op
|
* ProxyBench.getProxyClass4i avgt 10 61.481 +/- 4.709 ns/op
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue