Mon, 23 Aug 2010 09:09:36 -0700
6896381: CTW fails share/vm/ci/bcEscapeAnalyzer.cpp:99, assert(_stack_height < _max_stack,"stack overflow")
Summary: Check constant Tag type instead of calling get_constant().
Reviewed-by: never
src/share/vm/ci/bcEscapeAnalyzer.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/ci/bcEscapeAnalyzer.cpp Fri Aug 20 23:40:30 2010 -0700 1.2 +++ b/src/share/vm/ci/bcEscapeAnalyzer.cpp Mon Aug 23 09:09:36 2010 -0700 1.3 @@ -92,11 +92,11 @@ 1.4 empty_map.clear(); 1.5 } 1.6 1.7 - ArgumentMap raw_pop() { assert(_stack_height > 0, "stack underflow"); return _stack[--_stack_height]; } 1.8 + ArgumentMap raw_pop() { guarantee(_stack_height > 0, "stack underflow"); return _stack[--_stack_height]; } 1.9 ArgumentMap apop() { return raw_pop(); } 1.10 void spop() { raw_pop(); } 1.11 void lpop() { spop(); spop(); } 1.12 - void raw_push(ArgumentMap i) { assert(_stack_height < _max_stack, "stack overflow"); _stack[_stack_height++] = i; } 1.13 + void raw_push(ArgumentMap i) { guarantee(_stack_height < _max_stack, "stack overflow"); _stack[_stack_height++] = i; } 1.14 void apush(ArgumentMap i) { raw_push(i); } 1.15 void spush() { raw_push(empty_map); } 1.16 void lpush() { spush(); spush(); } 1.17 @@ -365,12 +365,19 @@ 1.18 case Bytecodes::_ldc: 1.19 case Bytecodes::_ldc_w: 1.20 case Bytecodes::_ldc2_w: 1.21 - if (type2size[s.get_constant().basic_type()] == 1) { 1.22 + { 1.23 + // Avoid calling get_constant() which will try to allocate 1.24 + // unloaded constant. We need only constant's type. 1.25 + int index = s.get_constant_pool_index(); 1.26 + constantTag tag = s.get_constant_pool_tag(index); 1.27 + if (tag.is_long() || tag.is_double()) { 1.28 + // Only longs and doubles use 2 stack slots. 1.29 + state.lpush(); 1.30 + } else { 1.31 state.spush(); 1.32 - } else { 1.33 - state.lpush(); 1.34 } 1.35 break; 1.36 + } 1.37 case Bytecodes::_aload: 1.38 state.apush(state._vars[s.get_index()]); 1.39 break;