1 /*
2 * Copyright (c) 2008, 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 *
36
37 class InterpreterMacroAssembler: public MacroAssembler {
38
39 public:
40
41 // allow JvmtiExport checks to be extended
42 bool can_force_early_return() { return JvmtiExport::can_force_early_return(); }
43 bool can_post_interpreter_events() { return JvmtiExport::can_post_interpreter_events(); }
44 bool can_pop_frame() { return JvmtiExport::can_pop_frame(); }
45 bool can_post_breakpoint() { return JvmtiExport::can_post_breakpoint(); }
46 bool can_post_field_access() { return JvmtiExport::can_post_field_access(); }
47 bool can_post_field_modification() { return JvmtiExport::can_post_field_modification(); }
48 // flags controlled by JVMTI settings
49 bool rewrite_frequent_pairs() { return RewriteFrequentPairs; }
50
51 protected:
52
53 // Template interpreter specific version of call_VM_helper
54 virtual void call_VM_helper(Register oop_result, address entry_point, int number_of_arguments, bool check_exceptions);
55
56 virtual void check_and_handle_popframe();
57 virtual void check_and_handle_earlyret();
58
59 // base routine for all dispatches
60 typedef enum { DispatchDefault, DispatchNormal } DispatchTableMode;
61 void dispatch_base(TosState state, DispatchTableMode table_mode, bool verifyoop = true);
62
63 public:
64 InterpreterMacroAssembler(CodeBuffer* code);
65
66 // Interpreter-specific registers
67 #if defined(AARCH64) && defined(ASSERT)
68
69 #define check_stack_top() _check_stack_top("invalid Rstack_top at " __FILE__ ":" XSTR(__LINE__))
70 #define check_stack_top_on_expansion() _check_stack_top("invalid Rstack_top at " __FILE__ ":" XSTR(__LINE__), VerifyInterpreterStackTop)
71 #define check_extended_sp(tmp) _check_extended_sp(tmp, "SP does not match extended SP in frame at " __FILE__ ":" XSTR(__LINE__))
72 #define check_no_cached_stack_top(tmp) _check_no_cached_stack_top(tmp, "stack_top is already cached in frame at " __FILE__ ":" XSTR(__LINE__))
73
74 void _check_stack_top(const char* msg, bool enabled = true) {
75 if (enabled) {
76 Label L;
77 cmp(SP, Rstack_top);
78 b(L, ls);
79 stop(msg);
80 bind(L);
81 }
82 }
83
84 void _check_extended_sp(Register tmp, const char* msg) {
85 Label L;
|
1 /*
2 * Copyright (c) 2008, 2017, 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 *
36
37 class InterpreterMacroAssembler: public MacroAssembler {
38
39 public:
40
41 // allow JvmtiExport checks to be extended
42 bool can_force_early_return() { return JvmtiExport::can_force_early_return(); }
43 bool can_post_interpreter_events() { return JvmtiExport::can_post_interpreter_events(); }
44 bool can_pop_frame() { return JvmtiExport::can_pop_frame(); }
45 bool can_post_breakpoint() { return JvmtiExport::can_post_breakpoint(); }
46 bool can_post_field_access() { return JvmtiExport::can_post_field_access(); }
47 bool can_post_field_modification() { return JvmtiExport::can_post_field_modification(); }
48 // flags controlled by JVMTI settings
49 bool rewrite_frequent_pairs() { return RewriteFrequentPairs; }
50
51 protected:
52
53 // Template interpreter specific version of call_VM_helper
54 virtual void call_VM_helper(Register oop_result, address entry_point, int number_of_arguments, bool check_exceptions);
55
56 // base routine for all dispatches
57 typedef enum { DispatchDefault, DispatchNormal } DispatchTableMode;
58 void dispatch_base(TosState state, DispatchTableMode table_mode, bool verifyoop = true);
59
60 public:
61 InterpreterMacroAssembler(CodeBuffer* code);
62
63 virtual void check_and_handle_popframe();
64 virtual void check_and_handle_earlyret();
65
66 // Interpreter-specific registers
67 #if defined(AARCH64) && defined(ASSERT)
68
69 #define check_stack_top() _check_stack_top("invalid Rstack_top at " __FILE__ ":" XSTR(__LINE__))
70 #define check_stack_top_on_expansion() _check_stack_top("invalid Rstack_top at " __FILE__ ":" XSTR(__LINE__), VerifyInterpreterStackTop)
71 #define check_extended_sp(tmp) _check_extended_sp(tmp, "SP does not match extended SP in frame at " __FILE__ ":" XSTR(__LINE__))
72 #define check_no_cached_stack_top(tmp) _check_no_cached_stack_top(tmp, "stack_top is already cached in frame at " __FILE__ ":" XSTR(__LINE__))
73
74 void _check_stack_top(const char* msg, bool enabled = true) {
75 if (enabled) {
76 Label L;
77 cmp(SP, Rstack_top);
78 b(L, ls);
79 stop(msg);
80 bind(L);
81 }
82 }
83
84 void _check_extended_sp(Register tmp, const char* msg) {
85 Label L;
|