assembler.cpp revision 0
1879N/A * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1472N/A * CA 95054 USA or visit www.sun.com if you need additional information or 1879N/A#
include "incls/_precompiled.incl" 1879N/A// Implementation of AbstractAssembler 1879N/A// The AbstractAssembler is generating code into a CodeBuffer. To make code generation faster, 1879N/A// the assembler keeps a copy of the code buffers boundaries & modifies them when 1879N/A// emitting bytes rather than using the code buffers accessor functions all the time. 1879N/A// The code buffer is updated via set_code_end(...) after emiting a whole instruction. 1410N/A// Inform CodeBuffer that incoming code and relocation will be for stubs 0N/A// Inform CodeBuffer that incoming code and relocation will be code 0N/A// Should not be called if start_a_stub() returned NULL 0N/A// Inform CodeBuffer that incoming code and relocation will be for stubs 0N/A// Inform CodeBuffer that incoming code and relocation will be code 0N/A// Should not be called if start_a_const() returned NULL 0N/A// Labels refer to positions in the (to be) generated code. There are bound 0N/A// Bound labels refer to known positions in the already generated code. 0N/A// offset() is the position the label refers to. 0N/A// Unbound labels refer to unknown positions in the code to be generated; it 0N/A// may contain a list of unresolved displacements that refer to it 0N/A // Assembler can bind a label more than once to the same place. 0N/A // Each code entry causes one stack bang n pages down the stack where n 0N/A // is configurable by StackBangPages. The setting depends on the maximum 0N/A // depth of VM call stack or native before going back into java code, 0N/A // since only java code can raise a stack overflow exception using the 0N/A // stack banging mechanism. The VM and native code does not detect stack 0N/A // The code in JavaCalls::call() checks that there is at least n pages 0N/A // available, so all entry code needs to do is bang once for the end of 0N/A // this shadow zone. 0N/A // The entry code may need to bang additional pages if the framesize 0N/A // is greater than a page. 0N/A // This is how far the previous frame's stack banging extended. 0N/A // Need at least one stack bang at end of shadow zone. 0N/A }
// end (UseStackBanging) 0N/A // The thing to patch is a constant word. 0N/A // Cross-section branches only work if the 0N/A // intermediate section boundaries are frozen. 0N/A // Push the target offset into the branch instruction.