Tue, 18 Jun 2013 12:31:07 -0700
8015237: Parallelize string table scanning during strong root processing
Summary: Parallelize the scanning of the intern string table by having each GC worker claim a given number of buckets. Changes were also reviewed by Per Liden <per.liden@oracle.com>.
Reviewed-by: tschatzl, stefank, twisti
twisti@2047 | 1 | /* |
twisti@2765 | 2 | * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. |
twisti@2047 | 3 | * Copyright 2008, 2009, 2010 Red Hat, Inc. |
twisti@2047 | 4 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
twisti@2047 | 5 | * |
twisti@2047 | 6 | * This code is free software; you can redistribute it and/or modify it |
twisti@2047 | 7 | * under the terms of the GNU General Public License version 2 only, as |
twisti@2047 | 8 | * published by the Free Software Foundation. |
twisti@2047 | 9 | * |
twisti@2047 | 10 | * This code is distributed in the hope that it will be useful, but WITHOUT |
twisti@2047 | 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
twisti@2047 | 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
twisti@2047 | 13 | * version 2 for more details (a copy is included in the LICENSE file that |
twisti@2047 | 14 | * accompanied this code). |
twisti@2047 | 15 | * |
twisti@2047 | 16 | * You should have received a copy of the GNU General Public License version |
twisti@2047 | 17 | * 2 along with this work; if not, write to the Free Software Foundation, |
twisti@2047 | 18 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
twisti@2047 | 19 | * |
twisti@2047 | 20 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
twisti@2047 | 21 | * or visit www.oracle.com if you need additional information or have any |
twisti@2047 | 22 | * questions. |
twisti@2047 | 23 | * |
twisti@2047 | 24 | */ |
twisti@2047 | 25 | |
stefank@2314 | 26 | #ifndef SHARE_VM_SHARK_LLVMHEADERS_HPP |
stefank@2314 | 27 | #define SHARE_VM_SHARK_LLVMHEADERS_HPP |
stefank@2314 | 28 | |
twisti@2047 | 29 | #ifdef assert |
twisti@2047 | 30 | #undef assert |
twisti@2047 | 31 | #endif |
twisti@2047 | 32 | |
twisti@2047 | 33 | #ifdef DEBUG |
twisti@2047 | 34 | #define SHARK_DEBUG |
twisti@2047 | 35 | #undef DEBUG |
twisti@2047 | 36 | #endif |
twisti@2047 | 37 | |
twisti@4314 | 38 | #include <llvm/Analysis/Verifier.h> |
twisti@2047 | 39 | #include <llvm/Argument.h> |
twisti@2047 | 40 | #include <llvm/Constants.h> |
twisti@2047 | 41 | #include <llvm/DerivedTypes.h> |
twisti@2047 | 42 | #include <llvm/ExecutionEngine/ExecutionEngine.h> |
twisti@2047 | 43 | #include <llvm/Instructions.h> |
twisti@2047 | 44 | #include <llvm/LLVMContext.h> |
twisti@2047 | 45 | #include <llvm/Module.h> |
twisti@4314 | 46 | #if SHARK_LLVM_VERSION <= 31 |
twisti@4314 | 47 | #include <llvm/Support/IRBuilder.h> |
twisti@4314 | 48 | #else |
twisti@4314 | 49 | #include <llvm/IRBuilder.h> |
twisti@2047 | 50 | #endif |
twisti@2765 | 51 | #include <llvm/Support/Threading.h> |
twisti@4314 | 52 | #include <llvm/Support/TargetSelect.h> |
twisti@2047 | 53 | #include <llvm/Type.h> |
twisti@2047 | 54 | #include <llvm/ExecutionEngine/JITMemoryManager.h> |
twisti@2047 | 55 | #include <llvm/Support/CommandLine.h> |
twisti@4314 | 56 | #include <llvm/ExecutionEngine/MCJIT.h> |
twisti@2047 | 57 | #include <llvm/ExecutionEngine/JIT.h> |
twisti@2047 | 58 | #include <llvm/ADT/StringMap.h> |
twisti@2047 | 59 | #include <llvm/Support/Debug.h> |
twisti@2765 | 60 | #include <llvm/Support/Host.h> |
twisti@2047 | 61 | |
twisti@2047 | 62 | #include <map> |
twisti@2047 | 63 | |
twisti@2047 | 64 | #ifdef assert |
twisti@2047 | 65 | #undef assert |
twisti@2047 | 66 | #endif |
twisti@2047 | 67 | |
twisti@2047 | 68 | // from hotspot/src/share/vm/utilities/debug.hpp |
twisti@2047 | 69 | #ifdef ASSERT |
twisti@2047 | 70 | #ifndef USE_REPEATED_ASSERTS |
twisti@2047 | 71 | #define assert(p, msg) \ |
twisti@2047 | 72 | do { \ |
twisti@2047 | 73 | if (!(p)) { \ |
twisti@2047 | 74 | report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", msg); \ |
twisti@2047 | 75 | BREAKPOINT; \ |
twisti@2047 | 76 | } \ |
twisti@2047 | 77 | } while (0) |
twisti@2047 | 78 | #else // #ifndef USE_REPEATED_ASSERTS |
twisti@2047 | 79 | #define assert(p, msg) |
twisti@2047 | 80 | do { \ |
twisti@2047 | 81 | for (int __i = 0; __i < AssertRepeat; __i++) { \ |
twisti@2047 | 82 | if (!(p)) { \ |
twisti@2047 | 83 | report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", msg); \ |
twisti@2047 | 84 | BREAKPOINT; \ |
twisti@2047 | 85 | } \ |
twisti@2047 | 86 | } \ |
twisti@2047 | 87 | } while (0) |
twisti@2047 | 88 | #endif // #ifndef USE_REPEATED_ASSERTS |
twisti@2047 | 89 | #else |
twisti@2047 | 90 | #define assert(p, msg) |
twisti@2047 | 91 | #endif |
twisti@2047 | 92 | |
twisti@2047 | 93 | #ifdef DEBUG |
twisti@2047 | 94 | #undef DEBUG |
twisti@2047 | 95 | #endif |
twisti@2047 | 96 | #ifdef SHARK_DEBUG |
twisti@2047 | 97 | #define DEBUG |
twisti@2047 | 98 | #undef SHARK_DEBUG |
twisti@2047 | 99 | #endif |
stefank@2314 | 100 | |
stefank@2314 | 101 | #endif // SHARE_VM_SHARK_LLVMHEADERS_HPP |