source: vendor/gcc/3.2.2/libjava/include/java-cpool.h

Last change on this file was 2, checked in by bird, 22 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 2.5 KB
Line 
1// java-cpool.h - Constant pool parsing header. -*- c++ -*-
2
3/* Copyright (C) 1999, 2000 Free Software Foundation
4
5 This file is part of libgcj.
6
7This software is copyrighted work licensed under the terms of the
8Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
9details. */
10
11#ifndef __JAVA_CPOOL_H__
12#define __JAVA_CPOOL_H__
13
14#include <gcj/javaprims.h>
15
16// we rename these, to avoid polluting the name space
17#define JV_CONSTANT_Undefined (0L)
18#define JV_CONSTANT_Utf8 (1L)
19#define JV_CONSTANT_Unicode (2L)
20#define JV_CONSTANT_Integer (3L)
21#define JV_CONSTANT_Float (4L)
22#define JV_CONSTANT_Long (5L)
23#define JV_CONSTANT_Double (6L)
24#define JV_CONSTANT_Class (7L)
25#define JV_CONSTANT_String (8L)
26#define JV_CONSTANT_Fieldref (9L)
27#define JV_CONSTANT_Methodref (10L)
28#define JV_CONSTANT_InterfaceMethodref (11L)
29#define JV_CONSTANT_NameAndType (12L)
30#define JV_CONSTANT_ResolvedFlag (16L)
31#define JV_CONSTANT_ResolvedString (16L | 8L)
32#define JV_CONSTANT_ResolvedClass (16L | 7L)
33
34extern inline void
35_Jv_storeIndexes (_Jv_word *data,
36 _Jv_ushort index0,
37 _Jv_ushort index1)
38{
39 data->i = (((jint)index0) << 16) | (jint) index1;
40}
41
42extern inline void
43_Jv_loadIndexes (const _Jv_word *data,
44 _Jv_ushort& index0,
45 _Jv_ushort& index1)
46{
47 jint udata = data->i;
48
49 _Jv_uint uindex0 = ((udata >> 16) & 0xffff);
50 _Jv_uint uindex1 = udata & 0xffff;
51
52 index0 = uindex0;
53 index1 = uindex1;
54}
55
56extern inline void
57_Jv_storeFloat (_Jv_word *data, jfloat f)
58{
59 data->f = f;
60}
61
62extern inline jfloat
63_Jv_loadFloat (_Jv_word *data)
64{
65 return data->f;
66}
67
68extern inline void
69_Jv_storeInt (_Jv_word *data, jint i)
70{
71 data->i = i;
72}
73
74extern inline jint
75_Jv_loadInt (_Jv_word *data)
76{
77 return data->i;
78}
79
80extern inline void
81_Jv_storeLong (_Jv_word *data, jlong l)
82{
83#if SIZEOF_VOID_P == 8
84 data[0].l = l;
85#else
86 _Jv_word2 tmp;
87 tmp.l = l;
88 data[0].ia[0] = tmp.ia[0];
89 data[1].ia[0] = tmp.ia[1];
90#endif
91}
92
93extern inline jlong
94_Jv_loadLong (_Jv_word *data)
95{
96#if SIZEOF_VOID_P == 8
97 return data -> l;
98#else
99 _Jv_word2 tmp;
100 tmp.ia[0] = data[0].ia[0];
101 tmp.ia[1] = data[1].ia[0];
102 return tmp.l;
103#endif
104}
105
106extern inline void
107_Jv_storeDouble (_Jv_word *data, jdouble d)
108{
109#if SIZEOF_VOID_P == 8
110 data[0].d = d;
111#else
112 _Jv_word2 tmp;
113 tmp.d = d;
114 data[0].ia[0] = tmp.ia[0];
115 data[1].ia[0] = tmp.ia[1];
116#endif
117}
118
119extern inline jdouble
120_Jv_loadDouble (_Jv_word *data)
121{
122#if SIZEOF_VOID_P == 8
123 return data -> d;
124#else
125 _Jv_word2 tmp;
126 tmp.ia[0] = data[0].ia[0];
127 tmp.ia[1] = data[1].ia[0];
128 return tmp.d;
129#endif
130}
131
132
133#endif /* __JAVA_CPOOL_H__ */
Note: See TracBrowser for help on using the repository browser.