Mercurial > hg > truffle
comparison src/share/vm/runtime/vmStructs.cpp @ 7583:91bf7da5c609
8004747: Remove last_entry from VM_STRUCT macros
Summary: Instead of passing in last_entry to all the VM_ macros just expand it in the main vmStructs.cpp file.
Reviewed-by: dholmes, sspitsyn, minqi
author | mikael |
---|---|
date | Thu, 10 Jan 2013 17:06:26 -0800 |
parents | fd74228fd5ca |
children | c1c8479222cd |
comparison
equal
deleted
inserted
replaced
7582:aefb345d3f5e | 7583:91bf7da5c609 |
---|---|
255 volatile_nonstatic_field, \ | 255 volatile_nonstatic_field, \ |
256 nonproduct_nonstatic_field, \ | 256 nonproduct_nonstatic_field, \ |
257 c1_nonstatic_field, \ | 257 c1_nonstatic_field, \ |
258 c2_nonstatic_field, \ | 258 c2_nonstatic_field, \ |
259 unchecked_c1_static_field, \ | 259 unchecked_c1_static_field, \ |
260 unchecked_c2_static_field, \ | 260 unchecked_c2_static_field) \ |
261 last_entry) \ | |
262 \ | 261 \ |
263 /******************************************************************/ \ | 262 /******************************************************************/ \ |
264 /* OopDesc and Klass hierarchies (NOTE: MethodData* incomplete) */ \ | 263 /* OopDesc and Klass hierarchies (NOTE: MethodData* incomplete) */ \ |
265 /******************************************************************/ \ | 264 /******************************************************************/ \ |
266 \ | 265 \ |
1236 nonstatic_field(FreeList<Metablock>, _size, size_t) \ | 1235 nonstatic_field(FreeList<Metablock>, _size, size_t) \ |
1237 nonstatic_field(FreeList<FreeChunk>, _count, ssize_t) \ | 1236 nonstatic_field(FreeList<FreeChunk>, _count, ssize_t) \ |
1238 nonstatic_field(FreeList<Metablock>, _count, ssize_t) \ | 1237 nonstatic_field(FreeList<Metablock>, _count, ssize_t) \ |
1239 nonstatic_field(MetablockTreeDictionary, _total_size, size_t) | 1238 nonstatic_field(MetablockTreeDictionary, _total_size, size_t) |
1240 | 1239 |
1241 /* NOTE that we do not use the last_entry() macro here; it is used */ | |
1242 /* in vmStructs_<os>_<cpu>.hpp's VM_STRUCTS_OS_CPU macro (and must */ | |
1243 /* be present there) */ | |
1244 | 1240 |
1245 //-------------------------------------------------------------------------------- | 1241 //-------------------------------------------------------------------------------- |
1246 // VM_TYPES | 1242 // VM_TYPES |
1247 // | 1243 // |
1248 // This list must enumerate at least all of the types in the above | 1244 // This list must enumerate at least all of the types in the above |
1278 declare_oop_type, \ | 1274 declare_oop_type, \ |
1279 declare_integer_type, \ | 1275 declare_integer_type, \ |
1280 declare_unsigned_integer_type, \ | 1276 declare_unsigned_integer_type, \ |
1281 declare_c1_toplevel_type, \ | 1277 declare_c1_toplevel_type, \ |
1282 declare_c2_type, \ | 1278 declare_c2_type, \ |
1283 declare_c2_toplevel_type, \ | 1279 declare_c2_toplevel_type) \ |
1284 last_entry) \ | |
1285 \ | 1280 \ |
1286 /*************************************************************/ \ | 1281 /*************************************************************/ \ |
1287 /* Java primitive types -- required by the SA implementation */ \ | 1282 /* Java primitive types -- required by the SA implementation */ \ |
1288 /* in order to determine the size of Java fields in this VM */ \ | 1283 /* in order to determine the size of Java fields in this VM */ \ |
1289 /* (the implementation looks up these names specifically) */ \ | 1284 /* (the implementation looks up these names specifically) */ \ |
2096 declare_toplevel_type(FreeList<Metablock>) \ | 2091 declare_toplevel_type(FreeList<Metablock>) \ |
2097 declare_toplevel_type(MetablockTreeDictionary*) \ | 2092 declare_toplevel_type(MetablockTreeDictionary*) \ |
2098 declare_type(MetablockTreeDictionary, FreeBlockDictionary<Metablock>) | 2093 declare_type(MetablockTreeDictionary, FreeBlockDictionary<Metablock>) |
2099 | 2094 |
2100 | 2095 |
2101 /* NOTE that we do not use the last_entry() macro here; it is used */ | |
2102 /* in vmStructs_<os>_<cpu>.hpp's VM_TYPES_OS_CPU macro (and must be */ | |
2103 /* present there) */ | |
2104 | |
2105 //-------------------------------------------------------------------------------- | 2096 //-------------------------------------------------------------------------------- |
2106 // VM_INT_CONSTANTS | 2097 // VM_INT_CONSTANTS |
2107 // | 2098 // |
2108 // This table contains integer constants required over in the | 2099 // This table contains integer constants required over in the |
2109 // serviceability agent. The "declare_constant" macro is used for all | 2100 // serviceability agent. The "declare_constant" macro is used for all |
2112 | 2103 |
2113 #define VM_INT_CONSTANTS(declare_constant, \ | 2104 #define VM_INT_CONSTANTS(declare_constant, \ |
2114 declare_preprocessor_constant, \ | 2105 declare_preprocessor_constant, \ |
2115 declare_c1_constant, \ | 2106 declare_c1_constant, \ |
2116 declare_c2_constant, \ | 2107 declare_c2_constant, \ |
2117 declare_c2_preprocessor_constant, \ | 2108 declare_c2_preprocessor_constant) \ |
2118 last_entry) \ | |
2119 \ | 2109 \ |
2120 /******************/ \ | 2110 /******************/ \ |
2121 /* Useful globals */ \ | 2111 /* Useful globals */ \ |
2122 /******************/ \ | 2112 /******************/ \ |
2123 \ | 2113 \ |
2481 declare_constant(ConcreteRegisterImpl::number_of_registers) \ | 2471 declare_constant(ConcreteRegisterImpl::number_of_registers) \ |
2482 declare_preprocessor_constant("REG_COUNT", REG_COUNT) \ | 2472 declare_preprocessor_constant("REG_COUNT", REG_COUNT) \ |
2483 declare_c2_preprocessor_constant("SAVED_ON_ENTRY_REG_COUNT", SAVED_ON_ENTRY_REG_COUNT) \ | 2473 declare_c2_preprocessor_constant("SAVED_ON_ENTRY_REG_COUNT", SAVED_ON_ENTRY_REG_COUNT) \ |
2484 declare_c2_preprocessor_constant("C_SAVED_ON_ENTRY_REG_COUNT", C_SAVED_ON_ENTRY_REG_COUNT) | 2474 declare_c2_preprocessor_constant("C_SAVED_ON_ENTRY_REG_COUNT", C_SAVED_ON_ENTRY_REG_COUNT) |
2485 | 2475 |
2486 /* NOTE that we do not use the last_entry() macro here; it is used */ | |
2487 /* in vmStructs_<os>_<cpu>.hpp's VM_INT_CONSTANTS_OS_CPU macro (and */ | |
2488 /* must be present there) */ | |
2489 | 2476 |
2490 //-------------------------------------------------------------------------------- | 2477 //-------------------------------------------------------------------------------- |
2491 // VM_LONG_CONSTANTS | 2478 // VM_LONG_CONSTANTS |
2492 // | 2479 // |
2493 // This table contains long constants required over in the | 2480 // This table contains long constants required over in the |
2494 // serviceability agent. The "declare_constant" macro is used for all | 2481 // serviceability agent. The "declare_constant" macro is used for all |
2495 // enums, etc., while "declare_preprocessor_constant" must be used for | 2482 // enums, etc., while "declare_preprocessor_constant" must be used for |
2496 // all #defined constants. | 2483 // all #defined constants. |
2497 | 2484 |
2498 #define VM_LONG_CONSTANTS(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \ | 2485 #define VM_LONG_CONSTANTS(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ |
2499 \ | 2486 \ |
2500 /*********************/ \ | 2487 /*********************/ \ |
2501 /* MarkOop constants */ \ | 2488 /* MarkOop constants */ \ |
2502 /*********************/ \ | 2489 /*********************/ \ |
2503 \ | 2490 \ |
2539 declare_constant(markOopDesc::max_age) \ | 2526 declare_constant(markOopDesc::max_age) \ |
2540 \ | 2527 \ |
2541 /* Constants in markOop used by CMS. */ \ | 2528 /* Constants in markOop used by CMS. */ \ |
2542 declare_constant(markOopDesc::cms_shift) \ | 2529 declare_constant(markOopDesc::cms_shift) \ |
2543 declare_constant(markOopDesc::cms_mask) \ | 2530 declare_constant(markOopDesc::cms_mask) \ |
2544 declare_constant(markOopDesc::size_shift) \ | 2531 declare_constant(markOopDesc::size_shift) |
2545 | |
2546 /* NOTE that we do not use the last_entry() macro here; it is used */ | |
2547 /* in vmStructs_<os>_<cpu>.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and */ | |
2548 /* must be present there) */ | |
2549 | 2532 |
2550 | 2533 |
2551 //-------------------------------------------------------------------------------- | 2534 //-------------------------------------------------------------------------------- |
2552 // Macros operating on the above lists | 2535 // Macros operating on the above lists |
2553 //-------------------------------------------------------------------------------- | 2536 //-------------------------------------------------------------------------------- |
2605 { assert(findType(QUOTE(typeName)) != 0, "type \"" QUOTE(typeName) "\" not found in type table"); \ | 2588 { assert(findType(QUOTE(typeName)) != 0, "type \"" QUOTE(typeName) "\" not found in type table"); \ |
2606 assert(findType(QUOTE(type)) != 0, "type \"" QUOTE(type) "\" not found in type table"); } | 2589 assert(findType(QUOTE(type)) != 0, "type \"" QUOTE(type) "\" not found in type table"); } |
2607 | 2590 |
2608 // This is a no-op macro for unchecked fields | 2591 // This is a no-op macro for unchecked fields |
2609 #define CHECK_NO_OP(a, b, c) | 2592 #define CHECK_NO_OP(a, b, c) |
2610 | |
2611 // This is a no-op macro for the sentinel value | |
2612 #define CHECK_SENTINEL() | |
2613 | 2593 |
2614 // | 2594 // |
2615 // Build-specific macros: | 2595 // Build-specific macros: |
2616 // | 2596 // |
2617 | 2597 |
2787 | 2767 |
2788 // These initializers are allowed to access private fields in classes | 2768 // These initializers are allowed to access private fields in classes |
2789 // as long as class VMStructs is a friend | 2769 // as long as class VMStructs is a friend |
2790 VMStructEntry VMStructs::localHotSpotVMStructs[] = { | 2770 VMStructEntry VMStructs::localHotSpotVMStructs[] = { |
2791 | 2771 |
2792 VM_STRUCTS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \ | 2772 VM_STRUCTS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, |
2793 GENERATE_STATIC_VM_STRUCT_ENTRY, \ | 2773 GENERATE_STATIC_VM_STRUCT_ENTRY, |
2794 GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, \ | 2774 GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, |
2795 GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \ | 2775 GENERATE_NONSTATIC_VM_STRUCT_ENTRY, |
2796 GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, \ | 2776 GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, |
2797 GENERATE_C1_NONSTATIC_VM_STRUCT_ENTRY, \ | 2777 GENERATE_C1_NONSTATIC_VM_STRUCT_ENTRY, |
2798 GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY, \ | 2778 GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY, |
2799 GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY, \ | 2779 GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY, |
2800 GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY, \ | 2780 GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY) |
2801 GENERATE_VM_STRUCT_LAST_ENTRY) | |
2802 | 2781 |
2803 #ifndef SERIALGC | 2782 #ifndef SERIALGC |
2804 VM_STRUCTS_PARALLELGC(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \ | 2783 VM_STRUCTS_PARALLELGC(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, |
2805 GENERATE_STATIC_VM_STRUCT_ENTRY) | 2784 GENERATE_STATIC_VM_STRUCT_ENTRY) |
2806 | 2785 |
2807 VM_STRUCTS_CMS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \ | 2786 VM_STRUCTS_CMS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, |
2808 GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \ | 2787 GENERATE_NONSTATIC_VM_STRUCT_ENTRY, |
2809 GENERATE_STATIC_VM_STRUCT_ENTRY) | 2788 GENERATE_STATIC_VM_STRUCT_ENTRY) |
2810 | 2789 |
2811 VM_STRUCTS_G1(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \ | 2790 VM_STRUCTS_G1(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, |
2812 GENERATE_STATIC_VM_STRUCT_ENTRY) | 2791 GENERATE_STATIC_VM_STRUCT_ENTRY) |
2813 #endif // SERIALGC | 2792 #endif // SERIALGC |
2814 | 2793 |
2815 VM_STRUCTS_CPU(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \ | 2794 VM_STRUCTS_CPU(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, |
2816 GENERATE_STATIC_VM_STRUCT_ENTRY, \ | 2795 GENERATE_STATIC_VM_STRUCT_ENTRY, |
2817 GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, \ | 2796 GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, |
2818 GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \ | 2797 GENERATE_NONSTATIC_VM_STRUCT_ENTRY, |
2819 GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, \ | 2798 GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, |
2820 GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY, \ | 2799 GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY, |
2821 GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY, \ | 2800 GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY, |
2822 GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY, \ | 2801 GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY) |
2823 GENERATE_VM_STRUCT_LAST_ENTRY) | 2802 |
2824 | 2803 VM_STRUCTS_OS_CPU(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, |
2825 VM_STRUCTS_OS_CPU(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \ | 2804 GENERATE_STATIC_VM_STRUCT_ENTRY, |
2826 GENERATE_STATIC_VM_STRUCT_ENTRY, \ | 2805 GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, |
2827 GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, \ | 2806 GENERATE_NONSTATIC_VM_STRUCT_ENTRY, |
2828 GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \ | 2807 GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, |
2829 GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, \ | 2808 GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY, |
2830 GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY, \ | 2809 GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY, |
2831 GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY, \ | 2810 GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY) |
2832 GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY, \ | 2811 |
2833 GENERATE_VM_STRUCT_LAST_ENTRY) | 2812 GENERATE_VM_STRUCT_LAST_ENTRY() |
2834 }; | 2813 }; |
2835 | 2814 |
2836 VMTypeEntry VMStructs::localHotSpotVMTypes[] = { | 2815 VMTypeEntry VMStructs::localHotSpotVMTypes[] = { |
2837 | 2816 |
2838 VM_TYPES(GENERATE_VM_TYPE_ENTRY, | 2817 VM_TYPES(GENERATE_VM_TYPE_ENTRY, |
2840 GENERATE_OOP_VM_TYPE_ENTRY, | 2819 GENERATE_OOP_VM_TYPE_ENTRY, |
2841 GENERATE_INTEGER_VM_TYPE_ENTRY, | 2820 GENERATE_INTEGER_VM_TYPE_ENTRY, |
2842 GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY, | 2821 GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY, |
2843 GENERATE_C1_TOPLEVEL_VM_TYPE_ENTRY, | 2822 GENERATE_C1_TOPLEVEL_VM_TYPE_ENTRY, |
2844 GENERATE_C2_VM_TYPE_ENTRY, | 2823 GENERATE_C2_VM_TYPE_ENTRY, |
2845 GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY, | 2824 GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY) |
2846 GENERATE_VM_TYPE_LAST_ENTRY) | |
2847 | 2825 |
2848 #ifndef SERIALGC | 2826 #ifndef SERIALGC |
2849 VM_TYPES_PARALLELGC(GENERATE_VM_TYPE_ENTRY, | 2827 VM_TYPES_PARALLELGC(GENERATE_VM_TYPE_ENTRY, |
2850 GENERATE_TOPLEVEL_VM_TYPE_ENTRY) | 2828 GENERATE_TOPLEVEL_VM_TYPE_ENTRY) |
2851 | 2829 |
2863 GENERATE_OOP_VM_TYPE_ENTRY, | 2841 GENERATE_OOP_VM_TYPE_ENTRY, |
2864 GENERATE_INTEGER_VM_TYPE_ENTRY, | 2842 GENERATE_INTEGER_VM_TYPE_ENTRY, |
2865 GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY, | 2843 GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY, |
2866 GENERATE_C1_TOPLEVEL_VM_TYPE_ENTRY, | 2844 GENERATE_C1_TOPLEVEL_VM_TYPE_ENTRY, |
2867 GENERATE_C2_VM_TYPE_ENTRY, | 2845 GENERATE_C2_VM_TYPE_ENTRY, |
2868 GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY, | 2846 GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY) |
2869 GENERATE_VM_TYPE_LAST_ENTRY) | |
2870 | 2847 |
2871 VM_TYPES_OS_CPU(GENERATE_VM_TYPE_ENTRY, | 2848 VM_TYPES_OS_CPU(GENERATE_VM_TYPE_ENTRY, |
2872 GENERATE_TOPLEVEL_VM_TYPE_ENTRY, | 2849 GENERATE_TOPLEVEL_VM_TYPE_ENTRY, |
2873 GENERATE_OOP_VM_TYPE_ENTRY, | 2850 GENERATE_OOP_VM_TYPE_ENTRY, |
2874 GENERATE_INTEGER_VM_TYPE_ENTRY, | 2851 GENERATE_INTEGER_VM_TYPE_ENTRY, |
2875 GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY, | 2852 GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY, |
2876 GENERATE_C1_TOPLEVEL_VM_TYPE_ENTRY, | 2853 GENERATE_C1_TOPLEVEL_VM_TYPE_ENTRY, |
2877 GENERATE_C2_VM_TYPE_ENTRY, | 2854 GENERATE_C2_VM_TYPE_ENTRY, |
2878 GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY, | 2855 GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY) |
2879 GENERATE_VM_TYPE_LAST_ENTRY) | 2856 |
2857 GENERATE_VM_TYPE_LAST_ENTRY() | |
2880 }; | 2858 }; |
2881 | 2859 |
2882 VMIntConstantEntry VMStructs::localHotSpotVMIntConstants[] = { | 2860 VMIntConstantEntry VMStructs::localHotSpotVMIntConstants[] = { |
2883 | 2861 |
2884 VM_INT_CONSTANTS(GENERATE_VM_INT_CONSTANT_ENTRY, | 2862 VM_INT_CONSTANTS(GENERATE_VM_INT_CONSTANT_ENTRY, |
2885 GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY, | 2863 GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY, |
2886 GENERATE_C1_VM_INT_CONSTANT_ENTRY, | 2864 GENERATE_C1_VM_INT_CONSTANT_ENTRY, |
2887 GENERATE_C2_VM_INT_CONSTANT_ENTRY, | 2865 GENERATE_C2_VM_INT_CONSTANT_ENTRY, |
2888 GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY, | 2866 GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY) |
2889 GENERATE_VM_INT_CONSTANT_LAST_ENTRY) | |
2890 | 2867 |
2891 #ifndef SERIALGC | 2868 #ifndef SERIALGC |
2892 VM_INT_CONSTANTS_CMS(GENERATE_VM_INT_CONSTANT_ENTRY) | 2869 VM_INT_CONSTANTS_CMS(GENERATE_VM_INT_CONSTANT_ENTRY) |
2893 | 2870 |
2894 VM_INT_CONSTANTS_PARNEW(GENERATE_VM_INT_CONSTANT_ENTRY) | 2871 VM_INT_CONSTANTS_PARNEW(GENERATE_VM_INT_CONSTANT_ENTRY) |
2896 | 2873 |
2897 VM_INT_CONSTANTS_CPU(GENERATE_VM_INT_CONSTANT_ENTRY, | 2874 VM_INT_CONSTANTS_CPU(GENERATE_VM_INT_CONSTANT_ENTRY, |
2898 GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY, | 2875 GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY, |
2899 GENERATE_C1_VM_INT_CONSTANT_ENTRY, | 2876 GENERATE_C1_VM_INT_CONSTANT_ENTRY, |
2900 GENERATE_C2_VM_INT_CONSTANT_ENTRY, | 2877 GENERATE_C2_VM_INT_CONSTANT_ENTRY, |
2901 GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY, | 2878 GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY) |
2902 GENERATE_VM_INT_CONSTANT_LAST_ENTRY) | |
2903 | 2879 |
2904 VM_INT_CONSTANTS_OS_CPU(GENERATE_VM_INT_CONSTANT_ENTRY, | 2880 VM_INT_CONSTANTS_OS_CPU(GENERATE_VM_INT_CONSTANT_ENTRY, |
2905 GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY, | 2881 GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY, |
2906 GENERATE_C1_VM_INT_CONSTANT_ENTRY, | 2882 GENERATE_C1_VM_INT_CONSTANT_ENTRY, |
2907 GENERATE_C2_VM_INT_CONSTANT_ENTRY, | 2883 GENERATE_C2_VM_INT_CONSTANT_ENTRY, |
2908 GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY, | 2884 GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY) |
2909 GENERATE_VM_INT_CONSTANT_LAST_ENTRY) | 2885 |
2886 GENERATE_VM_INT_CONSTANT_LAST_ENTRY() | |
2910 }; | 2887 }; |
2911 | 2888 |
2912 VMLongConstantEntry VMStructs::localHotSpotVMLongConstants[] = { | 2889 VMLongConstantEntry VMStructs::localHotSpotVMLongConstants[] = { |
2913 | 2890 |
2914 VM_LONG_CONSTANTS(GENERATE_VM_LONG_CONSTANT_ENTRY, | 2891 VM_LONG_CONSTANTS(GENERATE_VM_LONG_CONSTANT_ENTRY, |
2915 GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY, | 2892 GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY, |
2916 GENERATE_C1_VM_LONG_CONSTANT_ENTRY, | 2893 GENERATE_C1_VM_LONG_CONSTANT_ENTRY, |
2917 GENERATE_C2_VM_LONG_CONSTANT_ENTRY, | 2894 GENERATE_C2_VM_LONG_CONSTANT_ENTRY, |
2918 GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY, | 2895 GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY) |
2919 GENERATE_VM_LONG_CONSTANT_LAST_ENTRY) | |
2920 | 2896 |
2921 VM_LONG_CONSTANTS_CPU(GENERATE_VM_LONG_CONSTANT_ENTRY, | 2897 VM_LONG_CONSTANTS_CPU(GENERATE_VM_LONG_CONSTANT_ENTRY, |
2922 GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY, | 2898 GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY, |
2923 GENERATE_C1_VM_LONG_CONSTANT_ENTRY, | 2899 GENERATE_C1_VM_LONG_CONSTANT_ENTRY, |
2924 GENERATE_C2_VM_LONG_CONSTANT_ENTRY, | 2900 GENERATE_C2_VM_LONG_CONSTANT_ENTRY, |
2925 GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY, | 2901 GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY) |
2926 GENERATE_VM_LONG_CONSTANT_LAST_ENTRY) | |
2927 | 2902 |
2928 VM_LONG_CONSTANTS_OS_CPU(GENERATE_VM_LONG_CONSTANT_ENTRY, | 2903 VM_LONG_CONSTANTS_OS_CPU(GENERATE_VM_LONG_CONSTANT_ENTRY, |
2929 GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY, | 2904 GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY, |
2930 GENERATE_C1_VM_LONG_CONSTANT_ENTRY, | 2905 GENERATE_C1_VM_LONG_CONSTANT_ENTRY, |
2931 GENERATE_C2_VM_LONG_CONSTANT_ENTRY, | 2906 GENERATE_C2_VM_LONG_CONSTANT_ENTRY, |
2932 GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY, | 2907 GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY) |
2933 GENERATE_VM_LONG_CONSTANT_LAST_ENTRY) | 2908 |
2909 GENERATE_VM_LONG_CONSTANT_LAST_ENTRY() | |
2934 }; | 2910 }; |
2935 | 2911 |
2936 // This is used both to check the types of referenced fields and, in | 2912 // This is used both to check the types of referenced fields and, in |
2937 // debug builds, to ensure that all of the field types are present. | 2913 // debug builds, to ensure that all of the field types are present. |
2938 void | 2914 void |
2943 CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY, | 2919 CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY, |
2944 CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, | 2920 CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, |
2945 CHECK_C1_NONSTATIC_VM_STRUCT_ENTRY, | 2921 CHECK_C1_NONSTATIC_VM_STRUCT_ENTRY, |
2946 CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY, | 2922 CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY, |
2947 CHECK_NO_OP, | 2923 CHECK_NO_OP, |
2948 CHECK_NO_OP, | 2924 CHECK_NO_OP); |
2949 CHECK_SENTINEL); | |
2950 | 2925 |
2951 #ifndef SERIALGC | 2926 #ifndef SERIALGC |
2952 VM_STRUCTS_PARALLELGC(CHECK_NONSTATIC_VM_STRUCT_ENTRY, | 2927 VM_STRUCTS_PARALLELGC(CHECK_NONSTATIC_VM_STRUCT_ENTRY, |
2953 CHECK_STATIC_VM_STRUCT_ENTRY); | 2928 CHECK_STATIC_VM_STRUCT_ENTRY); |
2954 | 2929 |
2965 CHECK_NO_OP, | 2940 CHECK_NO_OP, |
2966 CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY, | 2941 CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY, |
2967 CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, | 2942 CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, |
2968 CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY, | 2943 CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY, |
2969 CHECK_NO_OP, | 2944 CHECK_NO_OP, |
2970 CHECK_NO_OP, | 2945 CHECK_NO_OP); |
2971 CHECK_SENTINEL); | |
2972 | 2946 |
2973 VM_STRUCTS_OS_CPU(CHECK_NONSTATIC_VM_STRUCT_ENTRY, | 2947 VM_STRUCTS_OS_CPU(CHECK_NONSTATIC_VM_STRUCT_ENTRY, |
2974 CHECK_STATIC_VM_STRUCT_ENTRY, | 2948 CHECK_STATIC_VM_STRUCT_ENTRY, |
2975 CHECK_NO_OP, | 2949 CHECK_NO_OP, |
2976 CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY, | 2950 CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY, |
2977 CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, | 2951 CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, |
2978 CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY, | 2952 CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY, |
2979 CHECK_NO_OP, | 2953 CHECK_NO_OP, |
2980 CHECK_NO_OP, | 2954 CHECK_NO_OP); |
2981 CHECK_SENTINEL); | |
2982 | 2955 |
2983 VM_TYPES(CHECK_VM_TYPE_ENTRY, | 2956 VM_TYPES(CHECK_VM_TYPE_ENTRY, |
2984 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, | 2957 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, |
2985 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, | 2958 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, |
2986 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, | 2959 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, |
2987 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, | 2960 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, |
2988 CHECK_C1_TOPLEVEL_VM_TYPE_ENTRY, | 2961 CHECK_C1_TOPLEVEL_VM_TYPE_ENTRY, |
2989 CHECK_C2_VM_TYPE_ENTRY, | 2962 CHECK_C2_VM_TYPE_ENTRY, |
2990 CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY, | 2963 CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY); |
2991 CHECK_SENTINEL); | |
2992 | 2964 |
2993 #ifndef SERIALGC | 2965 #ifndef SERIALGC |
2994 VM_TYPES_PARALLELGC(CHECK_VM_TYPE_ENTRY, | 2966 VM_TYPES_PARALLELGC(CHECK_VM_TYPE_ENTRY, |
2995 CHECK_SINGLE_ARG_VM_TYPE_NO_OP); | 2967 CHECK_SINGLE_ARG_VM_TYPE_NO_OP); |
2996 | 2968 |
3008 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, | 2980 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, |
3009 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, | 2981 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, |
3010 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, | 2982 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, |
3011 CHECK_C1_TOPLEVEL_VM_TYPE_ENTRY, | 2983 CHECK_C1_TOPLEVEL_VM_TYPE_ENTRY, |
3012 CHECK_C2_VM_TYPE_ENTRY, | 2984 CHECK_C2_VM_TYPE_ENTRY, |
3013 CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY, | 2985 CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY); |
3014 CHECK_SENTINEL); | |
3015 | 2986 |
3016 VM_TYPES_OS_CPU(CHECK_VM_TYPE_ENTRY, | 2987 VM_TYPES_OS_CPU(CHECK_VM_TYPE_ENTRY, |
3017 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, | 2988 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, |
3018 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, | 2989 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, |
3019 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, | 2990 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, |
3020 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, | 2991 CHECK_SINGLE_ARG_VM_TYPE_NO_OP, |
3021 CHECK_C1_TOPLEVEL_VM_TYPE_ENTRY, | 2992 CHECK_C1_TOPLEVEL_VM_TYPE_ENTRY, |
3022 CHECK_C2_VM_TYPE_ENTRY, | 2993 CHECK_C2_VM_TYPE_ENTRY, |
3023 CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY, | 2994 CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY); |
3024 CHECK_SENTINEL); | |
3025 | 2995 |
3026 // | 2996 // |
3027 // Split VM_STRUCTS() invocation into two parts to allow MS VC++ 6.0 | 2997 // Split VM_STRUCTS() invocation into two parts to allow MS VC++ 6.0 |
3028 // to build with the source mounted over SNC3.2. Symptom was that | 2998 // to build with the source mounted over SNC3.2. Symptom was that |
3029 // debug build failed with an internal compiler error. Has been seen | 2999 // debug build failed with an internal compiler error. Has been seen |
3038 // | 3008 // |
3039 // NOTE: taken out because this was just not working on everyone's | 3009 // NOTE: taken out because this was just not working on everyone's |
3040 // Solstice NFS setup. If everyone switches to local workspaces on | 3010 // Solstice NFS setup. If everyone switches to local workspaces on |
3041 // Win32, we can put this back in. | 3011 // Win32, we can put this back in. |
3042 #ifndef _WINDOWS | 3012 #ifndef _WINDOWS |
3043 debug_only(VM_STRUCTS(ENSURE_FIELD_TYPE_PRESENT, \ | 3013 debug_only(VM_STRUCTS(ENSURE_FIELD_TYPE_PRESENT, |
3044 CHECK_NO_OP, \ | 3014 CHECK_NO_OP, |
3045 CHECK_NO_OP, \ | 3015 CHECK_NO_OP, |
3046 CHECK_NO_OP, \ | 3016 CHECK_NO_OP, |
3047 CHECK_NO_OP, \ | 3017 CHECK_NO_OP, |
3048 CHECK_NO_OP, \ | 3018 CHECK_NO_OP, |
3049 CHECK_NO_OP, \ | 3019 CHECK_NO_OP, |
3050 CHECK_NO_OP, \ | 3020 CHECK_NO_OP, |
3051 CHECK_NO_OP, \ | 3021 CHECK_NO_OP)); |
3052 CHECK_SENTINEL)); | 3022 debug_only(VM_STRUCTS(CHECK_NO_OP, |
3053 debug_only(VM_STRUCTS(CHECK_NO_OP, \ | 3023 ENSURE_FIELD_TYPE_PRESENT, |
3054 ENSURE_FIELD_TYPE_PRESENT, \ | 3024 CHECK_NO_OP, |
3055 CHECK_NO_OP, \ | 3025 ENSURE_FIELD_TYPE_PRESENT, |
3056 ENSURE_FIELD_TYPE_PRESENT, \ | 3026 ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT, |
3057 ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT, \ | 3027 ENSURE_C1_FIELD_TYPE_PRESENT, |
3058 ENSURE_C1_FIELD_TYPE_PRESENT, \ | 3028 ENSURE_C2_FIELD_TYPE_PRESENT, |
3059 ENSURE_C2_FIELD_TYPE_PRESENT, \ | 3029 CHECK_NO_OP, |
3060 CHECK_NO_OP, \ | 3030 CHECK_NO_OP)); |
3061 CHECK_NO_OP, \ | |
3062 CHECK_SENTINEL)); | |
3063 #ifndef SERIALGC | 3031 #ifndef SERIALGC |
3064 debug_only(VM_STRUCTS_PARALLELGC(ENSURE_FIELD_TYPE_PRESENT, \ | 3032 debug_only(VM_STRUCTS_PARALLELGC(ENSURE_FIELD_TYPE_PRESENT, |
3065 ENSURE_FIELD_TYPE_PRESENT)); | 3033 ENSURE_FIELD_TYPE_PRESENT)); |
3066 debug_only(VM_STRUCTS_CMS(ENSURE_FIELD_TYPE_PRESENT, \ | 3034 debug_only(VM_STRUCTS_CMS(ENSURE_FIELD_TYPE_PRESENT, |
3067 ENSURE_FIELD_TYPE_PRESENT, \ | 3035 ENSURE_FIELD_TYPE_PRESENT, |
3068 ENSURE_FIELD_TYPE_PRESENT)); | 3036 ENSURE_FIELD_TYPE_PRESENT)); |
3069 debug_only(VM_STRUCTS_G1(ENSURE_FIELD_TYPE_PRESENT, \ | 3037 debug_only(VM_STRUCTS_G1(ENSURE_FIELD_TYPE_PRESENT, |
3070 ENSURE_FIELD_TYPE_PRESENT)); | 3038 ENSURE_FIELD_TYPE_PRESENT)); |
3071 #endif // SERIALGC | 3039 #endif // SERIALGC |
3072 debug_only(VM_STRUCTS_CPU(ENSURE_FIELD_TYPE_PRESENT, \ | 3040 debug_only(VM_STRUCTS_CPU(ENSURE_FIELD_TYPE_PRESENT, |
3073 ENSURE_FIELD_TYPE_PRESENT, \ | 3041 ENSURE_FIELD_TYPE_PRESENT, |
3074 CHECK_NO_OP, \ | 3042 CHECK_NO_OP, |
3075 ENSURE_FIELD_TYPE_PRESENT, \ | 3043 ENSURE_FIELD_TYPE_PRESENT, |
3076 ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT, \ | 3044 ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT, |
3077 ENSURE_C2_FIELD_TYPE_PRESENT, \ | 3045 ENSURE_C2_FIELD_TYPE_PRESENT, |
3078 CHECK_NO_OP, \ | 3046 CHECK_NO_OP, |
3079 CHECK_NO_OP, \ | 3047 CHECK_NO_OP)); |
3080 CHECK_SENTINEL)); | 3048 debug_only(VM_STRUCTS_OS_CPU(ENSURE_FIELD_TYPE_PRESENT, |
3081 debug_only(VM_STRUCTS_OS_CPU(ENSURE_FIELD_TYPE_PRESENT, \ | 3049 ENSURE_FIELD_TYPE_PRESENT, |
3082 ENSURE_FIELD_TYPE_PRESENT, \ | 3050 CHECK_NO_OP, |
3083 CHECK_NO_OP, \ | 3051 ENSURE_FIELD_TYPE_PRESENT, |
3084 ENSURE_FIELD_TYPE_PRESENT, \ | 3052 ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT, |
3085 ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT, \ | 3053 ENSURE_C2_FIELD_TYPE_PRESENT, |
3086 ENSURE_C2_FIELD_TYPE_PRESENT, \ | 3054 CHECK_NO_OP, |
3087 CHECK_NO_OP, \ | 3055 CHECK_NO_OP)); |
3088 CHECK_NO_OP, \ | |
3089 CHECK_SENTINEL)); | |
3090 #endif | 3056 #endif |
3091 } | 3057 } |
3092 | 3058 |
3093 extern "C" { | 3059 extern "C" { |
3094 | 3060 |
3204 debug_only(VMStructs::init()); | 3170 debug_only(VMStructs::init()); |
3205 } | 3171 } |
3206 | 3172 |
3207 #ifndef PRODUCT | 3173 #ifndef PRODUCT |
3208 void VMStructs::test() { | 3174 void VMStructs::test() { |
3175 // Make sure last entry in the each array is indeed the correct end marker. | |
3176 // The reason why these are static is to make sure they are zero initialized. | |
3177 // Putting them on the stack will leave some garbage in the padding of some fields. | |
3178 static VMStructEntry struct_last_entry = GENERATE_VM_STRUCT_LAST_ENTRY(); | |
3179 assert(memcmp(&localHotSpotVMStructs[(sizeof(localHotSpotVMStructs) / sizeof(VMStructEntry)) - 1], | |
3180 &struct_last_entry, | |
3181 sizeof(VMStructEntry)) == 0, "Incorrect last entry in localHotSpotVMStructs"); | |
3182 | |
3183 static VMTypeEntry type_last_entry = GENERATE_VM_TYPE_LAST_ENTRY(); | |
3184 assert(memcmp(&localHotSpotVMTypes[sizeof(localHotSpotVMTypes) / sizeof(VMTypeEntry) - 1], | |
3185 &type_last_entry, | |
3186 sizeof(VMTypeEntry)) == 0, "Incorrect last entry in localHotSpotVMTypes"); | |
3187 | |
3188 static VMIntConstantEntry int_last_entry = GENERATE_VM_INT_CONSTANT_LAST_ENTRY(); | |
3189 assert(memcmp(&localHotSpotVMIntConstants[sizeof(localHotSpotVMIntConstants) / sizeof(VMIntConstantEntry) - 1], | |
3190 &int_last_entry, | |
3191 sizeof(VMIntConstantEntry)) == 0, "Incorrect last entry in localHotSpotVMIntConstants"); | |
3192 | |
3193 static VMLongConstantEntry long_last_entry = GENERATE_VM_LONG_CONSTANT_LAST_ENTRY(); | |
3194 assert(memcmp(&localHotSpotVMLongConstants[sizeof(localHotSpotVMLongConstants) / sizeof(VMLongConstantEntry) - 1], | |
3195 &long_last_entry, | |
3196 sizeof(VMLongConstantEntry)) == 0, "Incorrect last entry in localHotSpotVMLongConstants"); | |
3197 | |
3198 | |
3209 // Check for duplicate entries in type array | 3199 // Check for duplicate entries in type array |
3210 for (int i = 0; localHotSpotVMTypes[i].typeName != NULL; i++) { | 3200 for (int i = 0; localHotSpotVMTypes[i].typeName != NULL; i++) { |
3211 for (int j = i + 1; localHotSpotVMTypes[j].typeName != NULL; j++) { | 3201 for (int j = i + 1; localHotSpotVMTypes[j].typeName != NULL; j++) { |
3212 if (strcmp(localHotSpotVMTypes[i].typeName, localHotSpotVMTypes[j].typeName) == 0) { | 3202 if (strcmp(localHotSpotVMTypes[i].typeName, localHotSpotVMTypes[j].typeName) == 0) { |
3213 tty->print_cr("Duplicate entries for '%s'", localHotSpotVMTypes[i].typeName); | 3203 tty->print_cr("Duplicate entries for '%s'", localHotSpotVMTypes[i].typeName); |