Mercurial > hg > graal-jvmci-8
annotate graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/PointerTest.java @ 9792:06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 21 May 2013 21:46:26 +0200 |
parents | ae5cd887e67c |
children | 00b70a864d3b |
rev | line source |
---|---|
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
1 /* |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
4 * |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
8 * |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
13 * accompanied this code). |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
14 * |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
18 * |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
21 * questions. |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
22 */ |
8944
e7766460ddb3
Move tests into *.test packages.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
8635
diff
changeset
|
23 package com.oracle.graal.replacements.test; |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
24 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
25 import java.lang.reflect.*; |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
26 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
27 import org.junit.*; |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
28 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
29 import com.oracle.graal.api.code.*; |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
30 import com.oracle.graal.api.meta.*; |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
31 import com.oracle.graal.api.runtime.*; |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
32 import com.oracle.graal.compiler.test.*; |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
33 import com.oracle.graal.nodes.*; |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
34 import com.oracle.graal.nodes.calc.*; |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
35 import com.oracle.graal.nodes.extended.*; |
8944
e7766460ddb3
Move tests into *.test packages.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
8635
diff
changeset
|
36 import com.oracle.graal.replacements.*; |
8415
2361bf148c06
rename packages: *snippets* -> *replacements*
Doug Simon <doug.simon@oracle.com>
parents:
8413
diff
changeset
|
37 import com.oracle.graal.replacements.Snippet.*; |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
38 import com.oracle.graal.word.*; |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
39 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
40 /** |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
41 * Tests for the {@link Pointer} read and write operations. |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
42 */ |
8413
d9347ee39fbe
rename: SnippetsInterface -> Snippets
Doug Simon <doug.simon@oracle.com>
parents:
8410
diff
changeset
|
43 public class PointerTest extends GraalCompilerTest implements Snippets { |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
44 |
9792
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
9526
diff
changeset
|
45 private static final LocationIdentity ID = new NamedLocationIdentity("ID"); |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
46 private static final Kind[] KINDS = new Kind[]{Kind.Byte, Kind.Char, Kind.Short, Kind.Int, Kind.Long, Kind.Float, Kind.Double, Kind.Object}; |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
47 private final TargetDescription target; |
8628
77de2f3df379
renames: [HotSpot]ReplacementsInstaller -> [HotSpot]ReplacementsImpl
Doug Simon <doug.simon@oracle.com>
parents:
8416
diff
changeset
|
48 private final ReplacementsImpl installer; |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
49 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
50 public PointerTest() { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
51 target = Graal.getRequiredCapability(CodeCacheProvider.class).getTarget(); |
8628
77de2f3df379
renames: [HotSpot]ReplacementsInstaller -> [HotSpot]ReplacementsImpl
Doug Simon <doug.simon@oracle.com>
parents:
8416
diff
changeset
|
52 installer = new ReplacementsImpl(runtime, new Assumptions(false), target); |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
53 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
54 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
55 private static final ThreadLocal<SnippetInliningPolicy> inliningPolicy = new ThreadLocal<>(); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
56 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
57 @Override |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
58 protected StructuredGraph parse(Method m) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
59 ResolvedJavaMethod resolvedMethod = runtime.lookupJavaMethod(m); |
8631
a5ad23f6f9ca
fixed more concurrency issues in ReplacementsImpl
Doug Simon <doug.simon@oracle.com>
parents:
8628
diff
changeset
|
60 return installer.makeGraph(resolvedMethod, null, inliningPolicy.get()); |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
61 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
62 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
63 @Test |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
64 public void test_read1() { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
65 for (Kind kind : KINDS) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
66 assertRead(parse("read" + kind.name() + "1"), kind, false, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
67 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
68 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
69 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
70 @Test |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
71 public void test_read2() { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
72 for (Kind kind : KINDS) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
73 assertRead(parse("read" + kind.name() + "2"), kind, true, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
74 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
75 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
76 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
77 @Test |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
78 public void test_read3() { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
79 for (Kind kind : KINDS) { |
9792
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
9526
diff
changeset
|
80 assertRead(parse("read" + kind.name() + "3"), kind, false, LocationIdentity.ANY_LOCATION); |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
81 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
82 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
83 |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
84 @Test |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
85 public void test_write1() { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
86 for (Kind kind : KINDS) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
87 assertWrite(parse("write" + kind.name() + "1"), kind, false, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
88 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
89 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
90 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
91 @Test |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
92 public void test_write2() { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
93 for (Kind kind : KINDS) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
94 assertWrite(parse("write" + kind.name() + "2"), kind, true, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
95 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
96 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
97 |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
98 @Test |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
99 public void test_write3() { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
100 for (Kind kind : KINDS) { |
9792
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
9526
diff
changeset
|
101 assertWrite(parse("write" + kind.name() + "3"), kind, false, LocationIdentity.ANY_LOCATION); |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
102 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
103 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
104 |
9526
ae5cd887e67c
Use a LocationIdentity interface instead of just Object for the location identity of a LocationNode
Christian Wimmer <christian.wimmer@oracle.com>
parents:
9525
diff
changeset
|
105 private void assertRead(StructuredGraph graph, Kind kind, boolean indexConvert, LocationIdentity locationIdentity) { |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
106 ReadNode read = (ReadNode) graph.start().next(); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
107 Assert.assertEquals(kind.getStackKind(), read.kind()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
108 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
109 UnsafeCastNode cast = (UnsafeCastNode) read.object(); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
110 Assert.assertEquals(graph.getLocal(0), cast.object()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
111 Assert.assertEquals(target.wordKind, cast.kind()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
112 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
113 IndexedLocationNode location = (IndexedLocationNode) read.location(); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
114 Assert.assertEquals(kind, location.getValueKind()); |
9525
038fa65cbd8d
Consistent naming of accessor methods in the LocationNode class hierarchy
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8944
diff
changeset
|
115 Assert.assertEquals(locationIdentity, location.getLocationIdentity()); |
038fa65cbd8d
Consistent naming of accessor methods in the LocationNode class hierarchy
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8944
diff
changeset
|
116 Assert.assertEquals(1, location.getIndexScaling()); |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
117 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
118 if (indexConvert) { |
9525
038fa65cbd8d
Consistent naming of accessor methods in the LocationNode class hierarchy
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8944
diff
changeset
|
119 ConvertNode convert = (ConvertNode) location.getIndex(); |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
120 Assert.assertEquals(ConvertNode.Op.I2L, convert.opcode); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
121 Assert.assertEquals(graph.getLocal(1), convert.value()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
122 } else { |
9525
038fa65cbd8d
Consistent naming of accessor methods in the LocationNode class hierarchy
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8944
diff
changeset
|
123 Assert.assertEquals(graph.getLocal(1), location.getIndex()); |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
124 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
125 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
126 ReturnNode ret = (ReturnNode) read.next(); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
127 Assert.assertEquals(read, ret.result()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
128 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
129 |
9526
ae5cd887e67c
Use a LocationIdentity interface instead of just Object for the location identity of a LocationNode
Christian Wimmer <christian.wimmer@oracle.com>
parents:
9525
diff
changeset
|
130 private void assertWrite(StructuredGraph graph, Kind kind, boolean indexConvert, LocationIdentity locationIdentity) { |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
131 WriteNode write = (WriteNode) graph.start().next(); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
132 Assert.assertEquals(graph.getLocal(2), write.value()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
133 Assert.assertEquals(Kind.Void, write.kind()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
134 Assert.assertEquals(FrameState.INVALID_FRAMESTATE_BCI, write.stateAfter().bci); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
135 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
136 UnsafeCastNode cast = (UnsafeCastNode) write.object(); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
137 Assert.assertEquals(graph.getLocal(0), cast.object()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
138 Assert.assertEquals(target.wordKind, cast.kind()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
139 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
140 IndexedLocationNode location = (IndexedLocationNode) write.location(); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
141 Assert.assertEquals(kind, location.getValueKind()); |
9525
038fa65cbd8d
Consistent naming of accessor methods in the LocationNode class hierarchy
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8944
diff
changeset
|
142 Assert.assertEquals(locationIdentity, location.getLocationIdentity()); |
038fa65cbd8d
Consistent naming of accessor methods in the LocationNode class hierarchy
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8944
diff
changeset
|
143 Assert.assertEquals(1, location.getIndexScaling()); |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
144 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
145 if (indexConvert) { |
9525
038fa65cbd8d
Consistent naming of accessor methods in the LocationNode class hierarchy
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8944
diff
changeset
|
146 ConvertNode convert = (ConvertNode) location.getIndex(); |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
147 Assert.assertEquals(ConvertNode.Op.I2L, convert.opcode); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
148 Assert.assertEquals(graph.getLocal(1), convert.value()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
149 } else { |
9525
038fa65cbd8d
Consistent naming of accessor methods in the LocationNode class hierarchy
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8944
diff
changeset
|
150 Assert.assertEquals(graph.getLocal(1), location.getIndex()); |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
151 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
152 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
153 AbstractStateSplit stateSplit = (AbstractStateSplit) write.next(); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
154 Assert.assertEquals(FrameState.AFTER_BCI, stateSplit.stateAfter().bci); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
155 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
156 ReturnNode ret = (ReturnNode) stateSplit.next(); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
157 Assert.assertEquals(null, ret.result()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
158 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
159 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
160 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
161 public static byte readByte1(Object o, int offset) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
162 return Word.fromObject(o).readByte(offset, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
163 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
164 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
165 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
166 public static byte readByte2(Object o, int offset) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
167 return Word.fromObject(o).readByte(Word.signed(offset), ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
168 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
169 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
170 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
171 public static byte readByte3(Object o, int offset) { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
172 return Word.fromObject(o).readByte(offset); |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
173 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
174 |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
175 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
176 public static void writeByte1(Object o, int offset, byte value) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
177 Word.fromObject(o).writeByte(offset, value, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
178 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
179 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
180 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
181 public static void writeByte2(Object o, int offset, byte value) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
182 Word.fromObject(o).writeByte(Word.signed(offset), value, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
183 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
184 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
185 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
186 public static void writeByte3(Object o, int offset, byte value) { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
187 Word.fromObject(o).writeByte(offset, value); |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
188 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
189 |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
190 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
191 public static char readChar1(Object o, int offset) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
192 return Word.fromObject(o).readChar(offset, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
193 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
194 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
195 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
196 public static char readChar2(Object o, int offset) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
197 return Word.fromObject(o).readChar(Word.signed(offset), ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
198 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
199 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
200 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
201 public static char readChar3(Object o, int offset) { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
202 return Word.fromObject(o).readChar(offset); |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
203 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
204 |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
205 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
206 public static void writeChar1(Object o, int offset, char value) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
207 Word.fromObject(o).writeChar(offset, value, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
208 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
209 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
210 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
211 public static void writeChar2(Object o, int offset, char value) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
212 Word.fromObject(o).writeChar(Word.signed(offset), value, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
213 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
214 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
215 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
216 public static void writeChar3(Object o, int offset, char value) { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
217 Word.fromObject(o).writeChar(offset, value); |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
218 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
219 |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
220 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
221 public static short readShort1(Object o, int offset) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
222 return Word.fromObject(o).readShort(offset, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
223 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
224 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
225 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
226 public static short readShort2(Object o, int offset) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
227 return Word.fromObject(o).readShort(Word.signed(offset), ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
228 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
229 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
230 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
231 public static short readShort3(Object o, int offset) { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
232 return Word.fromObject(o).readShort(offset); |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
233 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
234 |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
235 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
236 public static void writeShort1(Object o, int offset, short value) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
237 Word.fromObject(o).writeShort(offset, value, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
238 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
239 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
240 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
241 public static void writeShort2(Object o, int offset, short value) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
242 Word.fromObject(o).writeShort(Word.signed(offset), value, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
243 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
244 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
245 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
246 public static void writeShort3(Object o, int offset, short value) { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
247 Word.fromObject(o).writeShort(offset, value); |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
248 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
249 |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
250 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
251 public static int readInt1(Object o, int offset) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
252 return Word.fromObject(o).readInt(offset, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
253 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
254 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
255 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
256 public static int readInt2(Object o, int offset) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
257 return Word.fromObject(o).readInt(Word.signed(offset), ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
258 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
259 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
260 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
261 public static int readInt3(Object o, int offset) { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
262 return Word.fromObject(o).readInt(offset); |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
263 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
264 |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
265 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
266 public static void writeInt1(Object o, int offset, int value) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
267 Word.fromObject(o).writeInt(offset, value, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
268 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
269 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
270 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
271 public static void writeInt2(Object o, int offset, int value) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
272 Word.fromObject(o).writeInt(Word.signed(offset), value, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
273 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
274 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
275 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
276 public static void writeInt3(Object o, int offset, int value) { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
277 Word.fromObject(o).writeInt(offset, value); |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
278 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
279 |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
280 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
281 public static long readLong1(Object o, int offset) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
282 return Word.fromObject(o).readLong(offset, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
283 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
284 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
285 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
286 public static long readLong2(Object o, int offset) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
287 return Word.fromObject(o).readLong(Word.signed(offset), ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
288 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
289 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
290 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
291 public static long readLong3(Object o, int offset) { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
292 return Word.fromObject(o).readLong(offset); |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
293 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
294 |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
295 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
296 public static void writeLong1(Object o, int offset, long value) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
297 Word.fromObject(o).writeLong(offset, value, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
298 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
299 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
300 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
301 public static void writeLong2(Object o, int offset, long value) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
302 Word.fromObject(o).writeLong(Word.signed(offset), value, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
303 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
304 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
305 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
306 public static void writeLong3(Object o, int offset, long value) { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
307 Word.fromObject(o).writeLong(offset, value); |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
308 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
309 |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
310 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
311 public static float readFloat1(Object o, int offset) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
312 return Word.fromObject(o).readFloat(offset, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
313 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
314 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
315 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
316 public static float readFloat2(Object o, int offset) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
317 return Word.fromObject(o).readFloat(Word.signed(offset), ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
318 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
319 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
320 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
321 public static float readFloat3(Object o, int offset) { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
322 return Word.fromObject(o).readFloat(offset); |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
323 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
324 |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
325 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
326 public static void writeFloat1(Object o, int offset, float value) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
327 Word.fromObject(o).writeFloat(offset, value, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
328 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
329 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
330 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
331 public static void writeFloat2(Object o, int offset, float value) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
332 Word.fromObject(o).writeFloat(Word.signed(offset), value, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
333 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
334 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
335 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
336 public static void writeFloat3(Object o, int offset, float value) { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
337 Word.fromObject(o).writeFloat(offset, value); |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
338 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
339 |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
340 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
341 public static double readDouble1(Object o, int offset) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
342 return Word.fromObject(o).readDouble(offset, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
343 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
344 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
345 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
346 public static double readDouble2(Object o, int offset) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
347 return Word.fromObject(o).readDouble(Word.signed(offset), ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
348 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
349 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
350 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
351 public static double readDouble3(Object o, int offset) { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
352 return Word.fromObject(o).readDouble(offset); |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
353 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
354 |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
355 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
356 public static void writeDouble1(Object o, int offset, double value) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
357 Word.fromObject(o).writeDouble(offset, value, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
358 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
359 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
360 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
361 public static void writeDouble2(Object o, int offset, double value) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
362 Word.fromObject(o).writeDouble(Word.signed(offset), value, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
363 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
364 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
365 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
366 public static void writeDouble3(Object o, int offset, double value) { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
367 Word.fromObject(o).writeDouble(offset, value); |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
368 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
369 |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
370 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
371 public static Object readObject1(Object o, int offset) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
372 return Word.fromObject(o).readObject(offset, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
373 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
374 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
375 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
376 public static Object readObject2(Object o, int offset) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
377 return Word.fromObject(o).readObject(Word.signed(offset), ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
378 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
379 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
380 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
381 public static Object readObject3(Object o, int offset) { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
382 return Word.fromObject(o).readObject(offset); |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
383 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
384 |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
385 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
386 public static void writeObject1(Object o, int offset, Object value) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
387 Word.fromObject(o).writeObject(offset, value, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
388 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
389 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
390 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
391 public static void writeObject2(Object o, int offset, Object value) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
392 Word.fromObject(o).writeObject(Word.signed(offset), value, ID); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
393 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
394 |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
395 @Snippet |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
396 public static void writeObject3(Object o, int offset, Object value) { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
397 Word.fromObject(o).writeObject(offset, value); |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
398 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
399 |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
400 } |