github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

chanwit / groovy-aop

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 1
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Tree: c189dcb

click here to add a description

click here to add a homepage

  • Branches (18)
    • 0.5
    • 0.5.1
    • 0.5.2
    • 0.5.3
    • 0.6
    • asm
    • asm-gigatron
    • asm-uf038
    • asm-with-cli2
    • dev
    • geelab
    • gjit
    • joinpoints
    • local
    • master
    • pcall
    • soot
    • version_0.4
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.
  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

cleaned up 
chanwit (author)
Fri Sep 04 08:40:05 -0700 2009
commit  c189dcbea716ba871fbb3f0e6ac25e9f9b5a9ff0
tree    9202dddba7bdba815e0f17c8a9978d074b881b65
parent  a7b657303d225b42c0b245295e058936dd653495
groovy-aop / src / test / groovy / org / codehaus / groovy / gjit / asm / transformer / AutoBoxEliminatorTxTests.groovy src/test/groovy/org/codehaus/groovy/gjit/asm/transformer/AutoBoxEliminatorTxTests.groovy
100644 40 lines (35 sloc) 1.262 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package org.codehaus.groovy.gjit.asm.transformer
 
import org.codehaus.groovy.gjit.asm.InsnListHelper
import org.codehaus.groovy.gjit.asm.transformer.AutoBoxEliminatorTransformer
import org.objectweb.asm.tree.MethodInsnNode
import org.objectweb.asm.tree.InsnNode
import org.objectweb.asm.tree.VarInsnNode
import org.objectweb.asm.tree.TypeInsnNode
import org.objectweb.asm.tree.MethodNode
import org.objectweb.asm.Opcodes
 
import groovy.util.GroovyTestCase
 
public class AutoBoxEliminatorTxTests extends GroovyTestCase implements Opcodes {
 
// ILOAD 0
// INVOKESTATIC java/lang/Integer.valueOf(I)Ljava/lang/Integer;
// CHECKCAST java/lang/Integer
// INVOKEVIRTUAL java/lang/Integer.intValue()I
// IRETURN
    void testEliminatingInteger() {
        InsnListHelper.install()
        def mn = new MethodNode()
        def units = mn.instructions
        units.append {
            iload 0
            invokestatic Integer,"valueOf",[int],Integer
            checkcast Integer
            invokevirtual Integer,"intValue",[],int
            ireturn
        }
        new AutoBoxEliminatorTransformer().internalTransform(mn, null);
        assert units.size() == 2
        assertEquals asm {
            iload 0
            ireturn
        }, units
    }
 
}
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server