summaryrefslogtreecommitdiff
path: root/src/asm
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate unreachable code in GenBCodeLukas Rytz2014-09-091-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We rely on dead code elimination provided by the ASM framework, as described in the ASM User Guide (http://asm.ow2.org/index.html), Section 8.2.1. It runs a data flow analysis, which only computes information for reachable instructions. Instructions for which no data is available after the analyis are unreachable. There's one issue with the ASM framework (or the way we use it): Data flow analysis requires the maxlocals and maxstack of each method to be computed. The ASM framework calculates these maxes only when writing the classfiles, not during code generation. In order to run DCE, we therefore run a MethodWriter beforehand on every method. This assings the MethodNode's maxStack/maxLocals, but it does more work (writes the instructions to a byte array). This is also what Miguel uses on his branch. The change is basically the same as https://github.com/lrytz/scala/commit/bfadf92c20. We could probably make this faster (and allocate less memory) by hacking the ASM framework: create a subclass of MethodWriter with a /dev/null byteVector. Another option would be to create a separate visitor for computing those values, duplicating the functionality from the MethodWriter. For now, I added some timers to be able to measure the time DCE takes. Here's compiling the library with -Ystatistics:jvm time in backend : 1 spans, 6597ms bcode initialization : 1 spans, 8ms (0.1%) code generation : 1 spans, 4580ms (69.4%) dead code elimination : 3771 spans, 742ms (11.2%) classfile writing : 1 spans, 879ms (13.3%)
* Upgrade ASM to 5.0.2Lukas Rytz2014-05-2064-294/+3825
| | | | | | | | | | | | | This commit is a squashed version of all commits in PR #3747. For future upgrades, consult the README and check the commits in https://github.com/scala/scala/pull/3747/commits There's one bug in ASM 5.0.2 that breaks scalac: http://forge.ow2.org/tracker/?func=detail&aid=317200&group_id=23&atid=100023 This bug is fixed in ASM trunk, the patch has been merged into this commit. A future upgrade of ASM should contain the fix.
* Merge commit '97b9b2c06a' from 2.10.x into masterAdriaan Moors2014-01-171-1/+6
|\ | | | | | | | | | | | | | | | | Check files updated: test/files/presentation/t8085*.check Conflicts: build.xml src/compiler/scala/tools/nsc/ast/parser/Parsers.scala src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
| * Report error on code size overflow, log method name.Adriaan Moors2013-12-121-1/+6
| | | | | | | | | | | | | | We used to silently skip class files that would exceed the JVM's size limits. While rare, this should still be an error. While I was at it, also included the name of the offending method.
* | new bytecode emitter, GenBCode, for now under a flagMiguel Garcia2013-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GenBCode is a drop-in replacement for GenASM with several advantages: - faster: ICode isn't necessary anymore. Instead, the ASTs delivered by CleanUp (an expression language) are translated directly into a stack-language (ASM Tree nodes) - future-proofing for Java 8 (MethodHandles, invokedynamic). - documentation included, shared mutable state kept to a minimum, all contributing to making GenBCode more maintainable than its counterpart (its counterpart being GenICode + GenASM). A few tests are modified in this commit, for reasons given below. (1) files/neg/case-collision Just like GenASM, GenBCode also detects output classfiles differing only in case. However the error message differs from that of GenASM (collisions may be show in different order). Thus the original test now has a flags file containing -neo:GenASM and a new test (files/neg/case-collision2) has been added for GenBCode. The .check files in each case show expected output. (2) files/pos/t5031_3 Currently the test above doesn't work with GenBCode (try with -neo:GenBCode in the flags file) The root cause lies in the fix to https://issues.scala-lang.org/browse/SI-5031 which weakened an assertion in GenASM (GenBCode keeps the original assertion). Actually that ticket mentions the fix is a "workaround" (3) files/run/t7008-scala-defined This test also passes only under GenASM and not GenBCode, thus the flags file. GenASM turns a bling eye to: An AbstractTypeSymbol (SI-7122) has reached the bytecode emitter, for which no JVM-level internal name can be found: ScalaClassWithCheckedExceptions_1.E1 The error message above (shown by GenBCode) highlights there's no ScalaClassWithCheckedExceptions_1.E1 class, thus shouldn't show up in the emitted bytecode (GenASM emits bytecode that mentions the inexistent class).
* | check added instruction to ASM MethodNodeMiguel Garcia2013-04-251-0/+8
| |
* | Updated asm to 4.1.Paul Phillips2012-11-2473-7417/+7402
|/ | | | | | | | Released 2012-10-14. One of the listed features is 316321: asm osgi bundles based on BND. in case that's interesting to someone.
* Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013Heather Miller2012-11-022-2/+2
|
* ASM now compiled once in the build.Josh Suereth2012-05-2377-0/+28021
* Moved ASM sources to src/asm * New ant task builds asm *ONCE*. Build times improve by a few seconds * Fixed SBT build for new asm location. SBT build still broken from actors-migration and partest Review by @magarciaEPFL