comparison src/share/vm/asm/codeBuffer.hpp @ 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 44ce519bc3d1
children b31471cdc53e
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 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.
484 484
485 // is a given address in the insts section? (2nd version is end-inclusive) 485 // is a given address in the insts section? (2nd version is end-inclusive)
486 bool insts_contains(address pc) const { return _insts.contains(pc); } 486 bool insts_contains(address pc) const { return _insts.contains(pc); }
487 bool insts_contains2(address pc) const { return _insts.contains2(pc); } 487 bool insts_contains2(address pc) const { return _insts.contains2(pc); }
488 488
489 // Record any extra oops required to keep embedded metadata alive
490 void finalize_oop_references(methodHandle method);
491
489 // Allocated size in all sections, when aligned and concatenated 492 // Allocated size in all sections, when aligned and concatenated
490 // (this is the eventual state of the content in its final 493 // (this is the eventual state of the content in its final
491 // CodeBlob). 494 // CodeBlob).
492 csize_t total_content_size() const; 495 csize_t total_content_size() const;
493 496
500 503
501 // allocated size of any and all recorded oops 504 // allocated size of any and all recorded oops
502 csize_t total_oop_size() const { 505 csize_t total_oop_size() const {
503 OopRecorder* recorder = oop_recorder(); 506 OopRecorder* recorder = oop_recorder();
504 return (recorder == NULL)? 0: recorder->oop_size(); 507 return (recorder == NULL)? 0: recorder->oop_size();
508 }
509
510 // allocated size of any and all recorded metadata
511 csize_t total_metadata_size() const {
512 OopRecorder* recorder = oop_recorder();
513 return (recorder == NULL)? 0: recorder->metadata_size();
505 } 514 }
506 515
507 // Configuration functions, called immediately after the CB is constructed. 516 // Configuration functions, called immediately after the CB is constructed.
508 // The section sizes are subtracted from the original insts section. 517 // The section sizes are subtracted from the original insts section.
509 // Note: Call them in reverse section order, because each steals from insts. 518 // Note: Call them in reverse section order, because each steals from insts.
530 void copy_code_and_locs_to(CodeBlob* blob) { 539 void copy_code_and_locs_to(CodeBlob* blob) {
531 assert(blob != NULL, "sane"); 540 assert(blob != NULL, "sane");
532 copy_relocations_to(blob); 541 copy_relocations_to(blob);
533 copy_code_to(blob); 542 copy_code_to(blob);
534 } 543 }
535 void copy_oops_to(nmethod* nm) { 544 void copy_values_to(nmethod* nm) {
536 if (!oop_recorder()->is_unused()) { 545 if (!oop_recorder()->is_unused()) {
537 oop_recorder()->copy_to(nm); 546 oop_recorder()->copy_values_to(nm);
538 } 547 }
539 } 548 }
540 549
541 // Transform an address from the code in this code buffer to a specified code buffer 550 // Transform an address from the code in this code buffer to a specified code buffer
542 address transform_address(const CodeBuffer &cb, address addr) const; 551 address transform_address(const CodeBuffer &cb, address addr) const;