1 /*
2 * Copyright (c) 2002, 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 *
23 */
24
25 #include "precompiled.hpp"
26 #include "code/vmreg.inline.hpp"
27 #include "compiler/oopMap.hpp"
28 #include "opto/addnode.hpp"
29 #include "opto/callnode.hpp"
30 #include "opto/compile.hpp"
31 #include "opto/machnode.hpp"
32 #include "opto/matcher.hpp"
33 #include "opto/phase.hpp"
34 #include "opto/regalloc.hpp"
35 #include "opto/rootnode.hpp"
36
37 // The functions in this file builds OopMaps after all scheduling is done.
38 //
39 // OopMaps contain a list of all registers and stack-slots containing oops (so
40 // they can be updated by GC). OopMaps also contain a list of derived-pointer
41 // base-pointer pairs. When the base is moved, the derived pointer moves to
42 // follow it. Finally, any registers holding callee-save values are also
43 // recorded. These might contain oops, but only the caller knows.
44 //
45 // BuildOopMaps implements a simple forward reaching-defs solution. At each
46 // GC point we'll have the reaching-def Nodes. If the reaching Nodes are
47 // typed as pointers (no offset), then they are oops. Pointers+offsets are
|
1 /*
2 * Copyright (c) 2002, 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 "code/vmreg.inline.hpp"
27 #include "compiler/oopMap.hpp"
28 #include "memory/resourceArea.hpp"
29 #include "opto/addnode.hpp"
30 #include "opto/callnode.hpp"
31 #include "opto/compile.hpp"
32 #include "opto/machnode.hpp"
33 #include "opto/matcher.hpp"
34 #include "opto/phase.hpp"
35 #include "opto/regalloc.hpp"
36 #include "opto/rootnode.hpp"
37
38 // The functions in this file builds OopMaps after all scheduling is done.
39 //
40 // OopMaps contain a list of all registers and stack-slots containing oops (so
41 // they can be updated by GC). OopMaps also contain a list of derived-pointer
42 // base-pointer pairs. When the base is moved, the derived pointer moves to
43 // follow it. Finally, any registers holding callee-save values are also
44 // recorded. These might contain oops, but only the caller knows.
45 //
46 // BuildOopMaps implements a simple forward reaching-defs solution. At each
47 // GC point we'll have the reaching-def Nodes. If the reaching Nodes are
48 // typed as pointers (no offset), then they are oops. Pointers+offsets are
|