1.1 --- a/src/share/vm/code/debugInfoRec.cpp Fri Aug 31 16:39:35 2012 -0700 1.2 +++ b/src/share/vm/code/debugInfoRec.cpp Sat Sep 01 13:25:18 2012 -0400 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. 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 @@ -305,7 +305,7 @@ 1.11 stream()->write_int(sender_stream_offset); 1.12 1.13 // serialize scope 1.14 - jobject method_enc = (method == NULL)? NULL: method->constant_encoding(); 1.15 + Metadata* method_enc = (method == NULL)? NULL: method->constant_encoding(); 1.16 stream()->write_int(oop_recorder()->find_index(method_enc)); 1.17 stream()->write_bci(bci); 1.18 assert(method == NULL || 1.19 @@ -378,26 +378,36 @@ 1.20 } 1.21 } 1.22 1.23 +#ifdef ASSERT 1.24 +bool DebugInformationRecorder::recorders_frozen() { 1.25 + return _oop_recorder->is_complete() || _oop_recorder->is_complete(); 1.26 +} 1.27 + 1.28 +void DebugInformationRecorder::mark_recorders_frozen() { 1.29 + _oop_recorder->freeze(); 1.30 +} 1.31 +#endif // PRODUCT 1.32 + 1.33 DebugToken* DebugInformationRecorder::create_scope_values(GrowableArray<ScopeValue*>* values) { 1.34 - assert(!_oop_recorder->is_complete(), "not frozen yet"); 1.35 + assert(!recorders_frozen(), "not frozen yet"); 1.36 return (DebugToken*) (intptr_t) serialize_scope_values(values); 1.37 } 1.38 1.39 1.40 DebugToken* DebugInformationRecorder::create_monitor_values(GrowableArray<MonitorValue*>* monitors) { 1.41 - assert(!_oop_recorder->is_complete(), "not frozen yet"); 1.42 + assert(!recorders_frozen(), "not frozen yet"); 1.43 return (DebugToken*) (intptr_t) serialize_monitor_values(monitors); 1.44 } 1.45 1.46 1.47 int DebugInformationRecorder::data_size() { 1.48 - debug_only(_oop_recorder->oop_size()); // mark it "frozen" for asserts 1.49 + debug_only(mark_recorders_frozen()); // mark it "frozen" for asserts 1.50 return _stream->position(); 1.51 } 1.52 1.53 1.54 int DebugInformationRecorder::pcs_size() { 1.55 - debug_only(_oop_recorder->oop_size()); // mark it "frozen" for asserts 1.56 + debug_only(mark_recorders_frozen()); // mark it "frozen" for asserts 1.57 if (last_pc()->pc_offset() != PcDesc::upper_offset_limit) 1.58 add_new_pc_offset(PcDesc::upper_offset_limit); 1.59 return _pcs_length * sizeof(PcDesc);