1 /*
2 * Copyright (c) 1999, 2005, 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 // type hierarchy
26 class ValueType;
27 class VoidType;
28 class IntType;
29 class IntConstant;
30 class IntInterval;
31 class LongType;
32 class LongConstant;
33 class FloatType;
34 class FloatConstant;
35 class DoubleType;
36 class DoubleConstant;
37 class ObjectType;
38 class ObjectConstant;
39 class ArrayType;
40 class ArrayConstant;
41 class InstanceType;
42 class InstanceConstant;
43 class ClassType;
44 class ClassConstant;
402 virtual AddressConstant* as_AddressConstant() { return this; }
403 };
404
405
406 class IllegalType: public ValueType {
407 public:
408 IllegalType(): ValueType(illegalTag, -1) {}
409 virtual ValueType* base() const { return illegalType; }
410 virtual const char tchar() const { return ' '; }
411 virtual const char* name() const { return "illegal"; }
412 virtual IllegalType* as_IllegalType() { return this; }
413 };
414
415
416 // conversion between ValueTypes, BasicTypes, and ciConstants
417 ValueType* as_ValueType(BasicType type);
418 ValueType* as_ValueType(ciConstant value);
419 BasicType as_BasicType(ValueType* type);
420
421 inline ValueType* as_ValueType(ciType* type) { return as_ValueType(type->basic_type()); }
|
1 /*
2 * Copyright (c) 1999, 2010, 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_C1_C1_VALUETYPE_HPP
26 #define SHARE_VM_C1_C1_VALUETYPE_HPP
27
28 #include "c1/c1_Compilation.hpp"
29 #include "ci/ciConstant.hpp"
30
31 // type hierarchy
32 class ValueType;
33 class VoidType;
34 class IntType;
35 class IntConstant;
36 class IntInterval;
37 class LongType;
38 class LongConstant;
39 class FloatType;
40 class FloatConstant;
41 class DoubleType;
42 class DoubleConstant;
43 class ObjectType;
44 class ObjectConstant;
45 class ArrayType;
46 class ArrayConstant;
47 class InstanceType;
48 class InstanceConstant;
49 class ClassType;
50 class ClassConstant;
408 virtual AddressConstant* as_AddressConstant() { return this; }
409 };
410
411
412 class IllegalType: public ValueType {
413 public:
414 IllegalType(): ValueType(illegalTag, -1) {}
415 virtual ValueType* base() const { return illegalType; }
416 virtual const char tchar() const { return ' '; }
417 virtual const char* name() const { return "illegal"; }
418 virtual IllegalType* as_IllegalType() { return this; }
419 };
420
421
422 // conversion between ValueTypes, BasicTypes, and ciConstants
423 ValueType* as_ValueType(BasicType type);
424 ValueType* as_ValueType(ciConstant value);
425 BasicType as_BasicType(ValueType* type);
426
427 inline ValueType* as_ValueType(ciType* type) { return as_ValueType(type->basic_type()); }
428
429 #endif // SHARE_VM_C1_C1_VALUETYPE_HPP
|