1 /*
2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. 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 it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
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).
14 *
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.
18 *
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
21 * questions.
22 *
78 class JVMState;
79 class Type;
80 class TypeData;
81 class TypeInt;
82 class TypePtr;
83 class TypeOopPtr;
84 class TypeFunc;
85 class Unique_Node_List;
86 class nmethod;
87 class WarmCallInfo;
88 class Node_Stack;
89 struct Final_Reshape_Counts;
90
91 typedef unsigned int node_idx_t;
92 class NodeCloneInfo {
93 private:
94 uint64_t _idx_clone_orig;
95 public:
96
97 void set_idx(node_idx_t idx) {
98 _idx_clone_orig = _idx_clone_orig & CONST64(0xFFFFFFFF00000000) | idx;
99 }
100 node_idx_t idx() const { return (node_idx_t)(_idx_clone_orig & 0xFFFFFFFF); }
101
102 void set_gen(int generation) {
103 uint64_t g = (uint64_t)generation << 32;
104 _idx_clone_orig = _idx_clone_orig & 0xFFFFFFFF | g;
105 }
106 int gen() const { return (int)(_idx_clone_orig >> 32); }
107
108 void set(uint64_t x) { _idx_clone_orig = x; }
109 void set(node_idx_t x, int g) { set_idx(x); set_gen(g); }
110 uint64_t get() const { return _idx_clone_orig; }
111
112 NodeCloneInfo(uint64_t idx_clone_orig) : _idx_clone_orig(idx_clone_orig) {}
113 NodeCloneInfo(node_idx_t x, int g) : _idx_clone_orig(0) { set(x, g); }
114
115 void dump() const;
116 };
117
118 class CloneMap {
119 friend class Compile;
120 private:
121 bool _debug;
122 Dict* _dict;
123 int _clone_idx; // current cloning iteration/generation in loop unroll
124 public:
|
1 /*
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. 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 it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
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).
14 *
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.
18 *
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
21 * questions.
22 *
78 class JVMState;
79 class Type;
80 class TypeData;
81 class TypeInt;
82 class TypePtr;
83 class TypeOopPtr;
84 class TypeFunc;
85 class Unique_Node_List;
86 class nmethod;
87 class WarmCallInfo;
88 class Node_Stack;
89 struct Final_Reshape_Counts;
90
91 typedef unsigned int node_idx_t;
92 class NodeCloneInfo {
93 private:
94 uint64_t _idx_clone_orig;
95 public:
96
97 void set_idx(node_idx_t idx) {
98 _idx_clone_orig = (_idx_clone_orig & CONST64(0xFFFFFFFF00000000)) | idx;
99 }
100 node_idx_t idx() const { return (node_idx_t)(_idx_clone_orig & 0xFFFFFFFF); }
101
102 void set_gen(int generation) {
103 uint64_t g = (uint64_t)generation << 32;
104 _idx_clone_orig = (_idx_clone_orig & 0xFFFFFFFF) | g;
105 }
106 int gen() const { return (int)(_idx_clone_orig >> 32); }
107
108 void set(uint64_t x) { _idx_clone_orig = x; }
109 void set(node_idx_t x, int g) { set_idx(x); set_gen(g); }
110 uint64_t get() const { return _idx_clone_orig; }
111
112 NodeCloneInfo(uint64_t idx_clone_orig) : _idx_clone_orig(idx_clone_orig) {}
113 NodeCloneInfo(node_idx_t x, int g) : _idx_clone_orig(0) { set(x, g); }
114
115 void dump() const;
116 };
117
118 class CloneMap {
119 friend class Compile;
120 private:
121 bool _debug;
122 Dict* _dict;
123 int _clone_idx; // current cloning iteration/generation in loop unroll
124 public:
|