src/cpu/mips/vm/vm_version_mips.cpp

Tue, 17 Jan 2017 21:53:02 -0500

author
fujie
date
Tue, 17 Jan 2017 21:53:02 -0500
changeset 212
a511e4b27f56
parent 209
994cec5b3f6f
child 213
45cd2837a395
permissions
-rw-r--r--

Fix a SIGILL bug introduced by changeset 101daea92bb3.

When testing the SPECjvm2000 On 3B1500 with
java -jar SPECjvm2008.jar -ikv -coe -ict -bt 8 compiler.compiler
changeset 101daea92bb3 introduced a SIGILL bug like the follwing:
---------------------------SIGILL begin-----------------------------------
Iteration 1 (240s) begins: Fri Jan 13 04:42:42 EST 2017
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGILL (0x4) at pc=0x000000ffde134fc4, pid=21475, tid=1098320638480
#
# JRE version: OpenJDK Runtime Environment (8.0) (build
# 1.8.0_25-fujie_2016_12_05_04_00-b00)
# Java VM: OpenJDK 64-Bit Server VM (25.25-b02 mixed mode linux-mips64
# compressed oops)
# Problematic frame:
# J 1770 C2
# spec.benchmarks.compiler.SpecFileManager.generateKey(Ljavax/tools/JavaFileManager$Location;Ljava/lang/String;Ljava/util/Set;Z)Ljava/lang/String;
# (136 bytes) @ 0x000000ffde134fc4 [0x000000ffde133ac0+0x1504]
---------------------------SIGILL end-----------------------------------

