sharkRuntime.hpp revision 1612
0N/A/*
2273N/A * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
0N/A * Copyright 2008, 2009, 2010 Red Hat, Inc.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1472N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
0N/A * questions.
0N/A *
0N/A */
1879N/A
1879N/Aclass SharkRuntime : public AllStatic {
1879N/A // VM calls
1879N/A public:
1879N/A static int find_exception_handler(JavaThread* thread,
1879N/A int* indexes,
1879N/A int num_indexes);
1879N/A
1879N/A static void monitorenter(JavaThread* thread, BasicObjectLock* lock);
0N/A static void monitorexit(JavaThread* thread, BasicObjectLock* lock);
0N/A
0N/A static void new_instance(JavaThread* thread, int index);
0N/A static void newarray(JavaThread* thread, BasicType type, int size);
0N/A static void anewarray(JavaThread* thread, int index, int size);
0N/A static void multianewarray(JavaThread* thread,
0N/A int index,
0N/A int ndims,
0N/A int* dims);
0N/A
0N/A static void register_finalizer(JavaThread* thread, oop object);
0N/A
0N/A static void throw_ArithmeticException(JavaThread* thread,
0N/A const char* file,
0N/A int line);
0N/A static void throw_ArrayIndexOutOfBoundsException(JavaThread* thread,
0N/A const char* file,
0N/A int line,
0N/A int index);
0N/A static void throw_ClassCastException(JavaThread* thread,
0N/A const char* file,
0N/A int line);
0N/A static void throw_NullPointerException(JavaThread* thread,
0N/A const char* file,
0N/A int line);
0N/A
0N/A // Helpers for VM calls
0N/A private:
0N/A static const SharkFrame* last_frame(JavaThread *thread) {
0N/A return thread->last_frame().zero_sharkframe();
0N/A }
0N/A static methodOop method(JavaThread *thread) {
0N/A return last_frame(thread)->method();
0N/A }
0N/A static address bcp(JavaThread *thread, int bci) {
0N/A return method(thread)->code_base() + bci;
0N/A }
0N/A static int two_byte_index(JavaThread *thread, int bci) {
0N/A return Bytes::get_Java_u2(bcp(thread, bci) + 1);
0N/A }
0N/A static intptr_t tos_at(JavaThread *thread, int offset) {
0N/A return *(thread->zero_stack()->sp() + offset);
0N/A }
0N/A
0N/A // Non-VM calls
0N/A public:
0N/A static void dump(const char *name, intptr_t value);
0N/A static bool is_subtype_of(klassOop check_klass, klassOop object_klass);
0N/A static int uncommon_trap(JavaThread* thread, int trap_request);
0N/A};
0N/A