class ReflectiveValueVisitor; class ShadowFrameGetter;
namespace mirror {
class MethodType; class RawMethodType; class VarHandleTest;
// C++ mirror of java.lang.invoke.VarHandle class MANAGED VarHandle : public Object { public:
MIRROR_CLASS("Ljava/lang/invoke/VarHandle;");
// The maximum number of parameters a VarHandle accessor method can // take. The Worst case is equivalent to a compare-and-swap // operation on an array element which requires four parameters // (array, index, old, new). static constexpr int kMaxAccessorParameters = 4;
// The maximum number of VarType parameters a VarHandle accessor // method can take. static constexpr size_t kMaxVarTypeParameters = 2;
// The minimum number of CoordinateType parameters a VarHandle acessor method may take. static constexpr size_t kMinCoordinateTypes = 0;
// The maximum number of CoordinateType parameters a VarHandle acessor method may take. static constexpr size_t kMaxCoordinateTypes = 2;
// Returns match information on the compatability between the exact method type for // 'access_mode' and the provided 'method_type'.
MatchKind GetMethodTypeMatchForAccessMode(AccessMode access_mode, ObjPtr<MethodType> method_type)
REQUIRES_SHARED(Locks::mutator_lock_);
MatchKind GetMethodTypeMatchForAccessMode(AccessMode access_mode, Handle<MethodType> method_type)
REQUIRES_SHARED(Locks::mutator_lock_);
MatchKind GetMethodTypeMatchForAccessMode(AccessMode access_mode, RawMethodType method_type)
REQUIRES_SHARED(Locks::mutator_lock_);
// Allocates and returns the MethodType associated with the // AccessMode. No check is made for whether the AccessMode is a // supported operation so the MethodType can be used when raising a // WrongMethodTypeException exception.
ObjPtr<MethodType> GetMethodTypeForAccessMode(Thread* self, AccessMode access_mode)
REQUIRES_SHARED(Locks::mutator_lock_);
// Overload that fills a handle scope with the return type and argument types // instead of creating an actual `MethodType`. void GetMethodTypeForAccessMode(AccessMode access_mode, /*out*/ RawMethodType method_type)
REQUIRES_SHARED(Locks::mutator_lock_);
// Returns a string representing the descriptor of the MethodType associated with // this AccessMode.
std::string PrettyDescriptorForAccessMode(AccessMode access_mode)
REQUIRES_SHARED(Locks::mutator_lock_);
// Gets the variable type that is operated on by this VarHandle instance.
ObjPtr<Class> GetVarType() REQUIRES_SHARED(Locks::mutator_lock_);
// Gets the type of the object that this VarHandle operates on, null for StaticFieldVarHandle.
ObjPtr<Class> GetCoordinateType0() REQUIRES_SHARED(Locks::mutator_lock_);
// Gets the return type descriptor for a named accessor method, // nullptr if accessor_method is not supported. staticconstchar* GetReturnTypeDescriptor(constchar* accessor_method);
// Returns the AccessMode corresponding to a VarHandle accessor intrinsic. static AccessMode GetAccessModeByIntrinsic(Intrinsics ordinal);
// Returns true and sets access_mode if method_name corresponds to a // VarHandle access method, such as "setOpaque". Returns false otherwise. staticbool GetAccessModeByMethodName(constchar* method_name, AccessMode* access_mode);
// Returns the AccessModeTemplate for a given mode. static AccessModeTemplate GetAccessModeTemplate(AccessMode access_mode);
// Returns the AccessModeTemplate corresponding to a VarHandle accessor intrinsic. static AccessModeTemplate GetAccessModeTemplateByIntrinsic(Intrinsics ordinal);
// Returns the number of VarType parameters for an access mode template. static int32_t GetNumberOfVarTypeParameters(AccessModeTemplate access_mode_template);
friendclass VarHandleTest; // for testing purposes friendstruct art::VarHandleOffsets; // for verifying offset information
DISALLOW_IMPLICIT_CONSTRUCTORS(VarHandle);
};
// Represents a VarHandle to a static or instance field. // The corresponding managed class in libart java.lang.invoke.FieldVarHandle. class MANAGED FieldVarHandle : public VarHandle { public:
MIRROR_CLASS("Ljava/lang/invoke/FieldVarHandle;");
private: // ArtField instance corresponding to variable for accessors.
int64_t art_field_;
friendclass VarHandleTest; // for var_handle_test. friendstruct art::FieldVarHandleOffsets; // for verifying offset information
DISALLOW_IMPLICIT_CONSTRUCTORS(FieldVarHandle);
};
class MANAGED StaticFieldVarHandle : public FieldVarHandle { public:
MIRROR_CLASS("Ljava/lang/invoke/StaticFieldVarHandle;");
// Used for updating var-handles to obsolete fields. void VisitTarget(ReflectiveValueVisitor* v) REQUIRES(Locks::mutator_lock_);
friendclass VarHandleTest; // for var_handle_test. friendstruct art::StaticFieldVarHandleOffsets; // for verifying offset information
DISALLOW_IMPLICIT_CONSTRUCTORS(StaticFieldVarHandle);
};
// Represents a VarHandle providing accessors to an array. // The corresponding managed class in libart java.lang.invoke.ArrayElementVarHandle. class MANAGED ArrayElementVarHandle : public VarHandle { public:
MIRROR_CLASS("Ljava/lang/invoke/ArrayElementVarHandle;");
// Represents a VarHandle providing accessors to a view of a ByteArray. // The corresponding managed class in libart java.lang.invoke.ByteArrayViewVarHandle. class MANAGED ByteArrayViewVarHandle : public VarHandle { public:
MIRROR_CLASS("Ljava/lang/invoke/ByteArrayViewVarHandle;");
private: // Flag indicating that accessors should use native byte-ordering.
uint8_t native_byte_order_;
friendclass VarHandleTest; // for var_handle_test. friendstruct art::ByteArrayViewVarHandleOffsets; // for verifying offset information
DISALLOW_IMPLICIT_CONSTRUCTORS(ByteArrayViewVarHandle);
};
// Represents a VarHandle providing accessors to a view of a ByteBuffer // The corresponding managed class in libart java.lang.invoke.ByteBufferViewVarHandle. class MANAGED ByteBufferViewVarHandle : public VarHandle { public:
MIRROR_CLASS("Ljava/lang/invoke/ByteBufferViewVarHandle;");
// Flag indicating that accessors should use native byte-ordering.
uint8_t native_byte_order_;
friendclass VarHandleTest; // for var_handle_test. friendstruct art::ByteBufferViewVarHandleOffsets; // for verifying offset information
DISALLOW_IMPLICIT_CONSTRUCTORS(ByteBufferViewVarHandle);
};
class MANAGED MemorySegmentVarHandle : public VarHandle { public:
MIRROR_CLASS("Ljava/lang/invoke/MemorySegmentVarHandle;");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.