Thu, 07 Oct 2010 21:40:55 -0700
6980792: Crash "exception happened outside interpreter, nmethods and vtable stubs (1)"
Reviewed-by: kvn
duke@435 | 1 | /* |
trims@1907 | 2 | * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. |
duke@435 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | * |
duke@435 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | * published by the Free Software Foundation. |
duke@435 | 8 | * |
duke@435 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | * accompanied this code). |
duke@435 | 14 | * |
duke@435 | 15 | * You should have received a copy of the GNU General Public License version |
duke@435 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | * |
trims@1907 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 20 | * or visit www.oracle.com if you need additional information or have any |
trims@1907 | 21 | * questions. |
duke@435 | 22 | * |
duke@435 | 23 | */ |
duke@435 | 24 | |
duke@435 | 25 | class Block; |
duke@435 | 26 | class LRG_List; |
duke@435 | 27 | class PhaseCFG; |
duke@435 | 28 | class VectorSet; |
duke@435 | 29 | class IndexSet; |
duke@435 | 30 | |
duke@435 | 31 | //------------------------------PhaseLive-------------------------------------- |
duke@435 | 32 | // Compute live-in/live-out |
duke@435 | 33 | class PhaseLive : public Phase { |
duke@435 | 34 | // Array of Sets of values live at the start of a block. |
duke@435 | 35 | // Indexed by block pre-order number. |
duke@435 | 36 | IndexSet *_live; |
duke@435 | 37 | |
duke@435 | 38 | // Array of Sets of values defined locally in the block |
duke@435 | 39 | // Indexed by block pre-order number. |
duke@435 | 40 | IndexSet *_defs; |
duke@435 | 41 | |
duke@435 | 42 | // Array of delta-set pointers, indexed by block pre-order number |
duke@435 | 43 | IndexSet **_deltas; |
duke@435 | 44 | IndexSet *_free_IndexSet; // Free list of same |
duke@435 | 45 | |
duke@435 | 46 | Block_List *_worklist; // Worklist for iterative solution |
duke@435 | 47 | |
duke@435 | 48 | const PhaseCFG &_cfg; // Basic blocks |
duke@435 | 49 | LRG_List &_names; // Mapping from Nodes to live ranges |
duke@435 | 50 | uint _maxlrg; // Largest live-range number |
duke@435 | 51 | Arena *_arena; |
duke@435 | 52 | |
duke@435 | 53 | IndexSet *getset( Block *p ); |
duke@435 | 54 | IndexSet *getfreeset( ); |
duke@435 | 55 | void freeset( const Block *p ); |
duke@435 | 56 | void add_liveout( Block *p, uint r, VectorSet &first_pass ); |
duke@435 | 57 | void add_liveout( Block *p, IndexSet *lo, VectorSet &first_pass ); |
duke@435 | 58 | |
duke@435 | 59 | public: |
duke@435 | 60 | PhaseLive( const PhaseCFG &cfg, LRG_List &names, Arena *arena ); |
duke@435 | 61 | ~PhaseLive() {} |
duke@435 | 62 | // Compute liveness info |
duke@435 | 63 | void compute(uint maxlrg); |
duke@435 | 64 | // Reset arena storage |
duke@435 | 65 | void reset() { _live = NULL; } |
duke@435 | 66 | |
duke@435 | 67 | // Return the live-out set for this block |
duke@435 | 68 | IndexSet *live( const Block * b ) { return &_live[b->_pre_order-1]; } |
duke@435 | 69 | |
duke@435 | 70 | #ifndef PRODUCT |
duke@435 | 71 | void dump( const Block *b ) const; |
duke@435 | 72 | void stats(uint iters) const; |
duke@435 | 73 | #endif |
duke@435 | 74 | }; |