< prev index next >

src/hotspot/share/prims/jvmtiExport.cpp

Print this page
rev 52174 : 8212186: JVMTI lacks a few GC barriers/hooks


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




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


< prev index next >