< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphProtocol.java

Print this page




 510             writeByte(POOL_FIELD);
 511             writePoolObject(findFieldDeclaringClass(field));
 512             writePoolObject(findFieldName(field));
 513             writePoolObject(findFieldTypeName(field));
 514             writeInt(findFieldModifiers(field));
 515         } else if ((signature = findSignature(object)) != null) {
 516             writeByte(POOL_SIGNATURE);
 517             int args = findSignatureParameterCount(signature);
 518             writeShort((char) args);
 519             for (int i = 0; i < args; i++) {
 520                 writePoolObject(findSignatureParameterTypeName(signature, i));
 521             }
 522             writePoolObject(findSignatureReturnTypeName(signature));
 523         } else if (versionMajor >= 4 && (pos = findNodeSourcePosition(object)) != null) {
 524             writeByte(POOL_NODE_SOURCE_POSITION);
 525             ResolvedJavaMethod method = findNodeSourcePositionMethod(pos);
 526             writePoolObject(method);
 527             final int bci = findNodeSourcePositionBCI(pos);
 528             writeInt(bci);
 529             StackTraceElement ste = findMethodStackTraceElement(method, bci, pos);
 530             if (ste != null) {
 531                 writePoolObject(ste.getFileName());
 532                 writeInt(ste.getLineNumber());
 533             } else {
 534                 writePoolObject(null);
 535             }
 536             writePoolObject(findNodeSourcePositionCaller(pos));
 537         } else {
 538             NodeClass nodeClass = findNodeClass(object);
 539             if (nodeClass != null) {
 540                 writeByte(POOL_NODE_CLASS);
 541                 final Object clazz = findJavaClass(nodeClass);
 542                 if (versionMajor >= 3) {
 543                     writePoolObject(clazz);
 544                     writeString(findNameTemplate(nodeClass));
 545                 } else {
 546                     writeString(((Class<?>) clazz).getSimpleName());
 547                     String nameTemplate = findNameTemplate(nodeClass);
 548                     writeString(nameTemplate);
 549                 }
 550                 writeEdgesInfo(nodeClass, true);




 510             writeByte(POOL_FIELD);
 511             writePoolObject(findFieldDeclaringClass(field));
 512             writePoolObject(findFieldName(field));
 513             writePoolObject(findFieldTypeName(field));
 514             writeInt(findFieldModifiers(field));
 515         } else if ((signature = findSignature(object)) != null) {
 516             writeByte(POOL_SIGNATURE);
 517             int args = findSignatureParameterCount(signature);
 518             writeShort((char) args);
 519             for (int i = 0; i < args; i++) {
 520                 writePoolObject(findSignatureParameterTypeName(signature, i));
 521             }
 522             writePoolObject(findSignatureReturnTypeName(signature));
 523         } else if (versionMajor >= 4 && (pos = findNodeSourcePosition(object)) != null) {
 524             writeByte(POOL_NODE_SOURCE_POSITION);
 525             ResolvedJavaMethod method = findNodeSourcePositionMethod(pos);
 526             writePoolObject(method);
 527             final int bci = findNodeSourcePositionBCI(pos);
 528             writeInt(bci);
 529             StackTraceElement ste = findMethodStackTraceElement(method, bci, pos);
 530             if (ste != null && ste.getFileName() != null) {
 531                 writePoolObject(ste.getFileName());
 532                 writeInt(ste.getLineNumber());
 533             } else {
 534                 writePoolObject(null);
 535             }
 536             writePoolObject(findNodeSourcePositionCaller(pos));
 537         } else {
 538             NodeClass nodeClass = findNodeClass(object);
 539             if (nodeClass != null) {
 540                 writeByte(POOL_NODE_CLASS);
 541                 final Object clazz = findJavaClass(nodeClass);
 542                 if (versionMajor >= 3) {
 543                     writePoolObject(clazz);
 544                     writeString(findNameTemplate(nodeClass));
 545                 } else {
 546                     writeString(((Class<?>) clazz).getSimpleName());
 547                     String nameTemplate = findNameTemplate(nodeClass);
 548                     writeString(nameTemplate);
 549                 }
 550                 writeEdgesInfo(nodeClass, true);


< prev index next >