getValueParameters() removed from ScriptDescriptor
This commit is contained in:
@@ -148,8 +148,8 @@ public class ScriptCodegen extends MemberCodegen {
|
|||||||
Type[] argTypes = jvmSignature.getAsmMethod().getArgumentTypes();
|
Type[] argTypes = jvmSignature.getAsmMethod().getArgumentTypes();
|
||||||
int add = 0;
|
int add = 0;
|
||||||
|
|
||||||
for (int i = 0; i < scriptDescriptor.getValueParameters().size(); i++) {
|
for (int i = 0; i < scriptDescriptor.getScriptCodeDescriptor().getValueParameters().size(); i++) {
|
||||||
ValueParameterDescriptor parameter = scriptDescriptor.getValueParameters().get(i);
|
ValueParameterDescriptor parameter = scriptDescriptor.getScriptCodeDescriptor().getValueParameters().get(i);
|
||||||
frameMap.enter(parameter, argTypes[i + add]);
|
frameMap.enter(parameter, argTypes[i + add]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ public class ScriptCodegen extends MemberCodegen {
|
|||||||
instructionAdapter.putfield(classType.getInternalName(), getScriptFieldName(earlierScript), earlierClassType.getDescriptor());
|
instructionAdapter.putfield(classType.getInternalName(), getScriptFieldName(earlierScript), earlierClassType.getDescriptor());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ValueParameterDescriptor parameter : scriptDescriptor.getValueParameters()) {
|
for (ValueParameterDescriptor parameter : scriptDescriptor.getScriptCodeDescriptor().getValueParameters()) {
|
||||||
Type parameterType = typeMapper.mapType(parameter.getType());
|
Type parameterType = typeMapper.mapType(parameter.getType());
|
||||||
instructionAdapter.load(0, classType);
|
instructionAdapter.load(0, classType);
|
||||||
instructionAdapter.load(offset, parameterType);
|
instructionAdapter.load(offset, parameterType);
|
||||||
@@ -197,7 +197,7 @@ public class ScriptCodegen extends MemberCodegen {
|
|||||||
classBuilder.newField(null, access, getScriptFieldName(earlierScript), earlierClassName.getDescriptor(), null, null);
|
classBuilder.newField(null, access, getScriptFieldName(earlierScript), earlierClassName.getDescriptor(), null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ValueParameterDescriptor parameter : script.getValueParameters()) {
|
for (ValueParameterDescriptor parameter : script.getScriptCodeDescriptor().getValueParameters()) {
|
||||||
Type parameterType = typeMapper.mapType(parameter);
|
Type parameterType = typeMapper.mapType(parameter);
|
||||||
int access = ACC_PUBLIC | ACC_FINAL;
|
int access = ACC_PUBLIC | ACC_FINAL;
|
||||||
classBuilder.newField(null, access, parameter.getName().getIdentifier(), parameterType.getDescriptor(), null, null);
|
classBuilder.newField(null, access, parameter.getName().getIdentifier(), parameterType.getDescriptor(), null, null);
|
||||||
|
|||||||
@@ -804,7 +804,7 @@ public class JetTypeMapper extends BindingTraceAware {
|
|||||||
signatureWriter.writeParameterTypeEnd();
|
signatureWriter.writeParameterTypeEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ValueParameterDescriptor valueParameter : script.getValueParameters()) {
|
for (ValueParameterDescriptor valueParameter : script.getScriptCodeDescriptor().getValueParameters()) {
|
||||||
writeParameter(signatureWriter, valueParameter.getType());
|
writeParameter(signatureWriter, valueParameter.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,17 +21,12 @@ import org.jetbrains.jet.lang.descriptors.annotations.Annotated;
|
|||||||
import org.jetbrains.jet.lang.descriptors.impl.ScriptCodeDescriptor;
|
import org.jetbrains.jet.lang.descriptors.impl.ScriptCodeDescriptor;
|
||||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface ScriptDescriptor extends Annotated, DeclarationDescriptor, DeclarationDescriptorNonRoot {
|
public interface ScriptDescriptor extends Annotated, DeclarationDescriptor, DeclarationDescriptorNonRoot {
|
||||||
String LAST_EXPRESSION_VALUE_FIELD_NAME = "rv";
|
String LAST_EXPRESSION_VALUE_FIELD_NAME = "rv";
|
||||||
Name NAME = Name.special("<script>");
|
Name NAME = Name.special("<script>");
|
||||||
|
|
||||||
int getPriority();
|
int getPriority();
|
||||||
|
|
||||||
@NotNull
|
|
||||||
List<ValueParameterDescriptor> getValueParameters();
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
ScriptCodeDescriptor getScriptCodeDescriptor();
|
ScriptCodeDescriptor getScriptCodeDescriptor();
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ public class ScriptDescriptorImpl extends DeclarationDescriptorNonRootImpl imple
|
|||||||
@NotNull List<? extends PropertyDescriptorImpl> properties,
|
@NotNull List<? extends PropertyDescriptorImpl> properties,
|
||||||
@NotNull List<? extends FunctionDescriptor> functions
|
@NotNull List<? extends FunctionDescriptor> functions
|
||||||
) {
|
) {
|
||||||
|
assert valueParameters != null : "setValueParameters() must be called before this method";
|
||||||
scriptCodeDescriptor.initialize(implicitReceiver, valueParameters, returnType);
|
scriptCodeDescriptor.initialize(implicitReceiver, valueParameters, returnType);
|
||||||
|
|
||||||
PropertyDescriptorImpl propertyDescriptor = PropertyDescriptorImpl.create(classDescriptor,
|
PropertyDescriptorImpl propertyDescriptor = PropertyDescriptorImpl.create(classDescriptor,
|
||||||
@@ -120,12 +121,6 @@ public class ScriptDescriptorImpl extends DeclarationDescriptorNonRootImpl imple
|
|||||||
return priority;
|
return priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@NotNull
|
|
||||||
public List<ValueParameterDescriptor> getValueParameters() {
|
|
||||||
return valueParameters;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@NotNull
|
@NotNull
|
||||||
public ScriptCodeDescriptor getScriptCodeDescriptor() {
|
public ScriptCodeDescriptor getScriptCodeDescriptor() {
|
||||||
|
|||||||
Reference in New Issue
Block a user