src/share/vm/asm/assembler.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/asm

src/share/vm/asm/assembler.cpp

Print this page




 102 // in section cs (insts or stubs).
 103 void AbstractAssembler::end_a_const(CodeSection* cs) {
 104   assert(_code_section == code()->consts(), "not in consts?");
 105   set_code_section(cs);
 106 }
 107 
 108 void AbstractAssembler::flush() {
 109   ICache::invalidate_range(addr_at(0), offset());
 110 }
 111 
 112 void AbstractAssembler::bind(Label& L) {
 113   if (L.is_bound()) {
 114     // Assembler can bind a label more than once to the same place.
 115     guarantee(L.loc() == locator(), "attempt to redefine label");
 116     return;
 117   }
 118   L.bind_loc(locator());
 119   L.patch_instructions((MacroAssembler*)this);
 120 }
 121 
 122 void AbstractAssembler::generate_stack_overflow_check( int frame_size_in_bytes) {
 123   if (UseStackBanging) {
 124     // Each code entry causes one stack bang n pages down the stack where n
 125     // is configurable by StackShadowPages.  The setting depends on the maximum
 126     // depth of VM call stack or native before going back into java code,
 127     // since only java code can raise a stack overflow exception using the
 128     // stack banging mechanism.  The VM and native code does not detect stack
 129     // overflow.
 130     // The code in JavaCalls::call() checks that there is at least n pages
 131     // available, so all entry code needs to do is bang once for the end of
 132     // this shadow zone.
 133     // The entry code may need to bang additional pages if the framesize
 134     // is greater than a page.
 135 
 136     const int page_size = os::vm_page_size();
 137     int bang_end = StackShadowPages*page_size;
 138 
 139     // This is how far the previous frame's stack banging extended.
 140     const int bang_end_safe = bang_end;
 141 
 142     if (frame_size_in_bytes > page_size) {
 143       bang_end += frame_size_in_bytes;
 144     }
 145 
 146     int bang_offset = bang_end_safe;
 147     while (bang_offset <= bang_end) {
 148       // Need at least one stack bang at end of shadow zone.
 149       bang_stack_with_offset(bang_offset);
 150       bang_offset += page_size;
 151     }
 152   } // end (UseStackBanging)
 153 }
 154 
 155 void Label::add_patch_at(CodeBuffer* cb, int branch_loc) {
 156   assert(_loc == -1, "Label is unbound");
 157   if (_patch_index < PatchCacheSize) {




 102 // in section cs (insts or stubs).
 103 void AbstractAssembler::end_a_const(CodeSection* cs) {
 104   assert(_code_section == code()->consts(), "not in consts?");
 105   set_code_section(cs);
 106 }
 107 
 108 void AbstractAssembler::flush() {
 109   ICache::invalidate_range(addr_at(0), offset());
 110 }
 111 
 112 void AbstractAssembler::bind(Label& L) {
 113   if (L.is_bound()) {
 114     // Assembler can bind a label more than once to the same place.
 115     guarantee(L.loc() == locator(), "attempt to redefine label");
 116     return;
 117   }
 118   L.bind_loc(locator());
 119   L.patch_instructions((MacroAssembler*)this);
 120 }
 121 
 122 void AbstractAssembler::generate_stack_overflow_check(int frame_size_in_bytes) {
 123   if (UseStackBanging) {
 124     // Each code entry causes one stack bang n pages down the stack where n
 125     // is configurable by StackShadowPages.  The setting depends on the maximum
 126     // depth of VM call stack or native before going back into java code,
 127     // since only java code can raise a stack overflow exception using the
 128     // stack banging mechanism.  The VM and native code does not detect stack
 129     // overflow.
 130     // The code in JavaCalls::call() checks that there is at least n pages
 131     // available, so all entry code needs to do is bang once for the end of
 132     // this shadow zone.
 133     // The entry code may need to bang additional pages if the framesize
 134     // is greater than a page.
 135 
 136     const int page_size = os::vm_page_size();
 137     int bang_end = StackShadowPages * page_size;
 138 
 139     // This is how far the previous frame's stack banging extended.
 140     const int bang_end_safe = bang_end;
 141 
 142     if (frame_size_in_bytes > page_size) {
 143       bang_end += frame_size_in_bytes;
 144     }
 145 
 146     int bang_offset = bang_end_safe;
 147     while (bang_offset <= bang_end) {
 148       // Need at least one stack bang at end of shadow zone.
 149       bang_stack_with_offset(bang_offset);
 150       bang_offset += page_size;
 151     }
 152   } // end (UseStackBanging)
 153 }
 154 
 155 void Label::add_patch_at(CodeBuffer* cb, int branch_loc) {
 156   assert(_loc == -1, "Label is unbound");
 157   if (_patch_index < PatchCacheSize) {


src/share/vm/asm/assembler.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File