1 /*
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_ASM_ASSEMBLER_HPP
26 #define SHARE_VM_ASM_ASSEMBLER_HPP
27
28 #include "asm/codeBuffer.hpp"
29 #include "asm/register.hpp"
30 #include "code/oopRecorder.hpp"
31 #include "code/relocInfo.hpp"
32 #include "memory/allocation.hpp"
33 #include "runtime/vm_version.hpp"
34 #include "utilities/debug.hpp"
35 #include "utilities/growableArray.hpp"
36
37 // This file contains platform-independent assembler declarations.
38
39 class MacroAssembler;
40 class AbstractAssembler;
41 class Label;
42
43 /**
44 * Labels represent destinations for control transfer instructions. Such
45 * instructions can accept a Label as their target argument. A Label is
46 * bound to the current location in the code stream by calling the
47 * MacroAssembler's 'bind' method, which in turn calls the Label's 'bind'
48 * method. A Label may be referenced by an instruction before it's bound
49 * (i.e., 'forward referenced'). 'bind' stores the current code offset
50 * in the Label object.
51 *
52 * If an instruction references a bound Label, the offset field(s) within
53 * the instruction are immediately filled in based on the Label's code
54 * offset. If an instruction references an unbound label, that
55 * instruction is put on a list of instructions that must be patched
400 static intptr_t* delayed_value_addr(address(*constant_fn)());
401 static void update_delayed_values();
402
403 // Bang stack to trigger StackOverflowError at a safe location
404 // implementation delegates to machine-specific bang_stack_with_offset
405 void generate_stack_overflow_check( int frame_size_in_bytes );
406 virtual void bang_stack_with_offset(int offset) = 0;
407
408
409 /**
410 * A platform-dependent method to patch a jump instruction that refers
411 * to this label.
412 *
413 * @param branch the location of the instruction to patch
414 * @param masm the assembler which generated the branch
415 */
416 void pd_patch_instruction(address branch, address target);
417
418 };
419
420 #ifdef TARGET_ARCH_x86
421 # include "assembler_x86.hpp"
422 #endif
423 #ifdef TARGET_ARCH_sparc
424 # include "assembler_sparc.hpp"
425 #endif
426 #ifdef TARGET_ARCH_zero
427 # include "assembler_zero.hpp"
428 #endif
429 #ifdef TARGET_ARCH_arm
430 # include "assembler_arm.hpp"
431 #endif
432 #ifdef TARGET_ARCH_ppc
433 # include "assembler_ppc.hpp"
434 #endif
435 #ifdef TARGET_ARCH_aarch64
436 # include "assembler_aarch64.hpp"
437 #endif
438
439
440 #endif // SHARE_VM_ASM_ASSEMBLER_HPP
|
1 /*
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.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_ASM_ASSEMBLER_HPP
26 #define SHARE_VM_ASM_ASSEMBLER_HPP
27
28 #include "asm/codeBuffer.hpp"
29 #include "asm/register.hpp"
30 #include "code/oopRecorder.hpp"
31 #include "code/relocInfo.hpp"
32 #include "memory/allocation.hpp"
33 #include "runtime/vm_version.hpp"
34 #include "utilities/debug.hpp"
35 #include "utilities/growableArray.hpp"
36 #include "utilities/macros.hpp"
37
38 // This file contains platform-independent assembler declarations.
39
40 class MacroAssembler;
41 class AbstractAssembler;
42 class Label;
43
44 /**
45 * Labels represent destinations for control transfer instructions. Such
46 * instructions can accept a Label as their target argument. A Label is
47 * bound to the current location in the code stream by calling the
48 * MacroAssembler's 'bind' method, which in turn calls the Label's 'bind'
49 * method. A Label may be referenced by an instruction before it's bound
50 * (i.e., 'forward referenced'). 'bind' stores the current code offset
51 * in the Label object.
52 *
53 * If an instruction references a bound Label, the offset field(s) within
54 * the instruction are immediately filled in based on the Label's code
55 * offset. If an instruction references an unbound label, that
56 * instruction is put on a list of instructions that must be patched
401 static intptr_t* delayed_value_addr(address(*constant_fn)());
402 static void update_delayed_values();
403
404 // Bang stack to trigger StackOverflowError at a safe location
405 // implementation delegates to machine-specific bang_stack_with_offset
406 void generate_stack_overflow_check( int frame_size_in_bytes );
407 virtual void bang_stack_with_offset(int offset) = 0;
408
409
410 /**
411 * A platform-dependent method to patch a jump instruction that refers
412 * to this label.
413 *
414 * @param branch the location of the instruction to patch
415 * @param masm the assembler which generated the branch
416 */
417 void pd_patch_instruction(address branch, address target);
418
419 };
420
421 #include CPU_HEADER(assembler)
422
423 #endif // SHARE_VM_ASM_ASSEMBLER_HPP
|