1.1 --- a/src/share/vm/code/codeBlob.hpp Mon Aug 23 09:09:36 2010 -0700 1.2 +++ b/src/share/vm/code/codeBlob.hpp Wed Aug 25 05:27:54 2010 -0700 1.3 @@ -35,7 +35,8 @@ 1.4 // Layout: 1.5 // - header 1.6 // - relocation 1.7 -// - instruction space 1.8 +// - content space 1.9 +// - instruction space 1.10 // - data space 1.11 class DeoptimizationBlob; 1.12 1.13 @@ -48,7 +49,8 @@ 1.14 int _size; // total size of CodeBlob in bytes 1.15 int _header_size; // size of header (depends on subclass) 1.16 int _relocation_size; // size of relocation 1.17 - int _instructions_offset; // offset to where instructions region begins 1.18 + int _content_offset; // offset to where content region begins (this includes consts, insts, stubs) 1.19 + int _code_offset; // offset to where instructions region begins (this includes insts, stubs) 1.20 int _frame_complete_offset; // instruction offsets in [0.._frame_complete_offset) have 1.21 // not finished setting up their frame. Beware of pc's in 1.22 // that range. There is a similar range(s) on returns 1.23 @@ -106,31 +108,36 @@ 1.24 address header_end() const { return ((address) this) + _header_size; }; 1.25 relocInfo* relocation_begin() const { return (relocInfo*) header_end(); }; 1.26 relocInfo* relocation_end() const { return (relocInfo*)(header_end() + _relocation_size); } 1.27 - address instructions_begin() const { return (address) header_begin() + _instructions_offset; } 1.28 - address instructions_end() const { return (address) header_begin() + _data_offset; } 1.29 + address content_begin() const { return (address) header_begin() + _content_offset; } 1.30 + address content_end() const { return (address) header_begin() + _data_offset; } 1.31 + address code_begin() const { return (address) header_begin() + _code_offset; } 1.32 + address code_end() const { return (address) header_begin() + _data_offset; } 1.33 address data_begin() const { return (address) header_begin() + _data_offset; } 1.34 address data_end() const { return (address) header_begin() + _size; } 1.35 1.36 // Offsets 1.37 int relocation_offset() const { return _header_size; } 1.38 - int instructions_offset() const { return _instructions_offset; } 1.39 + int content_offset() const { return _content_offset; } 1.40 + int code_offset() const { return _code_offset; } 1.41 int data_offset() const { return _data_offset; } 1.42 1.43 // Sizes 1.44 int size() const { return _size; } 1.45 int header_size() const { return _header_size; } 1.46 int relocation_size() const { return (address) relocation_end() - (address) relocation_begin(); } 1.47 - int instructions_size() const { return instructions_end() - instructions_begin(); } 1.48 - int data_size() const { return data_end() - data_begin(); } 1.49 + int content_size() const { return content_end() - content_begin(); } 1.50 + int code_size() const { return code_end() - code_begin(); } 1.51 + int data_size() const { return data_end() - data_begin(); } 1.52 1.53 // Containment 1.54 - bool blob_contains(address addr) const { return header_begin() <= addr && addr < data_end(); } 1.55 + bool blob_contains(address addr) const { return header_begin() <= addr && addr < data_end(); } 1.56 bool relocation_contains(relocInfo* addr) const{ return relocation_begin() <= addr && addr < relocation_end(); } 1.57 - bool instructions_contains(address addr) const { return instructions_begin() <= addr && addr < instructions_end(); } 1.58 - bool data_contains(address addr) const { return data_begin() <= addr && addr < data_end(); } 1.59 - bool contains(address addr) const { return instructions_contains(addr); } 1.60 - bool is_frame_complete_at(address addr) const { return instructions_contains(addr) && 1.61 - addr >= instructions_begin() + _frame_complete_offset; } 1.62 + bool content_contains(address addr) const { return content_begin() <= addr && addr < content_end(); } 1.63 + bool code_contains(address addr) const { return code_begin() <= addr && addr < code_end(); } 1.64 + bool data_contains(address addr) const { return data_begin() <= addr && addr < data_end(); } 1.65 + bool contains(address addr) const { return content_contains(addr); } 1.66 + bool is_frame_complete_at(address addr) const { return code_contains(addr) && 1.67 + addr >= code_begin() + _frame_complete_offset; } 1.68 1.69 // CodeCache support: really only used by the nmethods, but in order to get 1.70 // asserts and certain bookkeeping to work in the CodeCache they are defined 1.71 @@ -169,7 +176,7 @@ 1.72 1.73 // Print the comment associated with offset on stream, if there is one 1.74 virtual void print_block_comment(outputStream* stream, address block_begin) { 1.75 - intptr_t offset = (intptr_t)(block_begin - instructions_begin()); 1.76 + intptr_t offset = (intptr_t)(block_begin - code_begin()); 1.77 _comments.print_block_comment(stream, offset); 1.78 } 1.79 1.80 @@ -286,7 +293,7 @@ 1.81 // GC support 1.82 bool caller_must_gc_arguments(JavaThread* thread) const { return _caller_must_gc_arguments; } 1.83 1.84 - address entry_point() { return instructions_begin(); } 1.85 + address entry_point() { return code_begin(); } 1.86 1.87 // GC/Verification support 1.88 void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { /* nothing to do */ } 1.89 @@ -313,13 +320,15 @@ 1.90 OopMapSet* oop_maps 1.91 ) 1.92 : CodeBlob(name, cb, header_size, size, CodeOffsets::frame_never_safe, frame_size, oop_maps) 1.93 - {}; 1.94 + {}; 1.95 1.96 - bool is_alive() const { return true; } 1.97 + address entry_point() { return code_begin(); } 1.98 1.99 - void verify(); // does nothing 1.100 - void print_on(outputStream* st) const; 1.101 - void print_value_on(outputStream* st) const; 1.102 + bool is_alive() const { return true; } 1.103 + 1.104 + void verify(); // does nothing 1.105 + void print_on(outputStream* st) const; 1.106 + void print_value_on(outputStream* st) const; 1.107 }; 1.108 1.109 1.110 @@ -376,9 +385,9 @@ 1.111 // Printing 1.112 void print_value_on(outputStream* st) const; 1.113 1.114 - address unpack() const { return instructions_begin() + _unpack_offset; } 1.115 - address unpack_with_exception() const { return instructions_begin() + _unpack_with_exception; } 1.116 - address unpack_with_reexecution() const { return instructions_begin() + _unpack_with_reexecution; } 1.117 + address unpack() const { return code_begin() + _unpack_offset; } 1.118 + address unpack_with_exception() const { return code_begin() + _unpack_with_exception; } 1.119 + address unpack_with_reexecution() const { return code_begin() + _unpack_with_reexecution; } 1.120 1.121 // Alternate entry point for C1 where the exception and issuing pc 1.122 // are in JavaThread::_exception_oop and JavaThread::_exception_pc 1.123 @@ -387,9 +396,9 @@ 1.124 // there may be live values in those registers during deopt. 1.125 void set_unpack_with_exception_in_tls_offset(int offset) { 1.126 _unpack_with_exception_in_tls = offset; 1.127 - assert(contains(instructions_begin() + _unpack_with_exception_in_tls), "must be PC inside codeblob"); 1.128 + assert(code_contains(code_begin() + _unpack_with_exception_in_tls), "must be PC inside codeblob"); 1.129 } 1.130 - address unpack_with_exception_in_tls() const { return instructions_begin() + _unpack_with_exception_in_tls; } 1.131 + address unpack_with_exception_in_tls() const { return code_begin() + _unpack_with_exception_in_tls; } 1.132 }; 1.133 1.134