2
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
15
* You should have received a copy of the GNU General Public License version
16
* 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.
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
25
#include "precompiled.hpp"
26
#include "asm/assembler.hpp"
27
#include "asm/assembler.inline.hpp"
28
#include "ci/ciEnv.hpp"
29
#include "gc/shared/cardTableBarrierSet.hpp"
30
#include "gc/shared/collectedHeap.inline.hpp"
31
#include "interpreter/interpreter.hpp"
32
#include "interpreter/interpreterRuntime.hpp"
33
#include "interpreter/templateInterpreterGenerator.hpp"
34
#include "memory/resourceArea.hpp"
35
#include "prims/jvm_misc.hpp"
36
#include "prims/methodHandles.hpp"
37
#include "runtime/interfaceSupport.inline.hpp"
38
#include "runtime/objectMonitor.hpp"
39
#include "runtime/os.hpp"
40
#include "runtime/sharedRuntime.hpp"
41
#include "runtime/stubRoutines.hpp"
42
#include "utilities/macros.hpp"
45
// Convert the raw encoding form into the form expected by the
46
// constructor for Address.
47
Address Address::make_raw(int base, int index, int scale, int disp, relocInfo::relocType disp_reloc) {
48
RelocationHolder rspec = RelocationHolder::none;
49
if (disp_reloc != relocInfo::none) {
50
rspec = Relocation::spec_simple(disp_reloc);
53
Register rindex = as_Register(index);
55
assert(disp == 0, "unsupported");
56
Address madr(as_Register(base), rindex, lsl, scale);
60
assert(scale == 0, "not supported");
61
Address madr(as_Register(base), disp);
68
void AsmOperand::initialize_rotated_imm(unsigned int imm) {
69
for (int shift = 2; shift <= 24; shift += 2) {
70
if ((imm & ~(0xff << shift)) == 0) {
71
_encoding = 1 << 25 | (32 - shift) << 7 | imm >> shift;
75
assert((imm & 0x0ffffff0) == 0, "too complicated constant: %d (%x)", imm, imm);
76
_encoding = 1 << 25 | 4 << 7 | imm >> 28 | imm << 4;
79
bool AsmOperand::is_rotated_imm(unsigned int imm) {
80
if ((imm >> 8) == 0) {
83
for (int shift = 2; shift <= 24; shift += 2) {
84
if ((imm & ~(0xff << shift)) == 0) {
88
if ((imm & 0x0ffffff0) == 0) {