Mercurial > hg > graal-jvmci-8
comparison src/share/vm/classfile/systemDictionary.cpp @ 13400:86e6d691f2e1
8028128: Add a type safe alternative for working with counter based data
Reviewed-by: dholmes, egahlin
author | mgronlun |
---|---|
date | Sat, 23 Nov 2013 12:25:13 +0100 |
parents | 1c90f0072f0d |
children | 02f27ecb4f3a f9508a2fd4d8 |
comparison
equal
deleted
inserted
replaced
13399:260ac69dc096 | 13400:86e6d691f2e1 |
---|---|
53 #include "runtime/javaCalls.hpp" | 53 #include "runtime/javaCalls.hpp" |
54 #include "runtime/mutexLocker.hpp" | 54 #include "runtime/mutexLocker.hpp" |
55 #include "runtime/signature.hpp" | 55 #include "runtime/signature.hpp" |
56 #include "services/classLoadingService.hpp" | 56 #include "services/classLoadingService.hpp" |
57 #include "services/threadService.hpp" | 57 #include "services/threadService.hpp" |
58 #include "utilities/macros.hpp" | |
59 #include "utilities/ticks.hpp" | |
58 | 60 |
59 #if INCLUDE_TRACE | 61 #if INCLUDE_TRACE |
60 #include "trace/tracing.hpp" | 62 #include "trace/tracing.hpp" |
61 #include "trace/traceMacros.hpp" | |
62 #endif | 63 #endif |
63 | |
64 | 64 |
65 Dictionary* SystemDictionary::_dictionary = NULL; | 65 Dictionary* SystemDictionary::_dictionary = NULL; |
66 PlaceholderTable* SystemDictionary::_placeholders = NULL; | 66 PlaceholderTable* SystemDictionary::_placeholders = NULL; |
67 Dictionary* SystemDictionary::_shared_dictionary = NULL; | 67 Dictionary* SystemDictionary::_shared_dictionary = NULL; |
68 LoaderConstraintTable* SystemDictionary::_loader_constraints = NULL; | 68 LoaderConstraintTable* SystemDictionary::_loader_constraints = NULL; |
596 Handle protection_domain, | 596 Handle protection_domain, |
597 TRAPS) { | 597 TRAPS) { |
598 assert(name != NULL && !FieldType::is_array(name) && | 598 assert(name != NULL && !FieldType::is_array(name) && |
599 !FieldType::is_obj(name), "invalid class name"); | 599 !FieldType::is_obj(name), "invalid class name"); |
600 | 600 |
601 TracingTime class_load_start_time = Tracing::time(); | 601 Ticks class_load_start_time = Ticks::now(); |
602 | 602 |
603 // UseNewReflection | 603 // UseNewReflection |
604 // Fix for 4474172; see evaluation for more details | 604 // Fix for 4474172; see evaluation for more details |
605 class_loader = Handle(THREAD, java_lang_ClassLoader::non_reflection_class_loader(class_loader())); | 605 class_loader = Handle(THREAD, java_lang_ClassLoader::non_reflection_class_loader(class_loader())); |
606 ClassLoaderData *loader_data = register_loader(class_loader, CHECK_NULL); | 606 ClassLoaderData *loader_data = register_loader(class_loader, CHECK_NULL); |
1004 KlassHandle host_klass, | 1004 KlassHandle host_klass, |
1005 GrowableArray<Handle>* cp_patches, | 1005 GrowableArray<Handle>* cp_patches, |
1006 TRAPS) { | 1006 TRAPS) { |
1007 TempNewSymbol parsed_name = NULL; | 1007 TempNewSymbol parsed_name = NULL; |
1008 | 1008 |
1009 TracingTime class_load_start_time = Tracing::time(); | 1009 Ticks class_load_start_time = Ticks::now(); |
1010 | 1010 |
1011 ClassLoaderData* loader_data; | 1011 ClassLoaderData* loader_data; |
1012 if (host_klass.not_null()) { | 1012 if (host_klass.not_null()) { |
1013 // Create a new CLD for anonymous class, that uses the same class loader | 1013 // Create a new CLD for anonymous class, that uses the same class loader |
1014 // as the host_klass | 1014 // as the host_klass |
2663 guarantee(probe != NULL || name != NULL, | 2663 guarantee(probe != NULL || name != NULL, |
2664 "Loaded klasses should be in SystemDictionary"); | 2664 "Loaded klasses should be in SystemDictionary"); |
2665 } | 2665 } |
2666 | 2666 |
2667 // utility function for class load event | 2667 // utility function for class load event |
2668 void SystemDictionary::post_class_load_event(TracingTime start_time, | 2668 void SystemDictionary::post_class_load_event(const Ticks& start_time, |
2669 instanceKlassHandle k, | 2669 instanceKlassHandle k, |
2670 Handle initiating_loader) { | 2670 Handle initiating_loader) { |
2671 #if INCLUDE_TRACE | 2671 #if INCLUDE_TRACE |
2672 EventClassLoad event(UNTIMED); | 2672 EventClassLoad event(UNTIMED); |
2673 if (event.should_commit()) { | 2673 if (event.should_commit()) { |
2674 event.set_endtime(Tracing::time()); | |
2675 event.set_starttime(start_time); | 2674 event.set_starttime(start_time); |
2676 event.set_loadedClass(k()); | 2675 event.set_loadedClass(k()); |
2677 oop defining_class_loader = k->class_loader(); | 2676 oop defining_class_loader = k->class_loader(); |
2678 event.set_definingClassLoader(defining_class_loader != NULL ? | 2677 event.set_definingClassLoader(defining_class_loader != NULL ? |
2679 defining_class_loader->klass() : (Klass*)NULL); | 2678 defining_class_loader->klass() : (Klass*)NULL); |