comparison src/share/vm/utilities/xmlstream.cpp @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents d2a62e0f25eb
children 78bbf4d43a14
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2002, 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.
24 24
25 #include "precompiled.hpp" 25 #include "precompiled.hpp"
26 #include "code/nmethod.hpp" 26 #include "code/nmethod.hpp"
27 #include "memory/allocation.hpp" 27 #include "memory/allocation.hpp"
28 #include "memory/allocation.inline.hpp" 28 #include "memory/allocation.inline.hpp"
29 #include "oops/methodDataOop.hpp" 29 #include "oops/methodData.hpp"
30 #include "oops/methodOop.hpp" 30 #include "oops/method.hpp"
31 #include "oops/oop.inline.hpp" 31 #include "oops/oop.inline.hpp"
32 #include "runtime/deoptimization.hpp" 32 #include "runtime/deoptimization.hpp"
33 #include "runtime/vmThread.hpp" 33 #include "runtime/vmThread.hpp"
34 #include "utilities/xmlstream.hpp" 34 #include "utilities/xmlstream.hpp"
35 35
377 int bec = method->backedge_count(); 377 int bec = method->backedge_count();
378 if (bec != 0) print(" backedge_count='%d'", bec); 378 if (bec != 0) print(" backedge_count='%d'", bec);
379 print(" iicount='%d'", method->interpreter_invocation_count()); 379 print(" iicount='%d'", method->interpreter_invocation_count());
380 int throwouts = method->interpreter_throwout_count(); 380 int throwouts = method->interpreter_throwout_count();
381 if (throwouts != 0) print(" throwouts='%d'", throwouts); 381 if (throwouts != 0) print(" throwouts='%d'", throwouts);
382 methodDataOop mdo = method->method_data(); 382 MethodData* mdo = method->method_data();
383 if (mdo != NULL) { 383 if (mdo != NULL) {
384 uint cnt; 384 uint cnt;
385 cnt = mdo->decompile_count(); 385 cnt = mdo->decompile_count();
386 if (cnt != 0) print(" decompiles='%d'", cnt); 386 if (cnt != 0) print(" decompiles='%d'", cnt);
387 for (uint reason = 0; reason < mdo->trap_reason_limit(); reason++) { 387 for (uint reason = 0; reason < mdo->trap_reason_limit(); reason++) {
397 397
398 void xmlStream::method_text(methodHandle method) { 398 void xmlStream::method_text(methodHandle method) {
399 assert_if_no_error(inside_attrs(), "printing attributes"); 399 assert_if_no_error(inside_attrs(), "printing attributes");
400 if (method.is_null()) return; 400 if (method.is_null()) return;
401 //method->print_short_name(text()); 401 //method->print_short_name(text());
402 method->method_holder()->klass_part()->name()->print_symbol_on(text()); 402 method->method_holder()->name()->print_symbol_on(text());
403 print_raw(" "); // " " is easier for tools to parse than "::" 403 print_raw(" "); // " " is easier for tools to parse than "::"
404 method->name()->print_symbol_on(text()); 404 method->name()->print_symbol_on(text());
405 print_raw(" "); // separator 405 print_raw(" "); // separator
406 method->signature()->print_symbol_on(text()); 406 method->signature()->print_symbol_on(text());
407 } 407 }
440 name->print_symbol_on(text()); 440 name->print_symbol_on(text());
441 } 441 }
442 442
443 void xmlStream::object(const char* attr, Handle x) { 443 void xmlStream::object(const char* attr, Handle x) {
444 assert_if_no_error(inside_attrs(), "printing attributes"); 444 assert_if_no_error(inside_attrs(), "printing attributes");
445 if (x.is_null()) return; 445 if (x == NULL) return;
446 print_raw(" "); 446 print_raw(" ");
447 print_raw(attr); 447 print_raw(attr);
448 print_raw("='"); 448 print_raw("='");
449 object_text(x); 449 object_text(x);
450 print_raw("'"); 450 print_raw("'");
451 } 451 }
452 452
453 void xmlStream::object_text(Handle x) { 453 void xmlStream::object_text(Handle x) {
454 assert_if_no_error(inside_attrs(), "printing attributes"); 454 assert_if_no_error(inside_attrs(), "printing attributes");
455 if (x.is_null()) return; 455 if (x == NULL) return;
456 x->print_value_on(text());
457 }
458
459
460 void xmlStream::object(const char* attr, Metadata* x) {
461 assert_if_no_error(inside_attrs(), "printing attributes");
462 if (x == NULL) return;
463 print_raw(" ");
464 print_raw(attr);
465 print_raw("='");
466 object_text(x);
467 print_raw("'");
468 }
469
470 void xmlStream::object_text(Metadata* x) {
471 assert_if_no_error(inside_attrs(), "printing attributes");
472 if (x == NULL) return;
456 //x->print_value_on(text()); 473 //x->print_value_on(text());
457 if (x->is_method()) 474 if (x->is_method())
458 method_text(methodOop(x())); 475 method_text((Method*)x);
459 else if (x->is_klass()) 476 else if (x->is_klass())
460 klass_text(klassOop(x())); 477 klass_text((Klass*)x);
461 else 478 else
462 x->print_value_on(text()); 479 ShouldNotReachHere(); // Add impl if this is reached.
463 } 480 }
464 481
465 482
466 void xmlStream::flush() { 483 void xmlStream::flush() {
467 out()->flush(); 484 out()->flush();