more followFars
This commit is contained in:
parent
9ec8a9b67e
commit
1689a743d2
2 changed files with 23 additions and 1 deletions
|
@ -1251,6 +1251,9 @@ private:
|
||||||
structNode.getDiscriminantOffset(), ")];\n",
|
structNode.getDiscriminantOffset(), ")];\n",
|
||||||
spaces(indent), " }\n")
|
spaces(indent), " }\n")
|
||||||
: kj::strTree()),
|
: kj::strTree()),
|
||||||
|
spaces(indent), " public final Reader asReader() {\n",
|
||||||
|
spaces(indent), " return new Reader(this._builder.asReader());\n",
|
||||||
|
spaces(indent), " }\n",
|
||||||
kj::mv(methodDecls),
|
kj::mv(methodDecls),
|
||||||
spaces(indent), "}\n",
|
spaces(indent), "}\n",
|
||||||
"\n");
|
"\n");
|
||||||
|
|
|
@ -112,7 +112,26 @@ final class WireHelpers {
|
||||||
//# so there are no FAR pointers.
|
//# so there are no FAR pointers.
|
||||||
if (segment != null && WirePointer.kind(ref) == WirePointer.FAR) {
|
if (segment != null && WirePointer.kind(ref) == WirePointer.FAR) {
|
||||||
|
|
||||||
|
SegmentReader resultSegment = segment.arena.tryGetSegment(FarPointer.getSegmentId(ref));
|
||||||
|
|
||||||
|
int ptr = FarPointer.positionInSegment(ref);
|
||||||
|
|
||||||
|
int padWords = FarPointer.isDoubleFar(ref) ? 2 : 1;
|
||||||
|
// TODO read limiting
|
||||||
|
|
||||||
|
int pad = ptr;
|
||||||
|
|
||||||
|
if (!FarPointer.isDoubleFar(ref)) {
|
||||||
|
|
||||||
|
return new FollowFarsResult(WirePointer.target(pad,
|
||||||
|
WirePointer.get(resultSegment.buffer, pad)),
|
||||||
|
pad, resultSegment);
|
||||||
|
} else {
|
||||||
|
//# Landing pad is another far pointer. It is
|
||||||
|
//# followed by a tag describing the pointed-to
|
||||||
|
//# object.
|
||||||
throw new Error("unimplemented");
|
throw new Error("unimplemented");
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return new FollowFarsResult(refTarget, ref, segment);
|
return new FollowFarsResult(refTarget, ref, segment);
|
||||||
|
|
Loading…
Reference in a new issue