Mercurial > hg > truffle
comparison src/share/vm/runtime/arguments.cpp @ 2002:ac637b7220d1
6985015: C1 needs to support compressed oops
Summary: This change implements compressed oops for C1 for x64 and sparc. The changes are mostly on the codegen level, with a few exceptions when we do access things outside of the heap that are uncompressed from the IR. Compressed oops are now also enabled with tiered.
Reviewed-by: twisti, kvn, never, phh
author | iveresov |
---|---|
date | Tue, 30 Nov 2010 23:23:40 -0800 |
parents | f95d63e2154a |
children | 06f017f7daa7 36c186bcc085 |
comparison
equal
deleted
inserted
replaced
1972:f95d63e2154a | 2002:ac637b7220d1 |
---|---|
1005 } | 1005 } |
1006 | 1006 |
1007 void Arguments::check_compressed_oops_compat() { | 1007 void Arguments::check_compressed_oops_compat() { |
1008 #ifdef _LP64 | 1008 #ifdef _LP64 |
1009 assert(UseCompressedOops, "Precondition"); | 1009 assert(UseCompressedOops, "Precondition"); |
1010 # if defined(COMPILER1) && !defined(TIERED) | |
1011 // Until c1 supports compressed oops turn them off. | |
1012 FLAG_SET_DEFAULT(UseCompressedOops, false); | |
1013 # else | |
1014 // Is it on by default or set on ergonomically | 1010 // Is it on by default or set on ergonomically |
1015 bool is_on_by_default = FLAG_IS_DEFAULT(UseCompressedOops) || FLAG_IS_ERGO(UseCompressedOops); | 1011 bool is_on_by_default = FLAG_IS_DEFAULT(UseCompressedOops) || FLAG_IS_ERGO(UseCompressedOops); |
1016 | |
1017 // Tiered currently doesn't work with compressed oops | |
1018 if (TieredCompilation) { | |
1019 if (is_on_by_default) { | |
1020 FLAG_SET_DEFAULT(UseCompressedOops, false); | |
1021 return; | |
1022 } else { | |
1023 vm_exit_during_initialization( | |
1024 "Tiered compilation is not supported with compressed oops yet", NULL); | |
1025 } | |
1026 } | |
1027 | 1012 |
1028 // If dumping an archive or forcing its use, disable compressed oops if possible | 1013 // If dumping an archive or forcing its use, disable compressed oops if possible |
1029 if (DumpSharedSpaces || RequireSharedSpaces) { | 1014 if (DumpSharedSpaces || RequireSharedSpaces) { |
1030 if (is_on_by_default) { | 1015 if (is_on_by_default) { |
1031 FLAG_SET_DEFAULT(UseCompressedOops, false); | 1016 FLAG_SET_DEFAULT(UseCompressedOops, false); |
1036 } | 1021 } |
1037 } else if (UseSharedSpaces) { | 1022 } else if (UseSharedSpaces) { |
1038 // UseSharedSpaces is on by default. With compressed oops, we turn it off. | 1023 // UseSharedSpaces is on by default. With compressed oops, we turn it off. |
1039 FLAG_SET_DEFAULT(UseSharedSpaces, false); | 1024 FLAG_SET_DEFAULT(UseSharedSpaces, false); |
1040 } | 1025 } |
1041 | 1026 #endif |
1042 # endif // defined(COMPILER1) && !defined(TIERED) | |
1043 #endif // _LP64 | |
1044 } | 1027 } |
1045 | 1028 |
1046 void Arguments::set_tiered_flags() { | 1029 void Arguments::set_tiered_flags() { |
1047 if (FLAG_IS_DEFAULT(CompilationPolicyChoice)) { | 1030 if (FLAG_IS_DEFAULT(CompilationPolicyChoice)) { |
1048 FLAG_SET_DEFAULT(CompilationPolicyChoice, 2); | 1031 FLAG_SET_DEFAULT(CompilationPolicyChoice, 2); |
3073 #endif // KERNEL | 3056 #endif // KERNEL |
3074 | 3057 |
3075 // Set flags based on ergonomics. | 3058 // Set flags based on ergonomics. |
3076 set_ergonomics_flags(); | 3059 set_ergonomics_flags(); |
3077 | 3060 |
3078 #ifdef _LP64 | |
3079 if (UseCompressedOops) { | 3061 if (UseCompressedOops) { |
3080 check_compressed_oops_compat(); | 3062 check_compressed_oops_compat(); |
3081 } | 3063 } |
3082 #endif | |
3083 | 3064 |
3084 // Check the GC selections again. | 3065 // Check the GC selections again. |
3085 if (!check_gc_consistency()) { | 3066 if (!check_gc_consistency()) { |
3086 return JNI_EINVAL; | 3067 return JNI_EINVAL; |
3087 } | 3068 } |