1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/vm/shark/sharkStateScanner.hpp Wed Aug 11 05:51:21 2010 -0700 1.3 @@ -0,0 +1,75 @@ 1.4 +/* 1.5 + * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright 2008, 2009 Red Hat, Inc. 1.7 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 + * 1.9 + * This code is free software; you can redistribute it and/or modify it 1.10 + * under the terms of the GNU General Public License version 2 only, as 1.11 + * published by the Free Software Foundation. 1.12 + * 1.13 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.14 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.15 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.16 + * version 2 for more details (a copy is included in the LICENSE file that 1.17 + * accompanied this code). 1.18 + * 1.19 + * You should have received a copy of the GNU General Public License version 1.20 + * 2 along with this work; if not, write to the Free Software Foundation, 1.21 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.22 + * 1.23 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.24 + * or visit www.oracle.com if you need additional information or have any 1.25 + * questions. 1.26 + * 1.27 + */ 1.28 + 1.29 +class SharkState; 1.30 + 1.31 +class SharkStateScanner : public SharkTargetInvariants { 1.32 + protected: 1.33 + SharkStateScanner(SharkFunction* function) 1.34 + : SharkTargetInvariants(function), _stack(function->stack()) {} 1.35 + 1.36 + private: 1.37 + SharkStack* _stack; 1.38 + 1.39 + protected: 1.40 + SharkStack* stack() const { 1.41 + return _stack; 1.42 + } 1.43 + 1.44 + // Scan the frame 1.45 + public: 1.46 + void scan(SharkState* state); 1.47 + 1.48 + // Callbacks 1.49 + // Note that the offsets supplied to the various process_* callbacks 1.50 + // are specified in wordSize words from the frame's unextended_sp. 1.51 + protected: 1.52 + virtual void start_frame() {} 1.53 + 1.54 + virtual void start_stack(int stack_depth) {} 1.55 + virtual void process_stack_slot(int index, SharkValue** value, int offset) {} 1.56 + virtual void end_stack() {} 1.57 + 1.58 + virtual void start_monitors(int num_monitors) {} 1.59 + virtual void process_monitor(int index, int box_offset, int obj_offset) {} 1.60 + virtual void end_monitors() {} 1.61 + 1.62 + virtual void start_frame_header() {} 1.63 + virtual void process_oop_tmp_slot(llvm::Value** value, int offset) {} 1.64 + virtual void process_method_slot(llvm::Value** value, int offset) {} 1.65 + virtual void process_pc_slot(int offset) {} 1.66 + virtual void end_frame_header() {} 1.67 + 1.68 + virtual void start_locals() {} 1.69 + virtual void process_local_slot(int index, SharkValue** value, int offset) {} 1.70 + virtual void end_locals() {} 1.71 + 1.72 + virtual void end_frame() {} 1.73 + 1.74 + // Integrity checks 1.75 + private: 1.76 + void stack_integrity_checks(SharkState* state) PRODUCT_RETURN; 1.77 + void locals_integrity_checks(SharkState* state) PRODUCT_RETURN; 1.78 +};