Skip to content

Commit

Permalink
Update JDK
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlloyd committed Jun 10, 2024
1 parent 82782dc commit 3deda84
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
2 changes: 1 addition & 1 deletion jdk
Submodule jdk updated 135 files
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@

package io.github.dmlloyd.classfile.impl;

import io.github.dmlloyd.classfile.BufWriter;
import io.github.dmlloyd.classfile.ClassReader;
import io.github.dmlloyd.classfile.Label;
import io.github.dmlloyd.classfile.MethodModel;
import io.github.dmlloyd.classfile.attribute.StackMapFrameInfo;
import io.github.dmlloyd.classfile.attribute.StackMapFrameInfo.*;
import io.github.dmlloyd.classfile.constantpool.ClassEntry;
import java.lang.constant.ConstantDescs;
import java.lang.constant.MethodTypeDesc;
import io.github.dmlloyd.classfile.extras.reflect.AccessFlag;
import java.util.List;
import java.util.Objects;
import java.util.TreeMap;
import io.github.dmlloyd.classfile.BufWriter;

import io.github.dmlloyd.classfile.constantpool.ClassEntry;
import io.github.dmlloyd.classfile.attribute.StackMapFrameInfo;
import io.github.dmlloyd.classfile.attribute.StackMapFrameInfo.*;
import io.github.dmlloyd.classfile.ClassReader;

import static io.github.dmlloyd.classfile.ClassFile.*;
import io.github.dmlloyd.classfile.Label;
import io.github.dmlloyd.classfile.MethodModel;

public class StackMapDecoder {

Expand Down Expand Up @@ -240,6 +240,20 @@ public record ObjectVerificationTypeInfoImpl(
@Override
public int tag() { return VT_OBJECT; }

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o instanceof ObjectVerificationTypeInfoImpl that) {
return Objects.equals(className, that.className);
}
return false;
}

@Override
public int hashCode() {
return Objects.hash(className);
}

@Override
public String toString() {
return className.asInternalName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,9 @@ private void setLocalRawInternal(int index, Type type) {
}

void setLocalsFromArg(String name, MethodTypeDesc methodDesc, boolean isStatic, Type thisKlass) {
localsSize = 0;
int localsSize = 0;
// Pre-emptively create a locals array that encompass all parameter slots
checkLocal(methodDesc.parameterCount() + (isStatic ? 0 : -1));
if (!isStatic) {
localsSize++;
if (OBJECT_INITIALIZER_NAME.equals(name) && !CD_Object.equals(thisKlass.sym)) {
Expand All @@ -1057,7 +1059,7 @@ void setLocalsFromArg(String name, MethodTypeDesc methodDesc, boolean isStatic,
}
for (int i = 0; i < methodDesc.parameterCount(); i++) {
var desc = methodDesc.parameterType(i);
if (desc.isClassOrInterface() || desc.isArray()) {
if (!desc.isPrimitive()) {
setLocalRawInternal(localsSize++, Type.referenceType(desc));
} else switch (desc.descriptorString().charAt(0)) {
case 'J' -> {
Expand All @@ -1075,6 +1077,7 @@ void setLocalsFromArg(String name, MethodTypeDesc methodDesc, boolean isStatic,
default -> throw new AssertionError("Should not reach here");
}
}
this.localsSize = localsSize;
}

void copyFrom(Frame src) {
Expand Down

0 comments on commit 3deda84

Please sign in to comment.