This repository was archived by the owner on Feb 23, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Conversation
This file contains 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
Allows creating an asm.Attribute and directly providing the content as a byte array. Cherry-pick of lrytz/scala@9a7e518
Fail early when adding an instruction that already belongs to a different instruction list. Cherry-pick of lrytz/scala@eccd0dc
Make class MethodWriter public and add accessors for maxLocals and maxStack. This is the simplest way to compute the maxs using the ASM framework. It is used in the optimizer, see scala/scala@90781e8 Cherry-pick of lrytz/scala@91810c9
Fix typos. This change was initially part of scala/scala@549dc88 Cherry-pick of lrytz/scala@e1fbc7f
Adds a method `setStack` to analysis.Frame which allows setting the dataflow value of a stack slot. 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.
…ll copied values Before this change, `Frame.execute` did not invoke the interpreter's `copyInstruction` method for all values that are pushed on the frame's when executing some copying instructions. For example, in the case of SWAP, copyInstruction 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.
The method `findItemByIndex` only looked at the first item in each bucket of the `items` hash table. Also, in case the item was not found, the counter `i` would be at `items.length`, therefore the access `items[i]` crashed with an ArrayIndexOutOfBoundsException. Fixes the issue scala/scala-asm#8.
@varming FYI, here's the umbrella issue I'm using to scope out JDK9 support: scala/scala-dev#139 |
16 tasks
FYI: The change to ASM was discussed here: https://bugs.openjdk.java.net/browse/JDK-8147755 |
@@ -19,10 +19,10 @@ This makes it easy to see how our fork differs from the official release. | |||
|
|||
## Current Version | |||
|
|||
The current sources are based on the following version of ASM ([browse tags here](http://websvn.ow2.org/listing.php?repname=asm&path=%2Ftags%2F&peg=1748)): | |||
The current sources are based on the following version of ASM ([browse tags here](http://websvn.ow2.org/listing.php?repname=asm&path=%2Ftags%2F&peg=1827)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://websvn.ow2.org/listing.php?repname=asm&path=%2Ftags%2F works and doesn't have a revision in the url
LGTM otherwise, thanks a lot! |
Dear @lrytz, I addressed your comments from README.md. |
Thanks! |
pushed a new release (http://repo2.maven.org/maven2/org/scala-lang/modules/scala-asm/5.1.0-scala-1/) and started using it (scala/scala#5293). |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
I tried to run scala with a JDK9 early access release 127 and ran into this:
A similar error has been reported to OpenJDK: https://bugs.openjdk.java.net/browse/JDK-8159375. The solution there was to upgrade to ASM 5.1 which handle method references on interfaces correctly (see revision r1791 and r1792 in the ASM svn repo).