src/hotspot/cpu/sparc/assembler_sparc.cpp
author stuefe
Wed, 27 Mar 2019 14:13:34 +0100
changeset 54437 2ae93028bef3
parent 47216 71c04702a3d5
permissions -rw-r--r--
8221539: [metaspace] Improve MetaspaceObj::is_metaspace_obj() and friends Reviewed-by: adinn, coleenp, mdoerr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13391
diff changeset
     2
 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5426
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5426
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5426
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6772
diff changeset
    25
#include "precompiled.hpp"
7700
3252c02e23b8 7006044: materialize cheap non-oop pointers on 64-bit SPARC
twisti
parents: 7433
diff changeset
    26
#include "asm/assembler.hpp"
14631
526804361522 8003250: SPARC: move MacroAssembler into separate file
twisti
parents: 14626
diff changeset
    27
#include "asm/assembler.inline.hpp"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
46596
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    29
#include "assembler_sparc.hpp"
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    30
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
int AbstractAssembler::code_fill_byte() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
  return 0x00;                  // illegal instruction 0x00000000
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
}
46596
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    34
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    35
#ifdef VALIDATE_PIPELINE
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    36
/* Walk over the current code section and verify that there are no obvious
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    37
 * pipeline hazards exposed in the code generated.
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    38
 */
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    39
void Assembler::validate_no_pipeline_hazards() {
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    40
  const CodeSection* csect = code_section();
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    41
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    42
  address addr0 = csect->start();
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    43
  address addrN = csect->end();
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    44
  uint32_t prev = 0;
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    45
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    46
  assert((addrN - addr0) % BytesPerInstWord == 0, "must be");
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    47
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    48
  for (address pc = addr0; pc != addrN; pc += BytesPerInstWord) {
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    49
    uint32_t insn = *reinterpret_cast<uint32_t*>(pc);
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    50
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    51
    // 1. General case: No CTI immediately after other CTI
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    52
    assert(!(is_cti(prev) && is_cti(insn)), "CTI-CTI not allowed.");
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    53
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    54
    // 2. Special case: No CTI immediately after/before RDPC
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    55
    assert(!(is_cti(prev) && is_rdpc(insn)), "CTI-RDPC not allowed.");
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    56
    assert(!(is_rdpc(prev) && is_cti(insn)), "RDPC-CTI not allowed.");
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    57
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    58
    prev = insn;
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    59
  }
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    60
}
a7c9706d25a9 8144448: Avoid placing CTI immediately following or preceding RDPC instruction
neliasso
parents: 14631
diff changeset
    61
#endif