1 /*
2 * Copyright (c) 2003, 2012, 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_CLASSFILE_STACKMAPTABLE_HPP
26 #define SHARE_VM_CLASSFILE_STACKMAPTABLE_HPP
27
28 #include "classfile/stackMapFrame.hpp"
29 #include "classfile/verifier.hpp"
30 #include "memory/allocation.hpp"
31 #include "oops/constantPool.hpp"
32 #include "oops/method.hpp"
33 #include "utilities/globalDefinitions.hpp"
34 #ifdef TARGET_ARCH_x86
35 # include "bytes_x86.hpp"
36 #endif
37 #ifdef TARGET_ARCH_sparc
38 # include "bytes_sparc.hpp"
39 #endif
40 #ifdef TARGET_ARCH_zero
41 # include "bytes_zero.hpp"
42 #endif
43 #ifdef TARGET_ARCH_arm
44 # include "bytes_arm.hpp"
45 #endif
46 #ifdef TARGET_ARCH_ppc
47 # include "bytes_ppc.hpp"
48 #endif
49
50 class StackMapReader;
51
52 // StackMapTable class is the StackMap table used by type checker
53 class StackMapTable : public StackObj {
54 private:
55 // Logically, the _frame_count (as well as many fields in the StackFrame)
56 // should be a u2, but if we defined the variable as that type it will
57 // be difficult to detect/recover from overflow or underflow conditions.
58 // Widening the type and making it signed will help detect these.
59 int32_t _code_length;
60 int32_t _frame_count; // Stackmap frame count
61 StackMapFrame** _frame_array;
62
63 public:
64 StackMapTable(StackMapReader* reader, StackMapFrame* init_frame,
65 u2 max_locals, u2 max_stack,
66 char* code_data, int code_len, TRAPS);
67
68 inline int32_t get_frame_count() const { return _frame_count; }
|
1 /*
2 * Copyright (c) 2003, 2014, 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_CLASSFILE_STACKMAPTABLE_HPP
26 #define SHARE_VM_CLASSFILE_STACKMAPTABLE_HPP
27
28 #include "classfile/stackMapFrame.hpp"
29 #include "classfile/verifier.hpp"
30 #include "memory/allocation.hpp"
31 #include "oops/constantPool.hpp"
32 #include "oops/method.hpp"
33 #include "utilities/bytes.hpp"
34 #include "utilities/globalDefinitions.hpp"
35
36 class StackMapReader;
37
38 // StackMapTable class is the StackMap table used by type checker
39 class StackMapTable : public StackObj {
40 private:
41 // Logically, the _frame_count (as well as many fields in the StackFrame)
42 // should be a u2, but if we defined the variable as that type it will
43 // be difficult to detect/recover from overflow or underflow conditions.
44 // Widening the type and making it signed will help detect these.
45 int32_t _code_length;
46 int32_t _frame_count; // Stackmap frame count
47 StackMapFrame** _frame_array;
48
49 public:
50 StackMapTable(StackMapReader* reader, StackMapFrame* init_frame,
51 u2 max_locals, u2 max_stack,
52 char* code_data, int code_len, TRAPS);
53
54 inline int32_t get_frame_count() const { return _frame_count; }
|