-
Notifications
You must be signed in to change notification settings - Fork 0
Merge of the PRs we intend to upstream to asm #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fail early when adding an instruction that already belongs to a different instruction list.
Adds a method `setStack` to analysis.Frame which allows setting the dataflow value of a stack slot. Could be used in nullness analysis. After, for example, an instance call, aliases of the receiver can be set to NotNull, both in locals and on the stack.
Introduces a number of methods that are called when initializing or updating abstract values in an analyzer frame. Before this commit, Analyzer.analyze and Frame.execute would always call Interpreter.newValue for initializing or updating frame values. Having multiple methods allows users to return more precise values for the individual cases. For example, in a nullness analysis, the initial value for the `this` parameter of an instance method can be set to not-null.
Before this change, `Frame.execute` did not invoke the interpreter's `copyOperation` method for all values that are pushed on the frame's when executing some copying instructions. For example, in the case of `SWAP`, `copyOperation` is invoked: value2 = pop(); value1 = pop(); push(interpreter.copyOperation(insn, value2)); push(interpreter.copyOperation(insn, value1)); For `DUP` on the other hand, the original value is pushed onto the stack without notifying the interpreter: value1 = pop(); push(value1); push(interpreter.copyOperation(insn, value1)); This leads to a problem for the `SourceInterpreter`, which collects for every value a set of potential producer instructions. Given the bytecode sequence NEW java/lang/Object DUP INVOKESPECIAL java/lang/Object.<init> ()V In the frame of the `INVOKESPECIAL` instruction, the value on the stack lists as its producer the `NEW` operation instead of the `DUP`, which not expected.
retronym
added a commit
to retronym/scala
that referenced
this pull request
Jun 11, 2018
Minor Javadoc improvements See merge request asm/asm!182
… reformat the source files. Due to bug sherter/google-java-format-gradle-plugin#25 the formatting was only checked on the :asm project, and not on the other subprojects. Version 0.7 of the plugin solves this issue.
Adds a `clear()` method to `ClassWriter` to allow the user to reuse it to write another class without needing to allocate new buffers for the constant pool, etc. Furthermore, add a mode that enabled internal reuse of of buffers class writing. Exposes an overload of `toByteArray` that does not require a copy of the internal buffer, but rather returns the `ByteVector` directly. `ByteVector` has been updated to expose its contents in a read-only manner as a `ByteBuffer` or a `ByteArrayInputStream`. I've made an initial attempt to include this in the benchmark framework. ``` # VM version: JDK 1.8.0_162, VM 25.162-b12 Benchmark Mode Cnt Score Error Units GeneratorBenchmark.asm6_1 thrpt 20 874896.336 ± 10360.316 ops/s GeneratorBenchmark.asm6_1:+memory.used thrpt 20 ≈ 0 bytes GeneratorBenchmark.asm6_1:·gc.alloc.rate thrpt 20 2777.524 ± 31.962 MB/sec GeneratorBenchmark.asm6_1:·gc.alloc.rate.norm thrpt 20 5000.001 ± 0.003 B/op GeneratorBenchmark.asm6_1:·gc.churn.PS_Eden_Space thrpt 20 2689.738 ± 71.334 MB/sec GeneratorBenchmark.asm6_1:·gc.churn.PS_Eden_Space.norm thrpt 20 4841.558 ± 101.258 B/op GeneratorBenchmark.asm6_1:·gc.churn.PS_Survivor_Space thrpt 20 0.162 ± 0.044 MB/sec GeneratorBenchmark.asm6_1:·gc.churn.PS_Survivor_Space.norm thrpt 20 0.291 ± 0.079 B/op GeneratorBenchmark.asm6_1:·gc.count thrpt 20 264.000 counts GeneratorBenchmark.asm6_1:·gc.time thrpt 20 176.000 ms GeneratorBenchmark.asm6_1_reuse thrpt 20 1053280.540 ± 38925.306 ops/s GeneratorBenchmark.asm6_1_reuse:+memory.used thrpt 20 ≈ 0 bytes GeneratorBenchmark.asm6_1_reuse:·gc.alloc.rate thrpt 20 1525.059 ± 56.375 MB/sec GeneratorBenchmark.asm6_1_reuse:·gc.alloc.rate.norm thrpt 20 2280.001 ± 0.002 B/op GeneratorBenchmark.asm6_1_reuse:·gc.churn.PS_Eden_Space thrpt 20 1455.204 ± 57.245 MB/sec GeneratorBenchmark.asm6_1_reuse:·gc.churn.PS_Eden_Space.norm thrpt 20 2175.987 ± 47.373 B/op GeneratorBenchmark.asm6_1_reuse:·gc.churn.PS_Survivor_Space thrpt 20 0.171 ± 0.046 MB/sec GeneratorBenchmark.asm6_1_reuse:·gc.churn.PS_Survivor_Space.norm thrpt 20 0.257 ± 0.070 B/op GeneratorBenchmark.asm6_1_reuse:·gc.count thrpt 20 248.000 counts GeneratorBenchmark.asm6_1_reuse:·gc.time thrpt 20 166.000 ms ``` ``` # VM version: JDK 10.0.1, VM 10.0.1+10 Benchmark Mode Cnt Score Error Units GeneratorBenchmark.asm6_1 thrpt 20 808490.379 ± 9597.741 ops/s GeneratorBenchmark.asm6_1:·gc.alloc.rate thrpt 20 2567.604 ± 30.110 MB/sec GeneratorBenchmark.asm6_1:·gc.alloc.rate.norm thrpt 20 5000.001 ± 0.002 B/op GeneratorBenchmark.asm6_1:·gc.churn.CodeHeap_'non-profiled_nmethods' thrpt 20 0.008 ± 0.002 MB/sec GeneratorBenchmark.asm6_1:·gc.churn.CodeHeap_'non-profiled_nmethods'.norm thrpt 20 0.016 ± 0.004 B/op GeneratorBenchmark.asm6_1:·gc.churn.G1_Old_Gen thrpt 20 2574.135 ± 84.224 MB/sec GeneratorBenchmark.asm6_1:·gc.churn.G1_Old_Gen.norm thrpt 20 5012.769 ± 155.361 B/op GeneratorBenchmark.asm6_1:·gc.count thrpt 20 235.000 counts GeneratorBenchmark.asm6_1:·gc.time thrpt 20 250.000 ms GeneratorBenchmark.asm6_1_reuse thrpt 20 874917.363 ± 2517.632 ops/s GeneratorBenchmark.asm6_1_reuse:·gc.alloc.rate thrpt 20 1266.731 ± 4.102 MB/sec GeneratorBenchmark.asm6_1_reuse:·gc.alloc.rate.norm thrpt 20 2280.001 ± 0.002 B/op GeneratorBenchmark.asm6_1_reuse:·gc.churn.CodeHeap_'non-profiled_nmethods' thrpt 20 0.004 ± 0.002 MB/sec GeneratorBenchmark.asm6_1_reuse:·gc.churn.CodeHeap_'non-profiled_nmethods'.norm thrpt 20 0.008 ± 0.004 B/op GeneratorBenchmark.asm6_1_reuse:·gc.churn.G1_Old_Gen thrpt 20 1266.407 ± 62.495 MB/sec GeneratorBenchmark.asm6_1_reuse:·gc.churn.G1_Old_Gen.norm thrpt 20 2279.504 ± 113.687 B/op GeneratorBenchmark.asm6_1_reuse:·gc.count thrpt 20 144.000 counts GeneratorBenchmark.asm6_1_reuse:·gc.time thrpt 20 147.000 ms ```
retronym
added a commit
to retronym/scala
that referenced
this pull request
Jun 20, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Compendium of #1 #2 #3 #4 #5 #6
Refers to scala/scala-asm#9
Publish locally with:
Then go over to scala/scala#6766 and run: