1 /*
2 * Copyright (c) 2012, 2015, 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 *
61
62 int level() const { return _level; }
63 void set_level(int level) { _level = level; }
64
65 const Ticks start() const { return _start; }
66 void set_start(const Ticks& time) { _start = time; }
67
68 const Ticks end() const { return _end; }
69 void set_end(const Ticks& time) { _end = time; }
70
71 PhaseType type() const { return _type; }
72 void set_type(PhaseType type) { _type = type; }
73
74 void accept(PhaseVisitor* visitor) {
75 visitor->visit(this);
76 }
77 };
78
79 class PhasesStack {
80 public:
81 // Set to 5, since Reference processing needs it.
82 static const int PHASE_LEVELS = 5;
83
84 private:
85 int _phase_indices[PHASE_LEVELS];
86 int _next_phase_level;
87
88 public:
89 PhasesStack() { clear(); }
90 void clear();
91
92 void push(int phase_index);
93 int pop();
94 int count() const;
95 };
96
97 class TimePartitions {
98 static const int INITIAL_CAPACITY = 10;
99
100 GrowableArray<GCPhase>* _phases;
101 PhasesStack _active_phases;
102
|
1 /*
2 * Copyright (c) 2012, 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 *
61
62 int level() const { return _level; }
63 void set_level(int level) { _level = level; }
64
65 const Ticks start() const { return _start; }
66 void set_start(const Ticks& time) { _start = time; }
67
68 const Ticks end() const { return _end; }
69 void set_end(const Ticks& time) { _end = time; }
70
71 PhaseType type() const { return _type; }
72 void set_type(PhaseType type) { _type = type; }
73
74 void accept(PhaseVisitor* visitor) {
75 visitor->visit(this);
76 }
77 };
78
79 class PhasesStack {
80 public:
81 // Set to 6, since Reference processing needs it.
82 static const int PHASE_LEVELS = 6;
83
84 private:
85 int _phase_indices[PHASE_LEVELS];
86 int _next_phase_level;
87
88 public:
89 PhasesStack() { clear(); }
90 void clear();
91
92 void push(int phase_index);
93 int pop();
94 int count() const;
95 };
96
97 class TimePartitions {
98 static const int INITIAL_CAPACITY = 10;
99
100 GrowableArray<GCPhase>* _phases;
101 PhasesStack _active_phases;
102
|