aoqi@1 1 /*
aoqi@1 2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
aoqi@1 3 * Copyright (c) 2015, 2016, Loongson Technology. All rights reserved.
aoqi@1 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@1 5 *
aoqi@1 6 * This code is free software; you can redistribute it and/or modify it
aoqi@1 7 * under the terms of the GNU General Public License version 2 only, as
aoqi@1 8 * published by the Free Software Foundation.
aoqi@1 9 *
aoqi@1 10 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@1 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@1 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@1 13 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@1 14 * accompanied this code).
aoqi@1 15 *
aoqi@1 16 * You should have received a copy of the GNU General Public License version
aoqi@1 17 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@1 18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@1 19 *
aoqi@1 20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@1 21 * or visit www.oracle.com if you need additional information or have any
aoqi@1 22 * questions.
aoqi@1 23 *
aoqi@1 24 */
aoqi@1 25
aoqi@1 26 #include "precompiled.hpp"
aoqi@1 27 #include "asm/macroAssembler.hpp"
aoqi@1 28 #include "asm/macroAssembler.inline.hpp"
aoqi@1 29 #include "memory/resourceArea.hpp"
aoqi@1 30 #include "runtime/java.hpp"
aoqi@1 31 #include "runtime/stubCodeGenerator.hpp"
aoqi@1 32 #include "vm_version_mips.hpp"
aoqi@1 33 #ifdef TARGET_OS_FAMILY_linux
aoqi@1 34 # include "os_linux.inline.hpp"
aoqi@1 35 #endif
aoqi@1 36 #ifdef TARGET_OS_FAMILY_solaris
aoqi@1 37 # include "os_solaris.inline.hpp"
aoqi@1 38 #endif
aoqi@1 39 #ifdef TARGET_OS_FAMILY_windows
aoqi@1 40 # include "os_windows.inline.hpp"
aoqi@1 41 #endif
aoqi@1 42 #ifdef TARGET_OS_FAMILY_bsd
aoqi@1 43 # include "os_bsd.inline.hpp"
aoqi@1 44 #endif
aoqi@1 45 /*
aoqi@1 46 int VM_Version::_cpu;
aoqi@1 47 int VM_Version::_model;
aoqi@1 48 int VM_Version::_stepping;
aoqi@1 49 int VM_Version::_cpuFeatures;
aoqi@1 50 const char* VM_Version::_features_str = "";
aoqi@1 51 VM_Version::CpuidInfo VM_Version::_cpuid_info = { 0, };
aoqi@1 52
aoqi@1 53 static BufferBlob* stub_blob;
aoqi@1 54 static const int stub_size = 300;
aoqi@1 55
aoqi@1 56 extern "C" {
aoqi@1 57 typedef void (*getPsrInfo_stub_t)(void*);
aoqi@1 58 }
aoqi@1 59 static getPsrInfo_stub_t getPsrInfo_stub = NULL;
aoqi@1 60 */
aoqi@1 61 int VM_Version::_features = VM_Version::unknown_m;
aoqi@1 62 const char* VM_Version::_features_str = "";
aoqi@1 63 /*
aoqi@1 64 class VM_Version_StubGenerator: public StubCodeGenerator {
aoqi@1 65 public:
aoqi@1 66
aoqi@1 67 VM_Version_StubGenerator(CodeBuffer *c) : StubCodeGenerator(c) {}
aoqi@1 68
aoqi@1 69 address generate_getPsrInfo() {
aoqi@1 70 };
aoqi@1 71 };
aoqi@1 72
aoqi@1 73
aoqi@1 74 void VM_Version::get_processor_features() {
aoqi@1 75 }
aoqi@1 76 */
aoqi@1 77 void VM_Version::initialize() {
aoqi@1 78 _features = determine_features();
aoqi@1 79 //no need, Abstract_VM_Version already define it as false
aoqi@1 80 _supports_cx8 = true;
aoqi@1 81
aoqi@1 82 char buf[256];
aoqi@1 83 jio_snprintf(buf, sizeof(buf), "%s, %s"
aoqi@1 84 #ifdef OPT_RANGECHECK
aoqi@1 85 ", optimized range check"
aoqi@1 86 #endif
aoqi@1 87 #ifdef OPT_PHI_1
aoqi@1 88 ", optimized phi"
aoqi@1 89 #endif
aoqi@1 90 #ifdef OPT_MERGE
aoqi@1 91 ", optimized merge"
aoqi@1 92 #endif
aoqi@1 93 , (has_l2_cache() ? "has_l2_cache" : ""), (has_16k_page() ? "has_16k_page" : "")
aoqi@1 94 );
aoqi@1 95 //////////////////////add some other feature here//////////////////
aoqi@203 96 #ifdef COMPILER2
aoqi@209 97 if (MaxVectorSize > 0) {
aoqi@209 98 if (!is_power_of_2(MaxVectorSize)) {
aoqi@209 99 warning("MaxVectorSize must be a power of 2");
aoqi@209 100 MaxVectorSize = 8;
aoqi@209 101 }
aoqi@209 102 if (MaxVectorSize > 0 && supports_ps()) {
aoqi@209 103 MaxVectorSize = 8;
aoqi@209 104 }
aoqi@209 105 }
aoqi@203 106 if (UseLoongsonISA)
fujie@212 107 UseCountTrailingZerosInstruction = false; // Turn on this flag may cause SIGILL on 3B1500
aoqi@203 108 #endif
aoqi@209 109 UseSSE = 0; // Only on x86 and x64
aoqi@1 110
aoqi@1 111 // buf is started with ", " or is empty
aoqi@1 112 _features_str = strdup(buf);
aoqi@1 113 NOT_PRODUCT( if (PrintMiscellaneous && Verbose) print_features(); );
aoqi@1 114 }
aoqi@1 115
aoqi@1 116 void VM_Version::print_features() {
aoqi@1 117 tty->print_cr("Version:%s", cpu_features());
aoqi@1 118 }
aoqi@1 119
aoqi@1 120 int VM_Version::determine_features() {
aoqi@1 121 //////////////////////add some other feature here//////////////////
aoqi@1 122 return spt_16k_page_m;
aoqi@1 123 }
aoqi@1 124
aoqi@1 125 static int saved_features = 0;
aoqi@1 126
aoqi@1 127 void VM_Version::allow_all() {
aoqi@1 128 saved_features = _features;
aoqi@1 129 _features = all_features_m;
aoqi@1 130 }
aoqi@1 131
aoqi@1 132 void VM_Version::revert() {
aoqi@1 133 _features = saved_features;
aoqi@1 134 }

mercurial