Mercurial > hg > graal-compiler
comparison src/share/vm/code/debugInfoRec.cpp @ 6948:e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 12 Nov 2012 23:14:12 +0100 |
parents | 957c266d8bc5 da91efe96a93 |
children | b6a8f2d23057 |
comparison
equal
deleted
inserted
replaced
6711:ae13cc658b80 | 6948:e522a00b91aa |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
306 | 306 |
307 // serialize sender stream offest | 307 // serialize sender stream offest |
308 stream()->write_int(sender_stream_offset); | 308 stream()->write_int(sender_stream_offset); |
309 | 309 |
310 // serialize scope | 310 // serialize scope |
311 jobject method_enc; | 311 Metadata* method_enc; |
312 if (method != NULL) { | 312 if (method != NULL) { |
313 method_enc = method->constant_encoding(); | 313 method_enc = method->constant_encoding(); |
314 } else if (methodH.not_null()) { | 314 } else if (methodH.not_null()) { |
315 method_enc = JNIHandles::make_local(Thread::current(), methodH()); | 315 method_enc = methodH(); |
316 } else { | 316 } else { |
317 method_enc = NULL; | 317 method_enc = NULL; |
318 } | 318 } |
319 stream()->write_int(oop_recorder()->find_index(method_enc)); | 319 stream()->write_int(oop_recorder()->find_index(method_enc)); |
320 stream()->write_bci(bci); | 320 stream()->write_bci(bci); |
386 if (is_safepoint) { | 386 if (is_safepoint) { |
387 _prev_safepoint_pc = pc_offset; | 387 _prev_safepoint_pc = pc_offset; |
388 } | 388 } |
389 } | 389 } |
390 | 390 |
391 #ifdef ASSERT | |
392 bool DebugInformationRecorder::recorders_frozen() { | |
393 return _oop_recorder->is_complete() || _oop_recorder->is_complete(); | |
394 } | |
395 | |
396 void DebugInformationRecorder::mark_recorders_frozen() { | |
397 _oop_recorder->freeze(); | |
398 } | |
399 #endif // PRODUCT | |
400 | |
391 DebugToken* DebugInformationRecorder::create_scope_values(GrowableArray<ScopeValue*>* values) { | 401 DebugToken* DebugInformationRecorder::create_scope_values(GrowableArray<ScopeValue*>* values) { |
392 assert(!_oop_recorder->is_complete(), "not frozen yet"); | 402 assert(!recorders_frozen(), "not frozen yet"); |
393 return (DebugToken*) (intptr_t) serialize_scope_values(values); | 403 return (DebugToken*) (intptr_t) serialize_scope_values(values); |
394 } | 404 } |
395 | 405 |
396 | 406 |
397 DebugToken* DebugInformationRecorder::create_monitor_values(GrowableArray<MonitorValue*>* monitors) { | 407 DebugToken* DebugInformationRecorder::create_monitor_values(GrowableArray<MonitorValue*>* monitors) { |
398 assert(!_oop_recorder->is_complete(), "not frozen yet"); | 408 assert(!recorders_frozen(), "not frozen yet"); |
399 return (DebugToken*) (intptr_t) serialize_monitor_values(monitors); | 409 return (DebugToken*) (intptr_t) serialize_monitor_values(monitors); |
400 } | 410 } |
401 | 411 |
402 | 412 |
403 int DebugInformationRecorder::data_size() { | 413 int DebugInformationRecorder::data_size() { |
404 debug_only(_oop_recorder->oop_size()); // mark it "frozen" for asserts | 414 debug_only(mark_recorders_frozen()); // mark it "frozen" for asserts |
405 return _stream->position(); | 415 return _stream->position(); |
406 } | 416 } |
407 | 417 |
408 | 418 |
409 int DebugInformationRecorder::pcs_size() { | 419 int DebugInformationRecorder::pcs_size() { |
410 debug_only(_oop_recorder->oop_size()); // mark it "frozen" for asserts | 420 debug_only(mark_recorders_frozen()); // mark it "frozen" for asserts |
411 if (last_pc()->pc_offset() != PcDesc::upper_offset_limit) | 421 if (last_pc()->pc_offset() != PcDesc::upper_offset_limit) |
412 add_new_pc_offset(PcDesc::upper_offset_limit); | 422 add_new_pc_offset(PcDesc::upper_offset_limit); |
413 return _pcs_length * sizeof(PcDesc); | 423 return _pcs_length * sizeof(PcDesc); |
414 } | 424 } |
415 | 425 |