hotspot/src/share/vm/code/stubs.cpp
changeset 42664 29142a56c193
parent 33105 294e48b4f704
child 46620 750c6edff33b
equal deleted inserted replaced
42663:2335df372367 42664:29142a56c193
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2016, 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.
   260   for (Stub* s = first(); s != NULL; s = next(s)) {
   260   for (Stub* s = first(); s != NULL; s = next(s)) {
   261     stub_print(s);
   261     stub_print(s);
   262   }
   262   }
   263 }
   263 }
   264 
   264 
   265 // Fixup for pregenerated code
       
   266 void StubQueue::fix_buffer(address buffer, address queue_end, address buffer_end, int number_of_stubs) {
       
   267   const int extra_bytes = CodeEntryAlignment;
       
   268   _stub_buffer = buffer;
       
   269   _queue_begin = 0;
       
   270   _queue_end = queue_end - buffer;
       
   271   _number_of_stubs = number_of_stubs;
       
   272   int size = buffer_end - buffer;
       
   273   // Note: _buffer_limit must differ from _queue_end in the iteration loops
       
   274   // => add extra space at the end (preserving alignment for asserts) if needed
       
   275   if (buffer_end == queue_end) size += extra_bytes;
       
   276   _buffer_limit = _buffer_size = size;
       
   277 }