src/hotspot/cpu/s390/stubRoutines_s390.hpp
author coleenp
Thu, 10 Jan 2019 15:13:51 -0500
changeset 53244 9807daeb47c4
parent 47216 71c04702a3d5
permissions -rw-r--r--
8216167: Update include guards to reflect correct directories Summary: Use script and some manual fixup to fix directores names in include guards. Reviewed-by: lfoltan, eosterlund, kbarrett
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42065
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     1
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 47216
diff changeset
     2
 * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
46315
a796c32af782 8175368: [s390] Provide intrinsic implementation for CRC32C
lucy
parents: 46279
diff changeset
     3
 * Copyright (c) 2016, 2017, SAP SE. All rights reserved.
42065
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     5
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     8
 * published by the Free Software Foundation.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     9
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    14
 * accompanied this code).
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    15
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    19
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    22
 * questions.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    23
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    24
 */
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    25
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 47216
diff changeset
    26
#ifndef CPU_S390_STUBROUTINES_S390_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 47216
diff changeset
    27
#define CPU_S390_STUBROUTINES_S390_HPP
42065
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    28
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    29
// This file holds the platform specific parts of the StubRoutines
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    30
// definition. See stubRoutines.hpp for a description on how to extend it.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    31
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    32
static bool returns_to_call_stub(address return_pc) { return return_pc == _call_stub_return_address; }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    33
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    34
enum { // Platform dependent constants.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    35
  // TODO: May be able to shrink this a lot
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    36
  code_size1 = 20000,      // Simply increase if too small (assembler will crash if too small).
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    37
  code_size2 = 20000       // Simply increase if too small (assembler will crash if too small).
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    38
};
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    39
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    40
// MethodHandles adapters
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    41
enum method_handles_platform_dependent_constants {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    42
  method_handles_adapters_code_size = 5000
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    43
};
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    44
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    45
#define CRC32_COLUMN_SIZE 256
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    46
#define CRC32_BYFOUR
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    47
#ifdef CRC32_BYFOUR
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    48
  #define CRC32_TABLES 8
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    49
#else
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    50
  #define CRC32_TABLES 1
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    51
#endif
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    52
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    53
// Comapct string intrinsics: Translate table for string inflate intrinsic. Used by trot instruction.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    54
#define TROT_ALIGNMENT   8  // Required by instruction,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    55
                            // guaranteed by jlong table element type.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    56
#define TROT_COLUMN_SIZE (256*sizeof(jchar)/sizeof(jlong))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    57
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    58
class zarch {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    59
 friend class StubGenerator;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    60
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    61
 public:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    62
  enum { nof_instance_allocators = 10 };
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    63
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    64
  // allocator lock values
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    65
  enum {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    66
    unlocked = 0,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    67
    locked   = 1
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    68
  };
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    69
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    70
 private:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    71
  static int _atomic_memory_operation_lock;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    72
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    73
  static address _partial_subtype_check;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    74
  static juint   _crc_table[CRC32_TABLES][CRC32_COLUMN_SIZE];
46315
a796c32af782 8175368: [s390] Provide intrinsic implementation for CRC32C
lucy
parents: 46279
diff changeset
    75
  static juint   _crc32c_table[CRC32_TABLES][CRC32_COLUMN_SIZE];
42065
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    76
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    77
  // Comapct string intrinsics: Translate table for string inflate intrinsic. Used by trot instruction.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    78
  static address _trot_table_addr;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    79
  static jlong   _trot_table[TROT_COLUMN_SIZE];
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    80
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    81
 public:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    82
  // Global lock for everyone who needs to use atomic_compare_and_exchange
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    83
  // or atomic_increment -- should probably use more locks for more
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    84
  // scalability -- for instance one for each eden space or group of.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    85
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    86
  // Address of the lock for atomic_compare_and_exchange.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    87
  static int* atomic_memory_operation_lock_addr() { return &_atomic_memory_operation_lock; }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    88
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    89
  // Accessor and mutator for _atomic_memory_operation_lock.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    90
  static int atomic_memory_operation_lock() { return _atomic_memory_operation_lock; }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    91
  static void set_atomic_memory_operation_lock(int value) { _atomic_memory_operation_lock = value; }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    92
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    93
  static address partial_subtype_check()                  { return _partial_subtype_check; }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    94
46315
a796c32af782 8175368: [s390] Provide intrinsic implementation for CRC32C
lucy
parents: 46279
diff changeset
    95
  static void generate_load_absolute_address(MacroAssembler* masm, Register table, address table_addr, uint64_t table_contents);
42065
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    96
  static void generate_load_crc_table_addr(MacroAssembler* masm, Register table);
46315
a796c32af782 8175368: [s390] Provide intrinsic implementation for CRC32C
lucy
parents: 46279
diff changeset
    97
  static void generate_load_crc32c_table_addr(MacroAssembler* masm, Register table);
42065
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    98
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    99
  // Comapct string intrinsics: Translate table for string inflate intrinsic. Used by trot instruction.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   100
  static void generate_load_trot_table_addr(MacroAssembler* masm, Register table);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   101
};
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   102
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 47216
diff changeset
   103
#endif // CPU_S390_STUBROUTINES_S390_HPP