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