Mercurial > hg > truffle
comparison src/share/vm/runtime/vframeArray.cpp @ 4693:07bcee8b70a4
Simplify exception debug information and exception handler table creation based on Graal's simplified model of exception handler information (i.e. the dispatch is done in compiled code).
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sat, 25 Feb 2012 00:40:34 +0100 |
parents | a03f3fd16b22 |
children | 1c7c5be93e84 |
comparison
equal
deleted
inserted
replaced
4692:9d48ccb39292 | 4693:07bcee8b70a4 |
---|---|
125 } | 125 } |
126 } | 126 } |
127 | 127 |
128 // Now the expressions off-stack | 128 // Now the expressions off-stack |
129 // Same silliness as above | 129 // Same silliness as above |
130 bool rethrow_exception = vf->scope()->rethrow_exception(); | 130 StackValueCollection *exprs = vf->expressions(); |
131 if (rethrow_exception) { | 131 _expressions = new StackValueCollection(exprs->size()); |
132 // (tw) Make sure there are only null pointers on the stack, because the stack values do not correspond to the GC map at the bytecode at which the exception is rethrown. | 132 for(index = 0; index < exprs->size(); index++) { |
133 // TODO: Fix this! Locals map might be wrong too. | 133 StackValue* value = exprs->at(index); |
134 _expressions = new StackValueCollection(vf->method()->max_stack()); | 134 switch(value->type()) { |
135 assert(Thread::current()->has_pending_exception(), "just checking"); | 135 case T_OBJECT: |
136 for (int i=0; i<vf->method()->max_stack(); ++i) { | 136 assert(!value->obj_is_scalar_replaced(), "object should be reallocated already"); |
137 _expressions->add( new StackValue()); | 137 // preserve object type |
138 } | 138 _expressions->add( new StackValue((intptr_t) (value->get_obj()()), T_OBJECT )); |
139 } else { | 139 break; |
140 StackValueCollection *exprs = vf->expressions(); | 140 case T_CONFLICT: |
141 _expressions = new StackValueCollection(exprs->size()); | 141 // A dead stack element. Will be initialized to null/zero. |
142 for(index = 0; index < exprs->size(); index++) { | 142 // This can occur when the compiler emits a state in which stack |
143 StackValue* value = exprs->at(index); | 143 // elements are known to be dead (because of an imminent exception). |
144 switch(value->type()) { | 144 _expressions->add( new StackValue()); |
145 case T_OBJECT: | 145 break; |
146 assert(!value->obj_is_scalar_replaced(), "object should be reallocated already"); | 146 case T_INT: |
147 // preserve object type | 147 _expressions->add( new StackValue(value->get_int())); |
148 _expressions->add( new StackValue((intptr_t) (value->get_obj()()), T_OBJECT )); | 148 break; |
149 break; | 149 default: |
150 case T_CONFLICT: | 150 ShouldNotReachHere(); |
151 // A dead stack element. Will be initialized to null/zero. | |
152 // This can occur when the compiler emits a state in which stack | |
153 // elements are known to be dead (because of an imminent exception). | |
154 _expressions->add( new StackValue()); | |
155 break; | |
156 case T_INT: | |
157 _expressions->add( new StackValue(value->get_int())); | |
158 break; | |
159 default: | |
160 ShouldNotReachHere(); | |
161 } | |
162 } | 151 } |
163 } | 152 } |
164 } | 153 } |
165 | 154 |
166 int unpack_counter = 0; | 155 int unpack_counter = 0; |