1 /*
2 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2016 SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
32 #include "utilities/macros.hpp"
33
34 int AbstractInterpreter::BasicType_as_index(BasicType type) {
35 int i = 0;
36 switch (type) {
37 case T_BOOLEAN: i = 0; break;
38 case T_CHAR : i = 1; break;
39 case T_BYTE : i = 2; break;
40 case T_SHORT : i = 3; break;
41 case T_INT : i = 4; break;
42 case T_LONG : i = 5; break;
43 case T_VOID : i = 6; break;
44 case T_FLOAT : i = 7; break;
45 case T_DOUBLE : i = 8; break;
46 case T_OBJECT : i = 9; break;
47 case T_ARRAY : i = 9; break;
48 default : ShouldNotReachHere();
49 }
50 assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, "index out of bounds");
51 return i;
52 }
53
54 bool AbstractInterpreter::can_be_compiled(methodHandle m) {
55 // No special entry points that preclude compilation.
56 return true;
57 }
58
59 // How much stack a method top interpreter activation needs in words.
60 int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
61
62 // We have to size the following 2 frames:
63 //
64 // [TOP_IJAVA_FRAME_ABI]
65 // [ENTRY_FRAME]
66 //
67 // This expands to (see frame_s390.hpp):
68 //
69 // [TOP_IJAVA_FRAME_ABI]
70 // [operand stack] > stack
71 // [monitors] (optional) > monitors
72 // [IJAVA_STATE] > interpreter_state
73 // [PARENT_IJAVA_FRAME_ABI]
74 // [callee's locals w/o arguments] \ locals
75 // [outgoing arguments] /
76 // [ENTRY_FRAME_LOCALS]
|
1 /*
2 * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2016 SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
32 #include "utilities/macros.hpp"
33
34 int AbstractInterpreter::BasicType_as_index(BasicType type) {
35 int i = 0;
36 switch (type) {
37 case T_BOOLEAN: i = 0; break;
38 case T_CHAR : i = 1; break;
39 case T_BYTE : i = 2; break;
40 case T_SHORT : i = 3; break;
41 case T_INT : i = 4; break;
42 case T_LONG : i = 5; break;
43 case T_VOID : i = 6; break;
44 case T_FLOAT : i = 7; break;
45 case T_DOUBLE : i = 8; break;
46 case T_OBJECT : i = 9; break;
47 case T_ARRAY : i = 9; break;
48 default : ShouldNotReachHere();
49 }
50 assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, "index out of bounds");
51 return i;
52 }
53
54 // How much stack a method top interpreter activation needs in words.
55 int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
56
57 // We have to size the following 2 frames:
58 //
59 // [TOP_IJAVA_FRAME_ABI]
60 // [ENTRY_FRAME]
61 //
62 // This expands to (see frame_s390.hpp):
63 //
64 // [TOP_IJAVA_FRAME_ABI]
65 // [operand stack] > stack
66 // [monitors] (optional) > monitors
67 // [IJAVA_STATE] > interpreter_state
68 // [PARENT_IJAVA_FRAME_ABI]
69 // [callee's locals w/o arguments] \ locals
70 // [outgoing arguments] /
71 // [ENTRY_FRAME_LOCALS]
|