aboutsummaryrefslogtreecommitdiff
path: root/graph
diff options
context:
space:
mode:
authorReynold Xin <rxin@cs.berkeley.edu>2013-06-29 15:39:48 -0700
committerReynold Xin <rxin@cs.berkeley.edu>2013-06-29 15:39:48 -0700
commit758ceff778a5590297fe9b712d9642f009f9b628 (patch)
treee608f23f6812e343c6cd69153ac045affb5485a6 /graph
parent564d902d793a3a373a36b006eb5bc5a91cc252dc (diff)
downloadspark-758ceff778a5590297fe9b712d9642f009f9b628.tar.gz
spark-758ceff778a5590297fe9b712d9642f009f9b628.tar.bz2
spark-758ceff778a5590297fe9b712d9642f009f9b628.zip
Updated BytecodeUtils to ASM4.
Diffstat (limited to 'graph')
-rw-r--r--graph/src/main/scala/spark/graph/util/BytecodeUtils.scala10
1 files changed, 5 insertions, 5 deletions
diff --git a/graph/src/main/scala/spark/graph/util/BytecodeUtils.scala b/graph/src/main/scala/spark/graph/util/BytecodeUtils.scala
index 268a3c2bcf..ac3a1fb957 100644
--- a/graph/src/main/scala/spark/graph/util/BytecodeUtils.scala
+++ b/graph/src/main/scala/spark/graph/util/BytecodeUtils.scala
@@ -4,8 +4,7 @@ import java.io.{ByteArrayInputStream, ByteArrayOutputStream}
import scala.collection.mutable.HashSet
-import org.objectweb.asm.{ClassReader, MethodVisitor}
-import org.objectweb.asm.commons.EmptyVisitor
+import org.objectweb.asm.{ClassReader, ClassVisitor, MethodVisitor}
import org.objectweb.asm.Opcodes._
import spark.Utils
@@ -45,7 +44,7 @@ private[graph] object BytecodeUtils {
val finder = new MethodInvocationFinder(c.getName, m)
getClassReader(c).accept(finder, 0)
for (classMethod <- finder.methodsInvoked) {
- println(classMethod)
+ //println(classMethod)
if (classMethod._1 == targetClass && classMethod._2 == targetMethod) {
return true
} else if (!seen.contains(classMethod)) {
@@ -89,14 +88,15 @@ private[graph] object BytecodeUtils {
* Foo.test(). Interface invocations are not returned as part of the result set because we cannot
* determine the actual metod invoked by inspecting the bytecode.
*/
- private class MethodInvocationFinder(className: String, methodName: String) extends EmptyVisitor {
+ private class MethodInvocationFinder(className: String, methodName: String)
+ extends ClassVisitor(ASM4) {
val methodsInvoked = new HashSet[(Class[_], String)]
override def visitMethod(access: Int, name: String, desc: String,
sig: String, exceptions: Array[String]): MethodVisitor = {
if (name == methodName) {
- new EmptyVisitor {
+ new MethodVisitor(ASM4) {
override def visitMethodInsn(op: Int, owner: String, name: String, desc: String) {
if (op == INVOKEVIRTUAL || op == INVOKESPECIAL || op == INVOKESTATIC) {
if (!skipClass(owner)) {