Mercurial > hg > graal-jvmci-8
annotate graal/com.oracle.graal.snippets.test/src/com/oracle/graal/snippets/PointerTest.java @ 8413:d9347ee39fbe
rename: SnippetsInterface -> Snippets
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 20 Mar 2013 21:18:59 +0100 |
parents | e996a732c740 |
children |
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 */ |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
23 package com.oracle.graal.snippets; |
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.*; |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
36 import com.oracle.graal.snippets.Snippet.SnippetInliningPolicy; |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
37 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
|
38 |
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 * 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
|
41 */ |
8413
d9347ee39fbe
rename: SnippetsInterface -> Snippets
Doug Simon <doug.simon@oracle.com>
parents:
8410
diff
changeset
|
42 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
|
43 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
44 private static final Object ID = new Object(); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
45 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
|
46 private final TargetDescription target; |
8410
e996a732c740
renamings as part of a move away from the overloading of the "snippet" term for various code replacement/substitution mechanisms towards it being solely for the concept of IR lowering
Doug Simon <doug.simon@oracle.com>
parents:
7904
diff
changeset
|
47 private final ReplacementsInstaller installer; |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
48 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
49 public PointerTest() { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
50 target = Graal.getRequiredCapability(CodeCacheProvider.class).getTarget(); |
8410
e996a732c740
renamings as part of a move away from the overloading of the "snippet" term for various code replacement/substitution mechanisms towards it being solely for the concept of IR lowering
Doug Simon <doug.simon@oracle.com>
parents:
7904
diff
changeset
|
51 installer = new ReplacementsInstaller(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
|
52 } |
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 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
|
55 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
56 @Override |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
57 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
|
58 ResolvedJavaMethod resolvedMethod = runtime.lookupJavaMethod(m); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
59 return installer.makeGraph(resolvedMethod, inliningPolicy.get()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
60 } |
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 @Test |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
63 public void test_read1() { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
64 for (Kind kind : KINDS) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
65 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
|
66 } |
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 @Test |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
70 public void test_read2() { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
71 for (Kind kind : KINDS) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
72 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
|
73 } |
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 @Test |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
77 public void test_read3() { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
78 for (Kind kind : KINDS) { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
79 assertRead(parse("read" + kind.name() + "3"), kind, false, LocationNode.UNKNOWN_LOCATION); |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
80 } |
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 @Test |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
84 public void test_write1() { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
85 for (Kind kind : KINDS) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
86 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
|
87 } |
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 @Test |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
91 public void test_write2() { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
92 for (Kind kind : KINDS) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
93 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
|
94 } |
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 |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
97 @Test |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
98 public void test_write3() { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
99 for (Kind kind : KINDS) { |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
100 assertWrite(parse("write" + kind.name() + "3"), kind, false, LocationNode.ANY_LOCATION); |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
101 } |
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 |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
104 private void assertRead(StructuredGraph graph, Kind kind, boolean indexConvert, Object locationIdentity) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
105 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
|
106 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
|
107 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
108 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
|
109 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
|
110 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
|
111 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
112 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
|
113 Assert.assertEquals(kind, location.getValueKind()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
114 Assert.assertEquals(locationIdentity, location.locationIdentity()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
115 Assert.assertEquals(1, location.indexScaling()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
116 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
117 if (indexConvert) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
118 ConvertNode convert = (ConvertNode) location.index(); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
119 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
|
120 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
|
121 } else { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
122 Assert.assertEquals(graph.getLocal(1), location.index()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
123 } |
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 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
|
126 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
|
127 } |
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 private void assertWrite(StructuredGraph graph, Kind kind, boolean indexConvert, Object locationIdentity) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
130 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
|
131 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
|
132 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
|
133 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
|
134 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
135 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
|
136 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
|
137 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
|
138 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
139 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
|
140 Assert.assertEquals(kind, location.getValueKind()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
141 Assert.assertEquals(locationIdentity, location.locationIdentity()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
142 Assert.assertEquals(1, location.indexScaling()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
143 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
144 if (indexConvert) { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
145 ConvertNode convert = (ConvertNode) location.index(); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
146 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
|
147 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
|
148 } else { |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
149 Assert.assertEquals(graph.getLocal(1), location.index()); |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
150 } |
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 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
|
153 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
|
154 |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
155 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
|
156 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
|
157 } |
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 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
160 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
|
161 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
|
162 } |
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 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
165 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
|
166 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
|
167 } |
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 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
170 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
|
171 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
|
172 } |
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 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
175 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
|
176 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
|
177 } |
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 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
180 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
|
181 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
|
182 } |
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 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
185 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
|
186 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
|
187 } |
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 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
190 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
|
191 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
|
192 } |
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 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
195 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
|
196 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
|
197 } |
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 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
200 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
|
201 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
|
202 } |
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 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
205 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
|
206 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
|
207 } |
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 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
210 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
|
211 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
|
212 } |
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 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
215 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
|
216 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
|
217 } |
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 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
220 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
|
221 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
|
222 } |
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 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
225 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
|
226 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
|
227 } |
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 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
230 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
|
231 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
|
232 } |
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 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
235 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
|
236 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
|
237 } |
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 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
240 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
|
241 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
|
242 } |
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 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
245 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
|
246 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
|
247 } |
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 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
250 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
|
251 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
|
252 } |
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 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
255 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
|
256 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
|
257 } |
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 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
260 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
|
261 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
|
262 } |
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 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
265 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
|
266 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
|
267 } |
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 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
270 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
|
271 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
|
272 } |
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 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
275 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
|
276 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
|
277 } |
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 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
280 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
|
281 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
|
282 } |
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 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
285 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
|
286 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
|
287 } |
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 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
290 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
|
291 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
|
292 } |
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 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
295 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
|
296 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
|
297 } |
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 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
300 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
|
301 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
|
302 } |
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 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
305 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
|
306 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
|
307 } |
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 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
310 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
|
311 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
|
312 } |
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 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
315 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
|
316 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
|
317 } |
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 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
320 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
|
321 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
|
322 } |
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 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
325 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
|
326 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
|
327 } |
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 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
330 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
|
331 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
|
332 } |
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 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
335 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
|
336 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
|
337 } |
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 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
340 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
|
341 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
|
342 } |
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 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
345 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
|
346 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
|
347 } |
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 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
350 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
|
351 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
|
352 } |
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 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
355 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
|
356 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
|
357 } |
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 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
360 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
|
361 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
|
362 } |
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 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
365 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
|
366 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
|
367 } |
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 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
370 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
|
371 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
|
372 } |
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 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
375 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
|
376 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
|
377 } |
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 @Snippet |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
380 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
|
381 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
|
382 } |
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 @Snippet |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
385 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
|
386 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
|
387 } |
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 @Snippet |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
390 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
|
391 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
|
392 } |
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
393 |
7904
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
394 @Snippet |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
395 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
|
396 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
|
397 } |
c8f2002d2194
reintroduce default Word read/write operations, more tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
7903
diff
changeset
|
398 |
7903
f19c4d447e73
more bug fixes and tests for Word read/write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
399 } |