1 /*
2 * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
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.
23 *
24 */
25
26 #include "precompiled.hpp"
27 #include "interpreter/bytecodeInterpreter.hpp"
28 #include "interpreter/cppInterpreter.hpp"
29 #include "runtime/frame.inline.hpp"
30 #include "utilities/globalDefinitions.hpp"
31
32 bool AbstractInterpreter::can_be_compiled(methodHandle m) {
33 return true;
34 }
35
36 int AbstractInterpreter::BasicType_as_index(BasicType type) {
37 int i = 0;
38 switch (type) {
39 case T_BOOLEAN: i = 0; break;
40 case T_CHAR : i = 1; break;
41 case T_BYTE : i = 2; break;
42 case T_SHORT : i = 3; break;
43 case T_INT : i = 4; break;
44 case T_LONG : i = 5; break;
45 case T_VOID : i = 6; break;
46 case T_FLOAT : i = 7; break;
47 case T_DOUBLE : i = 8; break;
48 case T_OBJECT : i = 9; break;
49 case T_ARRAY : i = 9; break;
50 default : ShouldNotReachHere();
51 }
52 assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers,
53 "index out of bounds");
54 return i;
|
1 /*
2 * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
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.
23 *
24 */
25
26 #include "precompiled.hpp"
27 #include "interpreter/bytecodeInterpreter.hpp"
28 #include "interpreter/cppInterpreter.hpp"
29 #include "runtime/frame.inline.hpp"
30 #include "utilities/globalDefinitions.hpp"
31
32 int AbstractInterpreter::BasicType_as_index(BasicType type) {
33 int i = 0;
34 switch (type) {
35 case T_BOOLEAN: i = 0; break;
36 case T_CHAR : i = 1; break;
37 case T_BYTE : i = 2; break;
38 case T_SHORT : i = 3; break;
39 case T_INT : i = 4; break;
40 case T_LONG : i = 5; break;
41 case T_VOID : i = 6; break;
42 case T_FLOAT : i = 7; break;
43 case T_DOUBLE : i = 8; break;
44 case T_OBJECT : i = 9; break;
45 case T_ARRAY : i = 9; break;
46 default : ShouldNotReachHere();
47 }
48 assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers,
49 "index out of bounds");
50 return i;
|