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 LoopTree;
26 class MachCallNode;
27 class MachSafePointNode;
28 class Matcher;
29 class PhaseCFG;
30 class PhaseLive;
31 class PhaseRegAlloc;
32 class PhaseChaitin;
33
34 #define OPTO_DEBUG_SPLIT_FREQ BLOCK_FREQUENCY(0.001)
35 #define OPTO_LRG_HIGH_FREQ BLOCK_FREQUENCY(0.25)
36
37 //------------------------------LRG--------------------------------------------
38 // Live-RanGe structure.
39 class LRG : public ResourceObj {
40 public:
41 enum { SPILL_REG=29999 }; // Register number of a spilled LRG
42
43 double _cost; // 2 for loads/1 for stores times block freq
44 double _area; // Sum of all simultaneously live values
502 void dump_lrg( uint lidx ) const;
503 void dump_bb( uint pre_order ) const;
504
505 // Verify that base pointers and derived pointers are still sane
506 void verify_base_ptrs( ResourceArea *a ) const;
507
508 void verify( ResourceArea *a, bool verify_ifg = false ) const;
509
510 void dump_for_spill_split_recycle() const;
511
512 public:
513 void dump_frame() const;
514 char *dump_register( const Node *n, char *buf ) const;
515 private:
516 static void print_chaitin_statistics();
517 #endif
518 friend class PhaseCoalesce;
519 friend class PhaseAggressiveCoalesce;
520 friend class PhaseConservativeCoalesce;
521 };
|
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_CHAITIN_HPP
26 #define SHARE_VM_OPTO_CHAITIN_HPP
27
28 #include "code/vmreg.hpp"
29 #include "libadt/port.hpp"
30 #include "memory/resourceArea.hpp"
31 #include "opto/connode.hpp"
32 #include "opto/live.hpp"
33 #include "opto/matcher.hpp"
34 #include "opto/phase.hpp"
35 #include "opto/regalloc.hpp"
36 #include "opto/regmask.hpp"
37
38 class LoopTree;
39 class MachCallNode;
40 class MachSafePointNode;
41 class Matcher;
42 class PhaseCFG;
43 class PhaseLive;
44 class PhaseRegAlloc;
45 class PhaseChaitin;
46
47 #define OPTO_DEBUG_SPLIT_FREQ BLOCK_FREQUENCY(0.001)
48 #define OPTO_LRG_HIGH_FREQ BLOCK_FREQUENCY(0.25)
49
50 //------------------------------LRG--------------------------------------------
51 // Live-RanGe structure.
52 class LRG : public ResourceObj {
53 public:
54 enum { SPILL_REG=29999 }; // Register number of a spilled LRG
55
56 double _cost; // 2 for loads/1 for stores times block freq
57 double _area; // Sum of all simultaneously live values
515 void dump_lrg( uint lidx ) const;
516 void dump_bb( uint pre_order ) const;
517
518 // Verify that base pointers and derived pointers are still sane
519 void verify_base_ptrs( ResourceArea *a ) const;
520
521 void verify( ResourceArea *a, bool verify_ifg = false ) const;
522
523 void dump_for_spill_split_recycle() const;
524
525 public:
526 void dump_frame() const;
527 char *dump_register( const Node *n, char *buf ) const;
528 private:
529 static void print_chaitin_statistics();
530 #endif
531 friend class PhaseCoalesce;
532 friend class PhaseAggressiveCoalesce;
533 friend class PhaseConservativeCoalesce;
534 };
535
536 #endif // SHARE_VM_OPTO_CHAITIN_HPP
|