Mon, 25 Feb 2008 15:05:44 -0800
6633953: type2aelembytes{T_ADDRESS} should be 8 bytes in 64 bit VM
Summary: T_ADDRESS size is defined as 'int' size (4 bytes) but C2 use it for raw pointers and as memory type for StoreP and LoadP nodes.
Reviewed-by: jrose
duke@435 | 1 | /* |
duke@435 | 2 | * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. |
duke@435 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | * |
duke@435 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | * published by the Free Software Foundation. |
duke@435 | 8 | * |
duke@435 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | * accompanied this code). |
duke@435 | 14 | * |
duke@435 | 15 | * You should have received a copy of the GNU General Public License version |
duke@435 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | * |
duke@435 | 19 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
duke@435 | 20 | * CA 95054 USA or visit www.sun.com if you need additional information or |
duke@435 | 21 | * have any questions. |
duke@435 | 22 | * |
duke@435 | 23 | */ |
duke@435 | 24 | |
duke@435 | 25 | # include "incls/_precompiled.incl" |
duke@435 | 26 | # include "incls/_vm_version_sparc.cpp.incl" |
duke@435 | 27 | |
duke@435 | 28 | int VM_Version::_features = VM_Version::unknown_m; |
duke@435 | 29 | const char* VM_Version::_features_str = ""; |
duke@435 | 30 | |
duke@435 | 31 | void VM_Version::initialize() { |
duke@435 | 32 | _features = determine_features(); |
duke@435 | 33 | PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes(); |
duke@435 | 34 | PrefetchScanIntervalInBytes = prefetch_scan_interval_in_bytes(); |
duke@435 | 35 | PrefetchFieldsAhead = prefetch_fields_ahead(); |
duke@435 | 36 | |
duke@435 | 37 | // Allocation prefetch settings |
duke@435 | 38 | intx cache_line_size = L1_data_cache_line_size(); |
duke@435 | 39 | if( cache_line_size > AllocatePrefetchStepSize ) |
duke@435 | 40 | AllocatePrefetchStepSize = cache_line_size; |
duke@435 | 41 | if( FLAG_IS_DEFAULT(AllocatePrefetchLines) ) |
duke@435 | 42 | AllocatePrefetchLines = 3; // Optimistic value |
duke@435 | 43 | assert( AllocatePrefetchLines > 0, "invalid value"); |
duke@435 | 44 | if( AllocatePrefetchLines < 1 ) // set valid value in product VM |
duke@435 | 45 | AllocatePrefetchLines = 1; // Conservative value |
duke@435 | 46 | |
duke@435 | 47 | AllocatePrefetchDistance = allocate_prefetch_distance(); |
duke@435 | 48 | AllocatePrefetchStyle = allocate_prefetch_style(); |
duke@435 | 49 | |
duke@435 | 50 | assert(AllocatePrefetchDistance % AllocatePrefetchStepSize == 0, "invalid value"); |
duke@435 | 51 | |
duke@435 | 52 | UseSSE = 0; // Only on x86 and x64 |
duke@435 | 53 | |
duke@435 | 54 | _supports_cx8 = has_v9(); |
duke@435 | 55 | |
duke@435 | 56 | if (is_niagara1()) { |
duke@435 | 57 | // Indirect branch is the same cost as direct |
duke@435 | 58 | if (FLAG_IS_DEFAULT(UseInlineCaches)) { |
duke@435 | 59 | UseInlineCaches = false; |
duke@435 | 60 | } |
duke@435 | 61 | #ifdef COMPILER2 |
duke@435 | 62 | // Indirect branch is the same cost as direct |
duke@435 | 63 | if (FLAG_IS_DEFAULT(UseJumpTables)) { |
duke@435 | 64 | UseJumpTables = true; |
duke@435 | 65 | } |
duke@435 | 66 | // Single-issue, so entry and loop tops are |
duke@435 | 67 | // aligned on a single instruction boundary |
duke@435 | 68 | if (FLAG_IS_DEFAULT(InteriorEntryAlignment)) { |
duke@435 | 69 | InteriorEntryAlignment = 4; |
duke@435 | 70 | } |
duke@435 | 71 | if (FLAG_IS_DEFAULT(OptoLoopAlignment)) { |
duke@435 | 72 | OptoLoopAlignment = 4; |
duke@435 | 73 | } |
duke@435 | 74 | #endif |
duke@435 | 75 | } |
duke@435 | 76 | |
duke@435 | 77 | char buf[512]; |
duke@435 | 78 | jio_snprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s%s%s", |
duke@435 | 79 | (has_v8() ? ", has_v8" : ""), |
duke@435 | 80 | (has_v9() ? ", has_v9" : ""), |
duke@435 | 81 | (has_vis1() ? ", has_vis1" : ""), |
duke@435 | 82 | (has_vis2() ? ", has_vis2" : ""), |
duke@435 | 83 | (is_ultra3() ? ", is_ultra3" : ""), |
duke@435 | 84 | (is_sun4v() ? ", is_sun4v" : ""), |
duke@435 | 85 | (is_niagara1() ? ", is_niagara1" : ""), |
duke@435 | 86 | (!has_hardware_int_muldiv() ? ", no-muldiv" : ""), |
duke@435 | 87 | (!has_hardware_fsmuld() ? ", no-fsmuld" : "")); |
duke@435 | 88 | |
duke@435 | 89 | // buf is started with ", " or is empty |
duke@435 | 90 | _features_str = strdup(strlen(buf) > 2 ? buf + 2 : buf); |
duke@435 | 91 | |
duke@435 | 92 | #ifndef PRODUCT |
duke@435 | 93 | if (PrintMiscellaneous && Verbose) { |
duke@435 | 94 | tty->print("Allocation: "); |
duke@435 | 95 | if (AllocatePrefetchStyle <= 0) { |
duke@435 | 96 | tty->print_cr("no prefetching"); |
duke@435 | 97 | } else { |
duke@435 | 98 | if (AllocatePrefetchLines > 1) { |
duke@435 | 99 | tty->print_cr("PREFETCH %d, %d lines of size %d bytes", AllocatePrefetchDistance, AllocatePrefetchLines, AllocatePrefetchStepSize); |
duke@435 | 100 | } else { |
duke@435 | 101 | tty->print_cr("PREFETCH %d, one line", AllocatePrefetchDistance); |
duke@435 | 102 | } |
duke@435 | 103 | } |
duke@435 | 104 | if (PrefetchCopyIntervalInBytes > 0) { |
duke@435 | 105 | tty->print_cr("PrefetchCopyIntervalInBytes %d", PrefetchCopyIntervalInBytes); |
duke@435 | 106 | } |
duke@435 | 107 | if (PrefetchScanIntervalInBytes > 0) { |
duke@435 | 108 | tty->print_cr("PrefetchScanIntervalInBytes %d", PrefetchScanIntervalInBytes); |
duke@435 | 109 | } |
duke@435 | 110 | if (PrefetchFieldsAhead > 0) { |
duke@435 | 111 | tty->print_cr("PrefetchFieldsAhead %d", PrefetchFieldsAhead); |
duke@435 | 112 | } |
duke@435 | 113 | } |
duke@435 | 114 | #endif // PRODUCT |
duke@435 | 115 | } |
duke@435 | 116 | |
duke@435 | 117 | void VM_Version::print_features() { |
duke@435 | 118 | tty->print_cr("Version:%s", cpu_features()); |
duke@435 | 119 | } |
duke@435 | 120 | |
duke@435 | 121 | int VM_Version::determine_features() { |
duke@435 | 122 | if (UseV8InstrsOnly) { |
duke@435 | 123 | NOT_PRODUCT(if (PrintMiscellaneous && Verbose) tty->print_cr("Version is Forced-V8");) |
duke@435 | 124 | return generic_v8_m; |
duke@435 | 125 | } |
duke@435 | 126 | |
duke@435 | 127 | int features = platform_features(unknown_m); // platform_features() is os_arch specific |
duke@435 | 128 | |
duke@435 | 129 | if (features == unknown_m) { |
duke@435 | 130 | features = generic_v9_m; |
duke@435 | 131 | warning("Cannot recognize SPARC version. Default to V9"); |
duke@435 | 132 | } |
duke@435 | 133 | |
duke@435 | 134 | if (UseNiagaraInstrs) { |
duke@435 | 135 | if (is_niagara1(features)) { |
duke@435 | 136 | // Happy to accomodate... |
duke@435 | 137 | } else { |
duke@435 | 138 | NOT_PRODUCT(if (PrintMiscellaneous && Verbose) tty->print_cr("Version is Forced-Niagara");) |
duke@435 | 139 | features = niagara1_m; |
duke@435 | 140 | } |
duke@435 | 141 | } else { |
duke@435 | 142 | if (is_niagara1(features) && !FLAG_IS_DEFAULT(UseNiagaraInstrs)) { |
duke@435 | 143 | NOT_PRODUCT(if (PrintMiscellaneous && Verbose) tty->print_cr("Version is Forced-Not-Niagara");) |
duke@435 | 144 | features &= ~niagara1_unique_m; |
duke@435 | 145 | } else { |
duke@435 | 146 | // Happy to accomodate... |
duke@435 | 147 | } |
duke@435 | 148 | } |
duke@435 | 149 | |
duke@435 | 150 | return features; |
duke@435 | 151 | } |
duke@435 | 152 | |
duke@435 | 153 | static int saved_features = 0; |
duke@435 | 154 | |
duke@435 | 155 | void VM_Version::allow_all() { |
duke@435 | 156 | saved_features = _features; |
duke@435 | 157 | _features = all_features_m; |
duke@435 | 158 | } |
duke@435 | 159 | |
duke@435 | 160 | void VM_Version::revert() { |
duke@435 | 161 | _features = saved_features; |
duke@435 | 162 | } |