public class HotSpotAdvisor extends Object
Conseptually, this class, with the aid of HotSpotAdvise, provides the same thing as AspectJs' join-point, before advice, after advice and around advice.
At some point in time, we might add point-cut semantics here. At the moment, point-cut semantics can be simulated to some extent with the aid of InstrumentationDescriptor
At the moment there is not such thing as HotSpotContext. For example, HotSpotAdvice knows, that an invocation is being made, but it does not know what are the call parameters of the invocation, and it does not know what the invocation returned.
Future versions of HotSpotAdvice might have this knowledge.
HotSpotAdvice
,
for the definition of hotspot
Modifier and Type | Field and Description |
---|---|
static byte[] |
FIELD_ACCESSES
This field can be used in constructor to search for hotspots, that do
some sort of field access.
|
static byte[] |
INVOCATIONS
This field can be used in constructor to search for any invocations being
made.
|
static byte[] |
RETURNS
This field can be used in constructor to search for hotspots, that makes
a method return normally.
|
Constructor and Description |
---|
HotSpotAdvisor(InstrumentationDescriptor id,
HotSpotAdvice advice,
byte hotSpot)
Creates new HotSpotAdvisor.
|
HotSpotAdvisor(InstrumentationDescriptor id,
HotSpotAdvice advice,
byte[] hotSpots)
Creates new HotSpotAdvisor.
|
HotSpotAdvisor(InstrumentationDescriptor id,
HotSpotAdvice advice,
byte[] hotSpots,
String resolution)
Creates new HotSpotAdvisor.
|
Modifier and Type | Method and Description |
---|---|
void |
checkForBranchTarget(Instruction firstHotSpotInstruction,
InstructionList methodList,
Instruction firstBeforeInstruction) |
public static final byte[] INVOCATIONS
byte[] invocations = new byte[] { Opcodes.INVOKESTATIC, Opcodes.INVOKEVIRTUAL, Opcodes.INVOKEINTERFACE };
public static final byte[] RETURNS
public static final byte[] FIELD_ACCESSES
public HotSpotAdvisor(InstrumentationDescriptor id, HotSpotAdvice advice, byte hotSpot)
id
- InstrumentationDescriptor to use. A Special instruction copy
Instrumentor is added to this descriptor, so users should only
add inclusion/exclusion rules to descriptor.advice
- A HotSpotAdvice where instructions to be copied are taken.hotSpot
- this byte represents an opcode of the hotspot.Opcodes
public HotSpotAdvisor(InstrumentationDescriptor id, HotSpotAdvice advice, byte[] hotSpots)
id
- InstrumentationDescriptor to use. A Special instruction copy
Instrumentor is added to this descriptor, so users should only
add inclusion/exclusion rules to descriptor.advice
- A HotSpotAdvice where instructions to be copied are taken.hotSpots
- an array of bytes. Each byte represents an opcode of the
hotspot. So, multiple opcodes may be used.INVOCATIONS
,
RETURNS
,
FIELD_ACCESSES
,
Opcodes
,
OpcodeGroups
public HotSpotAdvisor(InstrumentationDescriptor id, HotSpotAdvice advice, byte[] hotSpots, String resolution)
id
- InstrumentationDescriptor to use. A Special instruction copy
Instrumentor is added to this descriptor, so users should only
add inclusion/exclusion rules to descriptor.advice
- A HotSpotAdvice where instructions to be copied are taken.hotSpots
- an array of bytes. Each byte represents an opcode of the
hotspot. So, multiple opcodes may be used.resolution
- ResolutionINVOCATIONS
,
RETURNS
,
FIELD_ACCESSES
,
Opcodes
,
OpcodeGroups
public void checkForBranchTarget(Instruction firstHotSpotInstruction, InstructionList methodList, Instruction firstBeforeInstruction)
Copyright © 2017. All rights reserved.