1 /*
2 * Copyright (c) 1997, 2009, 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 class Compile;
26 class Node;
27 class MachNode;
28 class MachTypeNode;
29 class MachOper;
30
31 //---------------------------Matcher-------------------------------------------
32 class Matcher : public PhaseTransform {
33 friend class VMStructs;
34 // Private arena of State objects
35 ResourceArea _states_arena;
36
37 VectorSet _visited; // Visit bits
38
39 // Used to control the Label pass
40 VectorSet _shared; // Shared Ideal Node
41 VectorSet _dontcare; // Nothing the matcher cares about
42
43 // Private methods which perform the actual matching and reduction
44 // Walks the label tree, generating machine nodes
426
427 // Used by the DFA in dfa_sparc.cpp. Check for a following
428 // FastUnLock acting as a Release and thus we don't need a Release
429 // here. We retain the Node to act as a compiler ordering barrier.
430 static bool post_fast_unlock( const Node *rel );
431
432 // Check for a following volatile memory barrier without an
433 // intervening load and thus we don't need a barrier here. We
434 // retain the Node to act as a compiler ordering barrier.
435 static bool post_store_load_barrier(const Node* mb);
436
437
438 #ifdef ASSERT
439 void dump_old2new_map(); // machine-independent to machine-dependent
440
441 Node* find_old_node(Node* new_node) {
442 return _new2old_map[new_node->_idx];
443 }
444 #endif
445 };
|
1 /*
2 * Copyright (c) 1997, 2010, 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 #ifndef SHARE_VM_OPTO_MATCHER_HPP
26 #define SHARE_VM_OPTO_MATCHER_HPP
27
28 #include "libadt/vectset.hpp"
29 #include "memory/resourceArea.hpp"
30 #include "opto/node.hpp"
31 #include "opto/phaseX.hpp"
32 #include "opto/regmask.hpp"
33
34 class Compile;
35 class Node;
36 class MachNode;
37 class MachTypeNode;
38 class MachOper;
39
40 //---------------------------Matcher-------------------------------------------
41 class Matcher : public PhaseTransform {
42 friend class VMStructs;
43 // Private arena of State objects
44 ResourceArea _states_arena;
45
46 VectorSet _visited; // Visit bits
47
48 // Used to control the Label pass
49 VectorSet _shared; // Shared Ideal Node
50 VectorSet _dontcare; // Nothing the matcher cares about
51
52 // Private methods which perform the actual matching and reduction
53 // Walks the label tree, generating machine nodes
435
436 // Used by the DFA in dfa_sparc.cpp. Check for a following
437 // FastUnLock acting as a Release and thus we don't need a Release
438 // here. We retain the Node to act as a compiler ordering barrier.
439 static bool post_fast_unlock( const Node *rel );
440
441 // Check for a following volatile memory barrier without an
442 // intervening load and thus we don't need a barrier here. We
443 // retain the Node to act as a compiler ordering barrier.
444 static bool post_store_load_barrier(const Node* mb);
445
446
447 #ifdef ASSERT
448 void dump_old2new_map(); // machine-independent to machine-dependent
449
450 Node* find_old_node(Node* new_node) {
451 return _new2old_map[new_node->_idx];
452 }
453 #endif
454 };
455
456 #endif // SHARE_VM_OPTO_MATCHER_HPP
|