src/share/vm/shark/sharkRuntime.hpp

Tue, 18 Jun 2013 12:31:07 -0700

author
johnc
date
Tue, 18 Jun 2013 12:31:07 -0700
changeset 5277
01522ca68fc7
parent 4037
da91efe96a93
child 6876
710a3c8b516e
permissions
-rw-r--r--

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 /*
coleenp@4037 2 * Copyright (c) 1999, 2012, 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_SHARKRUNTIME_HPP
stefank@2314 27 #define SHARE_VM_SHARK_SHARKRUNTIME_HPP
stefank@2314 28
stefank@2314 29 #include "memory/allocation.hpp"
stefank@2314 30 #include "runtime/thread.hpp"
stefank@2314 31 #include "shark/llvmHeaders.hpp"
stefank@2314 32 #include "shark/llvmValue.hpp"
stefank@2314 33
twisti@2047 34 class SharkRuntime : public AllStatic {
twisti@2047 35 // VM calls
twisti@2047 36 public:
twisti@2047 37 static int find_exception_handler(JavaThread* thread,
twisti@2047 38 int* indexes,
twisti@2047 39 int num_indexes);
twisti@2047 40
twisti@2047 41 static void monitorenter(JavaThread* thread, BasicObjectLock* lock);
twisti@2047 42 static void monitorexit(JavaThread* thread, BasicObjectLock* lock);
twisti@2047 43
twisti@2047 44 static void new_instance(JavaThread* thread, int index);
twisti@2047 45 static void newarray(JavaThread* thread, BasicType type, int size);
twisti@2047 46 static void anewarray(JavaThread* thread, int index, int size);
twisti@2047 47 static void multianewarray(JavaThread* thread,
twisti@2047 48 int index,
twisti@2047 49 int ndims,
twisti@2047 50 int* dims);
twisti@2047 51
twisti@2047 52 static void register_finalizer(JavaThread* thread, oop object);
twisti@2047 53
twisti@2047 54 static void throw_ArithmeticException(JavaThread* thread,
twisti@2047 55 const char* file,
twisti@2047 56 int line);
twisti@2047 57 static void throw_ArrayIndexOutOfBoundsException(JavaThread* thread,
twisti@2047 58 const char* file,
twisti@2047 59 int line,
twisti@2047 60 int index);
twisti@2047 61 static void throw_ClassCastException(JavaThread* thread,
twisti@2047 62 const char* file,
twisti@2047 63 int line);
twisti@2047 64 static void throw_NullPointerException(JavaThread* thread,
twisti@2047 65 const char* file,
twisti@2047 66 int line);
twisti@2047 67
twisti@2047 68 // Helpers for VM calls
twisti@2047 69 private:
twisti@2047 70 static const SharkFrame* last_frame(JavaThread *thread) {
twisti@2047 71 return thread->last_frame().zero_sharkframe();
twisti@2047 72 }
coleenp@4037 73 static Method* method(JavaThread *thread) {
twisti@2047 74 return last_frame(thread)->method();
twisti@2047 75 }
twisti@2047 76 static address bcp(JavaThread *thread, int bci) {
twisti@2047 77 return method(thread)->code_base() + bci;
twisti@2047 78 }
twisti@2047 79 static int two_byte_index(JavaThread *thread, int bci) {
twisti@2047 80 return Bytes::get_Java_u2(bcp(thread, bci) + 1);
twisti@2047 81 }
twisti@2047 82 static intptr_t tos_at(JavaThread *thread, int offset) {
twisti@2047 83 return *(thread->zero_stack()->sp() + offset);
twisti@2047 84 }
twisti@2047 85
twisti@2047 86 // Non-VM calls
twisti@2047 87 public:
twisti@2047 88 static void dump(const char *name, intptr_t value);
coleenp@4037 89 static bool is_subtype_of(Klass* check_klass, Klass* object_klass);
twisti@2047 90 static int uncommon_trap(JavaThread* thread, int trap_request);
twisti@2047 91 };
stefank@2314 92
stefank@2314 93 #endif // SHARE_VM_SHARK_SHARKRUNTIME_HPP

mercurial