< prev index next >

src/hotspot/share/prims/jvmtiExport.cpp

Print this page




1026 static inline Klass* oop_to_klass(oop obj) {
1027   Klass* k = obj->klass();
1028 
1029   // if the object is a java.lang.Class then return the java mirror
1030   if (k == SystemDictionary::Class_klass()) {
1031     if (!java_lang_Class::is_primitive(obj)) {
1032       k = java_lang_Class::as_Klass(obj);
1033       assert(k != NULL, "class for non-primitive mirror must exist");
1034     }
1035   }
1036   return k;
1037 }
1038 
1039 class JvmtiObjectAllocEventMark : public JvmtiClassEventMark  {
1040  private:
1041    jobject _jobj;
1042    jlong    _size;
1043  public:
1044    JvmtiObjectAllocEventMark(JavaThread *thread, oop obj) : JvmtiClassEventMark(thread, oop_to_klass(obj)) {
1045      _jobj = (jobject)to_jobject(obj);
1046      _size = obj->size() * wordSize;
1047    };
1048    jobject jni_jobject() { return _jobj; }
1049    jlong size() { return _size; }
1050 };
1051 
1052 class JvmtiCompiledMethodLoadEventMark : public JvmtiMethodEventMark {
1053  private:
1054   jint _code_size;
1055   const void *_code_data;
1056   jint _map_length;
1057   jvmtiAddrLocationMap *_map;
1058   const void *_compile_info;
1059  public:
1060   JvmtiCompiledMethodLoadEventMark(JavaThread *thread, nmethod *nm, void* compile_info_ptr = NULL)
1061           : JvmtiMethodEventMark(thread,methodHandle(thread, nm->method())) {
1062     _code_data = nm->insts_begin();
1063     _code_size = nm->insts_size();
1064     _compile_info = compile_info_ptr; // Set void pointer of compiledMethodLoad Event. Default value is NULL.
1065     JvmtiCodeBlobEvents::build_jvmti_addr_location_map(nm, &_map, &_map_length);
1066   }




1026 static inline Klass* oop_to_klass(oop obj) {
1027   Klass* k = obj->klass();
1028 
1029   // if the object is a java.lang.Class then return the java mirror
1030   if (k == SystemDictionary::Class_klass()) {
1031     if (!java_lang_Class::is_primitive(obj)) {
1032       k = java_lang_Class::as_Klass(obj);
1033       assert(k != NULL, "class for non-primitive mirror must exist");
1034     }
1035   }
1036   return k;
1037 }
1038 
1039 class JvmtiObjectAllocEventMark : public JvmtiClassEventMark  {
1040  private:
1041    jobject _jobj;
1042    jlong    _size;
1043  public:
1044    JvmtiObjectAllocEventMark(JavaThread *thread, oop obj) : JvmtiClassEventMark(thread, oop_to_klass(obj)) {
1045      _jobj = (jobject)to_jobject(obj);
1046      _size = (obj->size() + Universe::heap()->oop_extra_words()) * wordSize;
1047    };
1048    jobject jni_jobject() { return _jobj; }
1049    jlong size() { return _size; }
1050 };
1051 
1052 class JvmtiCompiledMethodLoadEventMark : public JvmtiMethodEventMark {
1053  private:
1054   jint _code_size;
1055   const void *_code_data;
1056   jint _map_length;
1057   jvmtiAddrLocationMap *_map;
1058   const void *_compile_info;
1059  public:
1060   JvmtiCompiledMethodLoadEventMark(JavaThread *thread, nmethod *nm, void* compile_info_ptr = NULL)
1061           : JvmtiMethodEventMark(thread,methodHandle(thread, nm->method())) {
1062     _code_data = nm->insts_begin();
1063     _code_size = nm->insts_size();
1064     _compile_info = compile_info_ptr; // Set void pointer of compiledMethodLoad Event. Default value is NULL.
1065     JvmtiCodeBlobEvents::build_jvmti_addr_location_map(nm, &_map, &_map_length);
1066   }


< prev index next >