Mercurial > hg > truffle
annotate src/cpu/zero/vm/frame_zero.inline.hpp @ 10287:12f651e29f6b
6843347: Boundary values in some public GC options cause crashes
Summary: Setting some public integer options to specific values causes crashes or undefined GC behavior. This patchset adds the necessary argument checking for these options.
Reviewed-by: jmasa, brutisso
author | tschatzl |
---|---|
date | Wed, 15 May 2013 11:05:09 +0200 |
parents | c566b81b3323 |
children | c54a3122f9c8 |
rev | line source |
---|---|
1010 | 1 /* |
4806
eaa9557116a2
7120448: Fix FP values for compiled frames in frame::describe
bdelsart
parents:
1972
diff
changeset
|
2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. |
1505 | 3 * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. |
1010 | 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 * | |
6 * This code is free software; you can redistribute it and/or modify it | |
7 * under the terms of the GNU General Public License version 2 only, as | |
8 * published by the Free Software Foundation. | |
9 * | |
10 * This code is distributed in the hope that it will be useful, but WITHOUT | |
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
13 * version 2 for more details (a copy is included in the LICENSE file that | |
14 * accompanied this code). | |
15 * | |
16 * You should have received a copy of the GNU General Public License version | |
17 * 2 along with this work; if not, write to the Free Software Foundation, | |
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
19 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1505
diff
changeset
|
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1505
diff
changeset
|
21 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1505
diff
changeset
|
22 * questions. |
1010 | 23 * |
24 */ | |
25 | |
1972 | 26 #ifndef CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP |
27 #define CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP | |
28 | |
1010 | 29 // Constructors |
30 | |
31 inline frame::frame() { | |
1505 | 32 _zeroframe = NULL; |
1010 | 33 _sp = NULL; |
34 _pc = NULL; | |
35 _cb = NULL; | |
36 _deopt_state = unknown; | |
37 } | |
38 | |
6926 | 39 inline address frame::sender_pc() const { ShouldNotCallThis(); } |
40 | |
1505 | 41 inline frame::frame(ZeroFrame* zf, intptr_t* sp) { |
42 _zeroframe = zf; | |
1010 | 43 _sp = sp; |
44 switch (zeroframe()->type()) { | |
45 case ZeroFrame::ENTRY_FRAME: | |
46 _pc = StubRoutines::call_stub_return_pc(); | |
47 _cb = NULL; | |
7599 | 48 _deopt_state = not_deoptimized; |
1010 | 49 break; |
50 | |
51 case ZeroFrame::INTERPRETER_FRAME: | |
52 _pc = NULL; | |
53 _cb = NULL; | |
7599 | 54 _deopt_state = not_deoptimized; |
1010 | 55 break; |
56 | |
7599 | 57 case ZeroFrame::SHARK_FRAME: { |
1010 | 58 _pc = zero_sharkframe()->pc(); |
59 _cb = CodeCache::find_blob_unsafe(pc()); | |
7599 | 60 address original_pc = nmethod::get_deopt_original_pc(this); |
61 if (original_pc != NULL) { | |
62 _pc = original_pc; | |
63 _deopt_state = is_deoptimized; | |
64 } else { | |
65 _deopt_state = not_deoptimized; | |
66 } | |
1010 | 67 break; |
7599 | 68 } |
1010 | 69 case ZeroFrame::FAKE_STUB_FRAME: |
70 _pc = NULL; | |
71 _cb = NULL; | |
7599 | 72 _deopt_state = not_deoptimized; |
1010 | 73 break; |
74 | |
75 default: | |
76 ShouldNotReachHere(); | |
77 } | |
78 } | |
79 | |
80 // Accessors | |
81 | |
82 inline intptr_t* frame::sender_sp() const { | |
1505 | 83 return fp() + 1; |
1010 | 84 } |
85 | |
4806
eaa9557116a2
7120448: Fix FP values for compiled frames in frame::describe
bdelsart
parents:
1972
diff
changeset
|
86 inline intptr_t* frame::real_fp() const { |
eaa9557116a2
7120448: Fix FP values for compiled frames in frame::describe
bdelsart
parents:
1972
diff
changeset
|
87 return fp(); |
eaa9557116a2
7120448: Fix FP values for compiled frames in frame::describe
bdelsart
parents:
1972
diff
changeset
|
88 } |
eaa9557116a2
7120448: Fix FP values for compiled frames in frame::describe
bdelsart
parents:
1972
diff
changeset
|
89 |
1010 | 90 inline intptr_t* frame::link() const { |
91 ShouldNotCallThis(); | |
92 } | |
93 | |
94 #ifdef CC_INTERP | |
95 inline interpreterState frame::get_interpreterState() const { | |
96 return zero_interpreterframe()->interpreter_state(); | |
97 } | |
98 | |
99 inline intptr_t** frame::interpreter_frame_locals_addr() const { | |
100 return &(get_interpreterState()->_locals); | |
101 } | |
102 | |
103 inline intptr_t* frame::interpreter_frame_bcx_addr() const { | |
104 return (intptr_t*) &(get_interpreterState()->_bcp); | |
105 } | |
106 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4806
diff
changeset
|
107 inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const { |
1010 | 108 return &(get_interpreterState()->_constants); |
109 } | |
110 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4806
diff
changeset
|
111 inline Method** frame::interpreter_frame_method_addr() const { |
1010 | 112 return &(get_interpreterState()->_method); |
113 } | |
114 | |
115 inline intptr_t* frame::interpreter_frame_mdx_addr() const { | |
116 return (intptr_t*) &(get_interpreterState()->_mdx); | |
117 } | |
118 | |
119 inline intptr_t* frame::interpreter_frame_tos_address() const { | |
120 return get_interpreterState()->_stack + 1; | |
121 } | |
122 #endif // CC_INTERP | |
123 | |
124 inline int frame::interpreter_frame_monitor_size() { | |
125 return BasicObjectLock::size(); | |
126 } | |
127 | |
128 inline intptr_t* frame::interpreter_frame_expression_stack() const { | |
129 intptr_t* monitor_end = (intptr_t*) interpreter_frame_monitor_end(); | |
130 return monitor_end - 1; | |
131 } | |
132 | |
133 inline jint frame::interpreter_frame_expression_stack_direction() { | |
134 return -1; | |
135 } | |
136 | |
137 // Return a unique id for this frame. The id must have a value where | |
138 // we can distinguish identity and younger/older relationship. NULL | |
139 // represents an invalid (incomparable) frame. | |
140 inline intptr_t* frame::id() const { | |
1505 | 141 return fp(); |
1010 | 142 } |
143 | |
144 inline JavaCallWrapper* frame::entry_frame_call_wrapper() const { | |
145 return zero_entryframe()->call_wrapper(); | |
146 } | |
147 | |
148 inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) { | |
149 ShouldNotCallThis(); | |
150 } | |
151 | |
152 inline oop frame::saved_oop_result(RegisterMap* map) const { | |
153 ShouldNotCallThis(); | |
154 } | |
155 | |
156 inline bool frame::is_older(intptr_t* id) const { | |
157 ShouldNotCallThis(); | |
158 } | |
159 | |
160 inline intptr_t* frame::entry_frame_argument_at(int offset) const { | |
161 ShouldNotCallThis(); | |
162 } | |
163 | |
164 inline intptr_t* frame::unextended_sp() const { | |
165 if (zeroframe()->is_shark_frame()) | |
166 return zero_sharkframe()->unextended_sp(); | |
167 else | |
168 return (intptr_t *) -1; | |
169 } | |
1972 | 170 |
171 #endif // CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP |