/* * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
class MethodLiveness : public ArenaObj { public: // The BasicBlock class is used to represent a basic block in the // liveness analysis. class BasicBlock : public ArenaObj { private: // This class is only used by the MethodLiveness class. friendclass MethodLiveness;
// The analyzer which created this basic block.
MethodLiveness* _analyzer;
// The range of this basic block is [start_bci,limit_bci) int _start_bci; int _limit_bci;
// The liveness at the start of the block;
ArenaBitMap _entry;
// The summarized liveness effects of our direct successors reached // by normal control flow
ArenaBitMap _normal_exit;
// The summarized liveness effects of our direct successors reached // by exceptional control flow
ArenaBitMap _exception_exit;
// These members hold the results of the last call to // compute_gen_kill_range(). _gen is the set of locals // used before they are defined in the range. _kill is the // set of locals defined before they are used.
ArenaBitMap _gen;
ArenaBitMap _kill; int _last_bci;
// A list of all blocks which could come directly before this one // in normal (non-exceptional) control flow. We propagate liveness // information to these blocks.
GrowableArray<BasicBlock*>* _normal_predecessors;
// A list of all blocks which could come directly before this one // in exceptional control flow.
GrowableArray<BasicBlock*>* _exception_predecessors;
// The following fields are used to manage a work list used in the // dataflow.
BasicBlock *_next; bool _on_work_list;
// Our successors call this method to merge liveness information into // our _normal_exit member. bool merge_normal(const BitMap& other);
// Our successors call this method to merge liveness information into // our _exception_exit member. bool merge_exception(const BitMap& other);
// This helper routine is used to help compute the gen/kill pair for // the block. It is also used to answer queries. void compute_gen_kill_range(ciBytecodeStream *bytes);
// Compute the gen/kill effect of a single instruction. void compute_gen_kill_single(ciBytecodeStream *instruction);
// Add a basic block to our list of normal predecessors. void add_normal_predecessor(BasicBlock *pred) {
_normal_predecessors->append_if_missing(pred);
}
// Add a basic block to our list of exceptional predecessors void add_exception_predecessor(BasicBlock *pred) {
_exception_predecessors->append_if_missing(pred);
}
// Split the basic block at splitBci. This basic block // becomes the second half. The first half is newly created.
BasicBlock *split(int splitBci);
// -- Dataflow.
void compute_gen_kill(ciMethod* method);
// Propagate changes from this basic block void propagate(MethodLiveness *ml);
// -- Query.
MethodLivenessResult get_liveness_at(ciMethod* method, int bci);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.