Mercurial > hg > graal-compiler
annotate graal/com.oracle.truffle.object.basic/src/com/oracle/truffle/object/basic/BasicLocations.java @ 21226:2f2fac20c446
LIRVerifier: verify PHIs.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Thu, 23 Apr 2015 11:30:36 +0200 |
parents | e9cbe1618733 |
children |
rev | line source |
---|---|
18408
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
1 /* |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
4 * |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
8 * |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
13 * accompanied this code). |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
14 * |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
18 * |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
21 * questions. |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
22 */ |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
23 package com.oracle.truffle.object.basic; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
24 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
25 import java.lang.invoke.*; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
26 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
27 import com.oracle.truffle.api.*; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
28 import com.oracle.truffle.api.object.*; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
29 import com.oracle.truffle.object.*; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
30 import com.oracle.truffle.object.LocationImpl.InternalLongLocation; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
31 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
32 /** |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
33 * Property location. |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
34 * |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
35 * @see Shape |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
36 * @see Property |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
37 * @see DynamicObject |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
38 */ |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
39 public abstract class BasicLocations { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
40 static final int LONG_SIZE = 1; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
41 static final int OBJECT_SIZE = 1; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
42 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
43 public abstract static class ArrayLocation extends LocationImpl { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
44 protected final int index; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
45 protected final Location arrayLocation; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
46 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
47 public ArrayLocation(int index, Location arrayLocation) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
48 this.index = index; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
49 this.arrayLocation = arrayLocation; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
50 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
51 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
52 protected final Object getArray(DynamicObject store, boolean condition) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
53 // non-null cast |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
54 return arrayLocation.get(store, condition); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
55 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
56 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
57 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
58 public int hashCode() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
59 final int prime = 31; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
60 int result = super.hashCode(); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
61 result = prime * result + index; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
62 return result; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
63 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
64 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
65 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
66 public boolean equals(Object obj) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
67 if (!super.equals(obj)) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
68 return false; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
69 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
70 ArrayLocation other = (ArrayLocation) obj; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
71 if (index != other.index) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
72 return false; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
73 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
74 return true; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
75 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
76 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
77 public final int getIndex() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
78 return index; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
79 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
80 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
81 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
82 protected String getWhereString() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
83 return "[" + index + "]"; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
84 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
85 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
86 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
87 public abstract static class FieldLocation extends LocationImpl { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
88 private final int index; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
89 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
90 public FieldLocation(int index) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
91 this.index = index; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
92 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
93 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
94 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
95 public int hashCode() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
96 final int prime = 31; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
97 int result = super.hashCode(); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
98 result = prime * result + index; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
99 return result; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
100 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
101 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
102 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
103 public boolean equals(Object obj) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
104 if (!super.equals(obj)) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
105 return false; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
106 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
107 FieldLocation other = (FieldLocation) obj; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
108 if (index != other.index) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
109 return false; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
110 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
111 return true; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
112 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
113 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
114 public final int getIndex() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
115 return index; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
116 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
117 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
118 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
119 protected String getWhereString() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
120 return "@" + index; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
121 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
122 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
123 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
124 public abstract static class MethodHandleFieldLocation extends FieldLocation { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
125 protected final MethodHandle getter; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
126 protected final MethodHandle setter; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
127 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
128 public MethodHandleFieldLocation(int index, MethodHandle getter, MethodHandle setter) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
129 super(index); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
130 this.getter = getter; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
131 this.setter = setter; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
132 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
133 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
134 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
135 public static class ObjectArrayLocation extends ArrayLocation implements ObjectLocation { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
136 public ObjectArrayLocation(int index, Location arrayLocation) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
137 super(index, arrayLocation); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
138 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
139 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
140 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
141 public Object get(DynamicObject store, boolean condition) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
142 return ((Object[]) getArray(store, condition))[index]; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
143 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
144 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
145 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
146 public final void setInternal(DynamicObject store, Object value) throws IncompatibleLocationException { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
147 ((Object[]) getArray(store, false))[index] = value; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
148 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
149 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
150 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
151 public boolean canStore(Object value) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
152 return true; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
153 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
154 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
155 public Class<? extends Object> getType() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
156 return Object.class; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
157 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
158 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
159 public final boolean isNonNull() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
160 return false; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
161 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
162 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
163 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
164 public int objectArrayCount() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
165 return OBJECT_SIZE; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
166 } |
18795
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
167 |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
168 @Override |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
169 public final void accept(LocationVisitor locationVisitor) { |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
170 locationVisitor.visitObjectArray(index, OBJECT_SIZE); |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
171 } |
18408
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
172 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
173 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
174 public static class ObjectFieldLocation extends MethodHandleFieldLocation implements ObjectLocation { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
175 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
176 public ObjectFieldLocation(int index, MethodHandle getter, MethodHandle setter) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
177 super(index, getter, setter); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
178 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
179 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
180 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
181 public Object get(DynamicObject store, boolean condition) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
182 try { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
183 return getter.invokeExact(store); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
184 } catch (Throwable e) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
185 CompilerDirectives.transferToInterpreter(); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
186 throw new IllegalStateException(e); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
187 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
188 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
189 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
190 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
191 public final void setInternal(DynamicObject store, Object value) throws IncompatibleLocationException { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
192 try { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
193 setter.invokeExact(store, value); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
194 } catch (Throwable e) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
195 CompilerDirectives.transferToInterpreter(); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
196 throw new IllegalStateException(e); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
197 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
198 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
199 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
200 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
201 public boolean canStore(Object value) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
202 return true; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
203 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
204 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
205 public Class<? extends Object> getType() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
206 return Object.class; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
207 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
208 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
209 public boolean isNonNull() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
210 return false; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
211 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
212 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
213 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
214 public int objectFieldCount() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
215 return OBJECT_SIZE; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
216 } |
18795
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
217 |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
218 @Override |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
219 public final void accept(LocationVisitor locationVisitor) { |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
220 locationVisitor.visitObjectField(getIndex(), OBJECT_SIZE); |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
221 } |
18408
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
222 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
223 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
224 public abstract static class SimpleObjectFieldLocation extends FieldLocation implements ObjectLocation { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
225 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
226 public SimpleObjectFieldLocation(int index) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
227 super(index); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
228 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
229 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
230 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
231 public abstract Object get(DynamicObject store, boolean condition); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
232 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
233 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
234 public abstract void setInternal(DynamicObject store, Object value); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
235 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
236 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
237 public boolean canStore(Object value) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
238 return true; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
239 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
240 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
241 public Class<? extends Object> getType() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
242 return Object.class; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
243 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
244 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
245 public boolean isNonNull() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
246 return false; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
247 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
248 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
249 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
250 public int objectFieldCount() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
251 return OBJECT_SIZE; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
252 } |
18795
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
253 |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
254 @Override |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
255 public final void accept(LocationVisitor locationVisitor) { |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
256 locationVisitor.visitObjectField(getIndex(), OBJECT_SIZE); |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
257 } |
18408
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
258 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
259 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
260 public static class LongArrayLocation extends ArrayLocation implements InternalLongLocation { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
261 protected final boolean allowInt; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
262 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
263 public LongArrayLocation(int index, Location arrayLocation, boolean allowInt) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
264 super(index, arrayLocation); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
265 this.allowInt = allowInt; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
266 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
267 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
268 public LongArrayLocation(int index, Location arrayLocation) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
269 this(index, arrayLocation, false); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
270 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
271 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
272 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
273 public final Object get(DynamicObject store, boolean condition) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
274 return getLong(store, condition); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
275 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
276 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
277 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
278 public final void setInternal(DynamicObject store, Object value) throws IncompatibleLocationException { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
279 if (canStore(value)) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
280 setLongInternal(store, ((Number) value).longValue()); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
281 } else { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
282 throw incompatibleLocation(); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
283 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
284 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
285 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
286 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
287 public long getLong(DynamicObject store, boolean condition) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
288 return ((long[]) getArray(store, condition))[index]; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
289 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
290 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
291 public final void setLongInternal(DynamicObject store, long value) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
292 ((long[]) getArray(store, false))[index] = value; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
293 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
294 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
295 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
296 public void setLong(DynamicObject store, long value, Shape shape) throws FinalLocationException { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
297 setLongInternal(store, value); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
298 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
299 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
300 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
301 public final void setLong(DynamicObject store, long value, Shape oldShape, Shape newShape) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
302 store.setShapeAndGrow(oldShape, newShape); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
303 setLongInternal(store, value); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
304 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
305 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
306 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
307 public final void setLong(DynamicObject store, long value) throws FinalLocationException { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
308 setLong(store, value, null); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
309 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
310 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
311 public final long getLong(DynamicObject store, Shape shape) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
312 return getLong(store, checkShape(store, shape)); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
313 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
314 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
315 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
316 public final boolean canStore(Object value) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
317 return value instanceof Long || (allowInt && value instanceof Integer); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
318 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
319 |
18795
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
320 public final Class<Long> getType() { |
18408
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
321 return long.class; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
322 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
323 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
324 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
325 public int primitiveArrayCount() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
326 return LONG_SIZE; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
327 } |
18795
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
328 |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
329 @Override |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
330 public final void accept(LocationVisitor locationVisitor) { |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
331 locationVisitor.visitPrimitiveArray(getIndex(), LONG_SIZE); |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
332 } |
18408
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
333 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
334 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
335 public static class LongFieldLocation extends MethodHandleFieldLocation implements InternalLongLocation { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
336 public LongFieldLocation(int index, MethodHandle getter, MethodHandle setter) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
337 super(index, getter, setter); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
338 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
339 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
340 public static LongLocation create(InternalLongLocation longLocation, boolean allowInt) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
341 if ((!allowInt && (longLocation instanceof LongLocationDecorator)) || (longLocation instanceof LongLocationDecorator && ((LongLocationDecorator) longLocation).allowInt == allowInt)) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
342 return longLocation; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
343 } else { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
344 return new LongLocationDecorator(longLocation, allowInt); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
345 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
346 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
347 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
348 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
349 public final Object get(DynamicObject store, boolean condition) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
350 return getLong(store, condition); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
351 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
352 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
353 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
354 public final void setInternal(DynamicObject store, Object value) throws IncompatibleLocationException { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
355 if (canStore(value)) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
356 setLongInternal(store, (long) value); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
357 } else { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
358 throw incompatibleLocation(); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
359 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
360 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
361 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
362 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
363 public final boolean canStore(Object value) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
364 return value instanceof Long; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
365 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
366 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
367 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
368 public final void setLong(DynamicObject store, long value, Shape oldShape, Shape newShape) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
369 store.setShapeAndGrow(oldShape, newShape); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
370 setLongInternal(store, value); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
371 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
372 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
373 public long getLong(DynamicObject store, boolean condition) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
374 try { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
375 return (long) getter.invokeExact(store); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
376 } catch (Throwable e) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
377 CompilerDirectives.transferToInterpreter(); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
378 throw new IllegalStateException(e); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
379 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
380 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
381 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
382 public void setLong(DynamicObject store, long value, Shape shape) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
383 setLongInternal(store, value); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
384 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
385 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
386 public final void setLong(DynamicObject store, long value) throws FinalLocationException { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
387 setLong(store, value, null); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
388 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
389 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
390 public final void setLongInternal(DynamicObject store, long value) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
391 try { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
392 setter.invokeExact(store, value); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
393 } catch (Throwable e) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
394 CompilerDirectives.transferToInterpreter(); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
395 throw new IllegalStateException(e); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
396 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
397 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
398 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
399 public final long getLong(DynamicObject store, Shape shape) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
400 return getLong(store, checkShape(store, shape)); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
401 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
402 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
403 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
404 public final int primitiveFieldCount() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
405 return LONG_SIZE; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
406 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
407 |
18795
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
408 public final Class<Long> getType() { |
18408
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
409 return long.class; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
410 } |
18795
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
411 |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
412 @Override |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
413 public final void accept(LocationVisitor locationVisitor) { |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
414 locationVisitor.visitPrimitiveField(getIndex(), LONG_SIZE); |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
415 } |
18408
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
416 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
417 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
418 public static class LongLocationDecorator extends PrimitiveLocationDecorator implements InternalLongLocation { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
419 protected final boolean allowInt; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
420 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
421 public LongLocationDecorator(InternalLongLocation longLocation, boolean allowInt) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
422 super(longLocation); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
423 this.allowInt = allowInt; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
424 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
425 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
426 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
427 public final Object get(DynamicObject store, boolean condition) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
428 return getLong(store, condition); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
429 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
430 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
431 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
432 public final void setInternal(DynamicObject store, Object value) throws IncompatibleLocationException { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
433 if (canStore(value)) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
434 setLongInternal(store, ((Number) value).longValue()); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
435 } else { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
436 throw incompatibleLocation(); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
437 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
438 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
439 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
440 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
441 public final boolean canStore(Object value) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
442 return value instanceof Long || (allowInt && value instanceof Integer); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
443 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
444 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
445 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
446 public final void setLong(DynamicObject store, long value, Shape oldShape, Shape newShape) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
447 store.setShapeAndGrow(oldShape, newShape); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
448 setLongInternal(store, value); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
449 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
450 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
451 public Class<Long> getType() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
452 return long.class; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
453 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
454 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
455 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
456 public abstract static class SimpleLongFieldLocation extends FieldLocation implements InternalLongLocation { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
457 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
458 public SimpleLongFieldLocation(int index) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
459 super(index); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
460 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
461 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
462 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
463 public final Object get(DynamicObject store, boolean condition) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
464 return getLong(store, condition); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
465 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
466 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
467 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
468 public final void setInternal(DynamicObject store, Object value) throws IncompatibleLocationException { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
469 if (canStore(value)) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
470 setLongInternal(store, ((Number) value).longValue()); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
471 } else { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
472 throw incompatibleLocation(); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
473 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
474 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
475 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
476 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
477 public final boolean canStore(Object value) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
478 return value instanceof Long; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
479 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
480 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
481 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
482 public final void setLong(DynamicObject store, long value, Shape oldShape, Shape newShape) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
483 store.setShapeAndGrow(oldShape, newShape); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
484 setLongInternal(store, value); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
485 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
486 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
487 public abstract long getLong(DynamicObject store, boolean condition); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
488 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
489 public final long getLong(DynamicObject store, Shape shape) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
490 return getLong(store, checkShape(store, shape)); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
491 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
492 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
493 public final void setLong(DynamicObject store, long value) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
494 setLong(store, value, null); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
495 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
496 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
497 public void setLong(DynamicObject store, long value, Shape shape) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
498 setLongInternal(store, value); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
499 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
500 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
501 public abstract void setLongInternal(DynamicObject store, long value); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
502 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
503 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
504 public final int primitiveFieldCount() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
505 return LONG_SIZE; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
506 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
507 |
18795
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
508 public final Class<Long> getType() { |
18408
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
509 return long.class; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
510 } |
18795
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
511 |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
512 @Override |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
513 public final void accept(LocationVisitor locationVisitor) { |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
514 locationVisitor.visitPrimitiveField(getIndex(), LONG_SIZE); |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
515 } |
18408
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
516 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
517 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
518 public abstract static class PrimitiveLocationDecorator extends LocationImpl { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
519 private final InternalLongLocation longLocation; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
520 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
521 public PrimitiveLocationDecorator(InternalLongLocation longLocation) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
522 this.longLocation = longLocation; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
523 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
524 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
525 public final long getLong(DynamicObject store, Shape shape) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
526 return longLocation.getLong(store, shape); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
527 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
528 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
529 public final long getLong(DynamicObject store, boolean condition) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
530 return longLocation.getLong(store, condition); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
531 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
532 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
533 public final void setLong(DynamicObject store, long value, Shape shape) throws FinalLocationException { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
534 longLocation.setLong(store, value, shape); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
535 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
536 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
537 public final void setLong(DynamicObject store, long value) throws FinalLocationException { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
538 longLocation.setLong(store, value); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
539 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
540 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
541 public final void setLongInternal(DynamicObject store, long value) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
542 longLocation.setLongInternal(store, value); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
543 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
544 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
545 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
546 public final int primitiveFieldCount() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
547 return ((LocationImpl) longLocation).primitiveFieldCount(); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
548 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
549 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
550 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
551 public final int primitiveArrayCount() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
552 return ((LocationImpl) longLocation).primitiveArrayCount(); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
553 } |
18795
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
554 |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
555 @Override |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
556 public final void accept(LocationVisitor locationVisitor) { |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
557 ((LocationImpl) longLocation).accept(locationVisitor); |
e9cbe1618733
Truffle: refactor size calculation in location allocator to visitor pattern
Andreas Woess <andreas.woess@jku.at>
parents:
18408
diff
changeset
|
558 } |
18408
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
559 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
560 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
561 public static class IntLocationDecorator extends PrimitiveLocationDecorator implements IntLocation { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
562 public IntLocationDecorator(InternalLongLocation longLocation) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
563 super(longLocation); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
564 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
565 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
566 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
567 public final Object get(DynamicObject store, boolean condition) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
568 return getInt(store, condition); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
569 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
570 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
571 public int getInt(DynamicObject store, boolean condition) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
572 return (int) getLong(store, condition); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
573 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
574 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
575 public void setInt(DynamicObject store, int value, Shape shape) throws FinalLocationException { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
576 setLong(store, value, shape); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
577 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
578 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
579 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
580 public final void setInt(DynamicObject store, int value) throws FinalLocationException { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
581 setInt(store, value, null); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
582 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
583 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
584 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
585 public final void setInternal(DynamicObject store, Object value) throws IncompatibleLocationException { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
586 if (canStore(value)) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
587 setLongInternal(store, (int) value); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
588 } else { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
589 throw incompatibleLocation(); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
590 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
591 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
592 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
593 public final int getInt(DynamicObject store, Shape shape) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
594 return getInt(store, checkShape(store, shape)); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
595 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
596 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
597 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
598 public final boolean canStore(Object value) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
599 return value instanceof Integer; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
600 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
601 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
602 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
603 public final void setInt(DynamicObject store, int value, Shape oldShape, Shape newShape) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
604 store.setShapeAndGrow(oldShape, newShape); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
605 setLongInternal(store, value); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
606 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
607 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
608 public Class<Integer> getType() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
609 return int.class; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
610 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
611 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
612 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
613 public static class DoubleLocationDecorator extends PrimitiveLocationDecorator implements DoubleLocation { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
614 private final boolean allowInt; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
615 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
616 public DoubleLocationDecorator(InternalLongLocation longLocation, boolean allowInt) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
617 super(longLocation); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
618 this.allowInt = allowInt; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
619 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
620 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
621 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
622 public final Object get(DynamicObject store, boolean condition) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
623 return getDouble(store, condition); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
624 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
625 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
626 public double getDouble(DynamicObject store, boolean condition) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
627 return Double.longBitsToDouble(getLong(store, condition)); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
628 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
629 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
630 public void setDouble(DynamicObject store, double value, Shape shape) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
631 setLongInternal(store, Double.doubleToRawLongBits(value)); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
632 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
633 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
634 public void setDouble(DynamicObject store, double value) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
635 setDouble(store, value, null); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
636 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
637 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
638 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
639 public final void setInternal(DynamicObject store, Object value) throws IncompatibleLocationException { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
640 if (canStore(value)) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
641 setDouble(store, ((Number) value).doubleValue(), null); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
642 } else { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
643 throw incompatibleLocation(); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
644 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
645 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
646 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
647 public final double getDouble(DynamicObject store, Shape shape) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
648 return getDouble(store, checkShape(store, shape)); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
649 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
650 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
651 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
652 public final boolean canStore(Object value) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
653 return value instanceof Double || (allowInt && value instanceof Integer); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
654 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
655 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
656 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
657 public final void setDouble(DynamicObject store, double value, Shape oldShape, Shape newShape) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
658 store.setShapeAndGrow(oldShape, newShape); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
659 setDouble(store, value, newShape); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
660 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
661 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
662 public Class<Double> getType() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
663 return double.class; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
664 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
665 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
666 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
667 public static class BooleanLocationDecorator extends PrimitiveLocationDecorator implements BooleanLocation { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
668 public BooleanLocationDecorator(InternalLongLocation longLocation) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
669 super(longLocation); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
670 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
671 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
672 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
673 public final Object get(DynamicObject store, boolean condition) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
674 return getBoolean(store, condition); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
675 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
676 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
677 public boolean getBoolean(DynamicObject store, boolean condition) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
678 return getLong(store, condition) != 0; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
679 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
680 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
681 public void setBoolean(DynamicObject store, boolean value, Shape shape) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
682 setLongInternal(store, value ? 1 : 0); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
683 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
684 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
685 public void setBoolean(DynamicObject store, boolean value) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
686 setBoolean(store, value, null); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
687 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
688 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
689 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
690 public final void setInternal(DynamicObject store, Object value) throws IncompatibleLocationException { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
691 if (canStore(value)) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
692 setBoolean(store, (boolean) value, null); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
693 } else { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
694 throw incompatibleLocation(); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
695 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
696 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
697 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
698 public final boolean getBoolean(DynamicObject store, Shape shape) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
699 return getBoolean(store, checkShape(store, shape)); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
700 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
701 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
702 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
703 public final boolean canStore(Object value) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
704 return value instanceof Boolean; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
705 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
706 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
707 @Override |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
708 public final void setBoolean(DynamicObject store, boolean value, Shape oldShape, Shape newShape) { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
709 store.setShapeAndGrow(oldShape, newShape); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
710 setBoolean(store, value, newShape); |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
711 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
712 |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
713 public Class<Boolean> getType() { |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
714 return boolean.class; |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
715 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
716 } |
2c3666f44855
Truffle: initial commit of object API implementation
Andreas Woess <andreas.woess@jku.at>
parents:
diff
changeset
|
717 } |