public class AllocationInstrumenter extends Object implements ClassFileTransformer
Modifier and Type | Method and Description |
---|---|
static byte[] |
instrument(byte[] originalBytes) |
static byte[] |
instrument(byte[] originalBytes,
String recorderClass,
String recorderMethod)
Given the bytes representing a class, go through all the bytecode in it and
instrument any occurences of new/newarray/anewarray/multianewarray with
pre- and post-allocation hooks.
|
static void |
premain(String agentArgs,
Instrumentation inst) |
byte[] |
transform(ClassLoader loader,
String className,
Class<?> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] origBytes) |
public static void premain(String agentArgs, Instrumentation inst)
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] origBytes)
transform
in interface ClassFileTransformer
public static byte[] instrument(byte[] originalBytes, String recorderClass, String recorderMethod)
originalBytes
- the original byte[]
code.recorderClass
- the String
internal name of the class
containing the recorder method to run.recorderMethod
- the String
name of the recorder method
to run.byte[]
code.public static byte[] instrument(byte[] originalBytes)
Copyright © 2009-2013 Google, Inc.. All Rights Reserved.