Path: blob/master/src/hotspot/cpu/zero/entry_zero.hpp
40930 views
/*1* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.2* Copyright 2008, 2009, 2010 Red Hat, Inc.3* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4*5* This code is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License version 2 only, as7* published by the Free Software Foundation.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*23*/2425#ifndef CPU_ZERO_ENTRY_ZERO_HPP26#define CPU_ZERO_ENTRY_ZERO_HPP2728#include "interpreter/zero/zeroInterpreter.hpp"2930class ZeroEntry {31public:32ZeroEntry() {33ShouldNotCallThis();34}3536private:37address _entry_point;3839public:40address entry_point() const {41return _entry_point;42}43void set_entry_point(address entry_point) {44_entry_point = entry_point;45}4647private:48typedef int (*NormalEntryFunc)(Method* method,49intptr_t base_pc,50TRAPS);51typedef int (*OSREntryFunc)(Method* method,52address osr_buf,53intptr_t base_pc,54TRAPS);5556public:57void invoke(Method* method, TRAPS) const {58maybe_deoptimize(59((NormalEntryFunc) entry_point())(method, (intptr_t) this, THREAD),60THREAD);61}62void invoke_osr(Method* method, address osr_buf, TRAPS) const {63maybe_deoptimize(64((OSREntryFunc) entry_point())(method, osr_buf, (intptr_t) this, THREAD),65THREAD);66}6768private:69static void maybe_deoptimize(int deoptimized_frames, TRAPS) {70if (deoptimized_frames)71ZeroInterpreter::main_loop(deoptimized_frames - 1, THREAD);72}7374public:75static ByteSize entry_point_offset() {76return byte_offset_of(ZeroEntry, _entry_point);77}78};7980#endif // CPU_ZERO_ENTRY_ZERO_HPP818283