This commit is contained in:
Shane Freeder
2019-12-10 23:56:33 +00:00
parent 2f8ae01cb1
commit f181496be3
28 changed files with 61 additions and 75 deletions

View File

@@ -6,11 +6,11 @@ Subject: [PATCH] Use ASM for event executors.
Uses method handles for private or static methods.
diff --git a/pom.xml b/pom.xml
index 2daee11a2..709b7a222 100644
index 2c2823b3..a6567413 100644
--- a/pom.xml
+++ b/pom.xml
@@ -0,0 +0,0 @@
<version>7.1</version>
<version>7.2</version>
<scope>test</scope>
</dependency>
+ <!-- ASM -->
@@ -29,7 +29,7 @@ index 2daee11a2..709b7a222 100644
<build>
diff --git a/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java b/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java
new file mode 100644
index 000000000..5b28e9b1d
index 00000000..5b28e9b1
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java
@@ -0,0 +0,0 @@
@@ -77,7 +77,7 @@ index 000000000..5b28e9b1d
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/executor/StaticMethodHandleEventExecutor.java b/src/main/java/com/destroystokyo/paper/event/executor/StaticMethodHandleEventExecutor.java
new file mode 100644
index 000000000..c83672427
index 00000000..c8367242
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/executor/StaticMethodHandleEventExecutor.java
@@ -0,0 +0,0 @@
@@ -126,7 +126,7 @@ index 000000000..c83672427
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java b/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java
new file mode 100644
index 000000000..b6e7d8ee8
index 00000000..b6e7d8ee
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java
@@ -0,0 +0,0 @@
@@ -179,7 +179,7 @@ index 000000000..b6e7d8ee8
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/executor/asm/ClassDefiner.java b/src/main/java/com/destroystokyo/paper/event/executor/asm/ClassDefiner.java
new file mode 100644
index 000000000..beed9e6e0
index 00000000..beed9e6e
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/executor/asm/ClassDefiner.java
@@ -0,0 +0,0 @@
@@ -220,7 +220,7 @@ index 000000000..beed9e6e0
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/executor/asm/SafeClassDefiner.java b/src/main/java/com/destroystokyo/paper/event/executor/asm/SafeClassDefiner.java
new file mode 100644
index 000000000..ac99477e9
index 00000000..ac99477e
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/executor/asm/SafeClassDefiner.java
@@ -0,0 +0,0 @@
@@ -292,7 +292,7 @@ index 000000000..ac99477e9
+}
diff --git a/src/main/java/com/destroystokyo/paper/utils/UnsafeUtils.java b/src/main/java/com/destroystokyo/paper/utils/UnsafeUtils.java
new file mode 100644
index 000000000..72e48e8ef
index 00000000..72e48e8e
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/utils/UnsafeUtils.java
@@ -0,0 +0,0 @@
@@ -332,7 +332,7 @@ index 000000000..72e48e8ef
+ }
+}
diff --git a/src/main/java/org/bukkit/plugin/EventExecutor.java b/src/main/java/org/bukkit/plugin/EventExecutor.java
index a850f0780..9026e108c 100644
index a850f078..9026e108 100644
--- a/src/main/java/org/bukkit/plugin/EventExecutor.java
+++ b/src/main/java/org/bukkit/plugin/EventExecutor.java
@@ -0,0 +0,0 @@ import org.bukkit.event.EventException;
@@ -412,7 +412,7 @@ index a850f0780..9026e108c 100644
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index 12601db68..06b6724fa 100644
index 12601db6..06b6724f 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader {