Path: blob/master/src/hotspot/cpu/ppc/c2_safepointPollStubTable_ppc.cpp
40930 views
/*1* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.2* Copyright (c) 2021 SAP SE. All rights reserved.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#include "precompiled.hpp"26#include "macroAssembler_ppc.inline.hpp"27#include "opto/compile.hpp"28#include "opto/node.hpp"29#include "opto/output.hpp"30#include "runtime/sharedRuntime.hpp"3132#define __ masm.33void C2SafepointPollStubTable::emit_stub_impl(MacroAssembler& masm, C2SafepointPollStub* entry) const {34assert(SharedRuntime::polling_page_return_handler_blob() != NULL,35"polling page return stub not created yet");36address stub = SharedRuntime::polling_page_return_handler_blob()->entry_point();3738__ bind(entry->_stub_label);39// Using pc relative address computation.40{41Label next_pc;42__ bl(next_pc);43__ bind(next_pc);44}45int current_offset = __ offset();46// Code size should not depend on offset: see _stub_size computation in output.cpp47__ load_const32(R12, entry->_safepoint_offset - current_offset);48__ mflr(R0);49__ add(R12, R12, R0);50__ std(R12, in_bytes(JavaThread::saved_exception_pc_offset()), R16_thread);5152__ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub));53__ mtctr(R0);54__ bctr();55}56#undef __575859