1 /*
2 * Copyright (c) 1998, 2014, 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 *
1827 node_flags_set = true;
1828 }
1829 }
1830
1831 if ( node_flags_set ) {
1832 fprintf(fp,"); ");
1833 }
1834
1835 fprintf(fp,"}\n");
1836
1837 // size_of, used by base class's clone to obtain the correct size.
1838 fprintf(fp," virtual uint size_of() const {");
1839 fprintf(fp, " return sizeof(%sNode);", instr->_ident);
1840 fprintf(fp, " }\n");
1841
1842 // Virtual methods which are only generated to override base class
1843 if( instr->expands() || instr->needs_projections() ||
1844 instr->has_temps() ||
1845 instr->is_mach_constant() ||
1846 instr->needs_constant_base() ||
1847 instr->_matrule != NULL &&
1848 instr->num_opnds() != instr->num_unique_opnds() ) {
1849 fprintf(fp," virtual MachNode *Expand(State *state, Node_List &proj_list, Node* mem);\n");
1850 }
1851
1852 if (instr->is_pinned(_globalNames)) {
1853 fprintf(fp," virtual bool pinned() const { return ");
1854 if (instr->is_parm(_globalNames)) {
1855 fprintf(fp,"_in[0]->pinned();");
1856 } else {
1857 fprintf(fp,"true;");
1858 }
1859 fprintf(fp," }\n");
1860 }
1861 if (instr->is_projection(_globalNames)) {
1862 fprintf(fp," virtual const Node *is_block_proj() const { return this; }\n");
1863 }
1864 if ( instr->num_post_match_opnds() != 0
1865 || instr->is_chain_of_constant(_globalNames) ) {
1866 fprintf(fp," friend MachNode *State::MachNodeGenerator(int opcode);\n");
1867 }
1868 if ( instr->rematerialize(_globalNames, get_registers()) ) {
|
1 /*
2 * Copyright (c) 1998, 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 *
1827 node_flags_set = true;
1828 }
1829 }
1830
1831 if ( node_flags_set ) {
1832 fprintf(fp,"); ");
1833 }
1834
1835 fprintf(fp,"}\n");
1836
1837 // size_of, used by base class's clone to obtain the correct size.
1838 fprintf(fp," virtual uint size_of() const {");
1839 fprintf(fp, " return sizeof(%sNode);", instr->_ident);
1840 fprintf(fp, " }\n");
1841
1842 // Virtual methods which are only generated to override base class
1843 if( instr->expands() || instr->needs_projections() ||
1844 instr->has_temps() ||
1845 instr->is_mach_constant() ||
1846 instr->needs_constant_base() ||
1847 (instr->_matrule != NULL &&
1848 instr->num_opnds() != instr->num_unique_opnds()) ) {
1849 fprintf(fp," virtual MachNode *Expand(State *state, Node_List &proj_list, Node* mem);\n");
1850 }
1851
1852 if (instr->is_pinned(_globalNames)) {
1853 fprintf(fp," virtual bool pinned() const { return ");
1854 if (instr->is_parm(_globalNames)) {
1855 fprintf(fp,"_in[0]->pinned();");
1856 } else {
1857 fprintf(fp,"true;");
1858 }
1859 fprintf(fp," }\n");
1860 }
1861 if (instr->is_projection(_globalNames)) {
1862 fprintf(fp," virtual const Node *is_block_proj() const { return this; }\n");
1863 }
1864 if ( instr->num_post_match_opnds() != 0
1865 || instr->is_chain_of_constant(_globalNames) ) {
1866 fprintf(fp," friend MachNode *State::MachNodeGenerator(int opcode);\n");
1867 }
1868 if ( instr->rematerialize(_globalNames, get_registers()) ) {
|