1 /*
2 * Copyright (c) 1998, 2013, 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 *
23 */
24
25 #include "precompiled.hpp"
26 #include "memory/allocation.inline.hpp"
27 #include "opto/chaitin.hpp"
28 #include "opto/machnode.hpp"
29
30 // See if this register (or pairs, or vector) already contains the value.
31 static bool register_contains_value(Node* val, OptoReg::Name reg, int n_regs,
32 Node_List& value) {
33 for (int i = 0; i < n_regs; i++) {
34 OptoReg::Name nreg = OptoReg::add(reg,-i);
35 if (value[nreg] != val)
36 return false;
37 }
38 return true;
39 }
40
41 //---------------------------may_be_copy_of_callee-----------------------------
42 // Check to see if we can possibly be a copy of a callee-save value.
43 bool PhaseChaitin::may_be_copy_of_callee( Node *def ) const {
44 // Short circuit if there are no callee save registers
45 if (_matcher.number_of_saved_registers() == 0) return false;
46
|
1 /*
2 * Copyright (c) 1998, 2016, 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 *
23 */
24
25 #include "precompiled.hpp"
26 #include "memory/allocation.inline.hpp"
27 #include "memory/resourceArea.hpp"
28 #include "opto/chaitin.hpp"
29 #include "opto/machnode.hpp"
30
31 // See if this register (or pairs, or vector) already contains the value.
32 static bool register_contains_value(Node* val, OptoReg::Name reg, int n_regs,
33 Node_List& value) {
34 for (int i = 0; i < n_regs; i++) {
35 OptoReg::Name nreg = OptoReg::add(reg,-i);
36 if (value[nreg] != val)
37 return false;
38 }
39 return true;
40 }
41
42 //---------------------------may_be_copy_of_callee-----------------------------
43 // Check to see if we can possibly be a copy of a callee-save value.
44 bool PhaseChaitin::may_be_copy_of_callee( Node *def ) const {
45 // Short circuit if there are no callee save registers
46 if (_matcher.number_of_saved_registers() == 0) return false;
47
|