diff -r caf5eb7dd4a7 -r 882756847a04 hotspot/src/share/vm/code/debugInfoRec.cpp --- a/hotspot/src/share/vm/code/debugInfoRec.cpp Fri Aug 31 16:39:35 2012 -0700 +++ b/hotspot/src/share/vm/code/debugInfoRec.cpp Sat Sep 01 13:25:18 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -305,7 +305,7 @@ stream()->write_int(sender_stream_offset); // serialize scope - jobject method_enc = (method == NULL)? NULL: method->constant_encoding(); + Metadata* method_enc = (method == NULL)? NULL: method->constant_encoding(); stream()->write_int(oop_recorder()->find_index(method_enc)); stream()->write_bci(bci); assert(method == NULL || @@ -378,26 +378,36 @@ } } +#ifdef ASSERT +bool DebugInformationRecorder::recorders_frozen() { + return _oop_recorder->is_complete() || _oop_recorder->is_complete(); +} + +void DebugInformationRecorder::mark_recorders_frozen() { + _oop_recorder->freeze(); +} +#endif // PRODUCT + DebugToken* DebugInformationRecorder::create_scope_values(GrowableArray* values) { - assert(!_oop_recorder->is_complete(), "not frozen yet"); + assert(!recorders_frozen(), "not frozen yet"); return (DebugToken*) (intptr_t) serialize_scope_values(values); } DebugToken* DebugInformationRecorder::create_monitor_values(GrowableArray* monitors) { - assert(!_oop_recorder->is_complete(), "not frozen yet"); + assert(!recorders_frozen(), "not frozen yet"); return (DebugToken*) (intptr_t) serialize_monitor_values(monitors); } int DebugInformationRecorder::data_size() { - debug_only(_oop_recorder->oop_size()); // mark it "frozen" for asserts + debug_only(mark_recorders_frozen()); // mark it "frozen" for asserts return _stream->position(); } int DebugInformationRecorder::pcs_size() { - debug_only(_oop_recorder->oop_size()); // mark it "frozen" for asserts + debug_only(mark_recorders_frozen()); // mark it "frozen" for asserts if (last_pc()->pc_offset() != PcDesc::upper_offset_limit) add_new_pc_offset(PcDesc::upper_offset_limit); return _pcs_length * sizeof(PcDesc);