--- a/hotspot/src/share/vm/ci/ciMethod.cpp Tue Oct 11 02:19:37 2011 -0700
+++ b/hotspot/src/share/vm/ci/ciMethod.cpp Wed Oct 12 21:00:13 2011 -0700
@@ -148,21 +148,27 @@
//
// Unloaded method.
ciMethod::ciMethod(ciInstanceKlass* holder,
- ciSymbol* name,
- ciSymbol* signature) : ciObject(ciMethodKlass::make()) {
- // These fields are always filled in.
- _name = name;
- _holder = holder;
- _signature = new (CURRENT_ENV->arena()) ciSignature(_holder, constantPoolHandle(), signature);
- _intrinsic_id = vmIntrinsics::_none;
- _liveness = NULL;
- _can_be_statically_bound = false;
- _method_blocks = NULL;
- _method_data = NULL;
+ ciSymbol* name,
+ ciSymbol* signature,
+ ciInstanceKlass* accessor) :
+ ciObject(ciMethodKlass::make()),
+ _name( name),
+ _holder( holder),
+ _intrinsic_id( vmIntrinsics::_none),
+ _liveness( NULL),
+ _can_be_statically_bound(false),
+ _method_blocks( NULL),
+ _method_data( NULL)
#if defined(COMPILER2) || defined(SHARK)
- _flow = NULL;
- _bcea = NULL;
+ ,
+ _flow( NULL),
+ _bcea( NULL)
#endif // COMPILER2 || SHARK
+{
+ // Usually holder and accessor are the same type but in some cases
+ // the holder has the wrong class loader (e.g. invokedynamic call
+ // sites) so we pass the accessor.
+ _signature = new (CURRENT_ENV->arena()) ciSignature(accessor, constantPoolHandle(), signature);
}