Restored back temporarily renamed properties

This commit is contained in:
Valentin Kipyatkov
2015-09-30 22:50:27 +03:00
parent 6466facffa
commit 5afa91d4ec
50 changed files with 84 additions and 91 deletions
@@ -2758,7 +2758,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
JetType type = bindingContext.getType(expression);
assert type != null;
assert state.getReflectionTypes().getTEMP_kClass().getTypeConstructor().equals(type.getConstructor())
assert state.getReflectionTypes().getkClass().getTypeConstructor().equals(type.getConstructor())
: "::class expression should be type checked to a KClass: " + type;
return generateClassLiteralReference(typeMapper, KotlinPackage.single(type.getArguments()).getType());
@@ -19,7 +19,7 @@ package org.jetbrains.kotlin.codegen.inline
import com.google.common.collect.LinkedListMultimap
import java.util.ArrayList
import com.intellij.util.containers.Stack
import org.jetbrains.kotlin.codegen.optimization.common.TEMP_isMeaningful
import org.jetbrains.kotlin.codegen.optimization.common.isMeaningful
import org.jetbrains.org.objectweb.asm.Opcodes
import org.jetbrains.org.objectweb.asm.tree.*
import java.util.Comparator
@@ -157,7 +157,7 @@ class IntervalMetaInfo<T : SplittableInterval<T>> {
private fun Interval.isMeaningless(): Boolean {
val start = this.startLabel
var end: AbstractInsnNode = this.endLabel
while (end != start && !end.TEMP_isMeaningful) {
while (end != start && !end.isMeaningful) {
end = end.getPrevious()
}
return start == end
@@ -522,7 +522,7 @@ public class InternalFinallyBlockInliner extends CoveringTryCatchNodeProcessor {
@Nullable
private static AbstractInsnNode getNextMeaningful(@NotNull AbstractInsnNode node) {
AbstractInsnNode result = node.getNext();
while (result != null && !CommonPackage.getTEMP_isMeaningful(result)) {
while (result != null && !CommonPackage.getIsMeaningful(result)) {
result = result.getNext();
}
return result;
@@ -19,7 +19,7 @@ package org.jetbrains.kotlin.codegen.optimization
import org.jetbrains.org.objectweb.asm.tree.MethodNode
import org.jetbrains.kotlin.codegen.optimization.transformer.MethodTransformer
import org.jetbrains.kotlin.codegen.optimization.common.OptimizationBasicInterpreter
import org.jetbrains.kotlin.codegen.optimization.common.TEMP_isMeaningful
import org.jetbrains.kotlin.codegen.optimization.common.isMeaningful
public class DeadCodeEliminationMethodTransformer : MethodTransformer() {
override fun transform(internalClassName: String, methodNode: MethodNode) {
@@ -31,7 +31,7 @@ public class DeadCodeEliminationMethodTransformer : MethodTransformer() {
// by try/catch blocks or local variables table
// We remove unneeded ones further after all optimizations by calling CommonPackage.prepareForEmitting(methodNode)
insnsArray.zip(frames).filter {
it.second == null && it.first.TEMP_isMeaningful
it.second == null && it.first.isMeaningful
}.forEach { insnList.remove(it.first) }
}
}
@@ -22,7 +22,7 @@ import org.jetbrains.org.objectweb.asm.tree.AbstractInsnNode
import org.jetbrains.org.objectweb.asm.tree.LabelNode
import org.jetbrains.org.objectweb.asm.Opcodes
import org.jetbrains.org.objectweb.asm.tree.JumpInsnNode
import org.jetbrains.kotlin.codegen.optimization.common.TEMP_isMeaningful
import org.jetbrains.kotlin.codegen.optimization.common.isMeaningful
public class RedundantGotoMethodTransformer : MethodTransformer() {
/**
@@ -34,7 +34,7 @@ public class RedundantGotoMethodTransformer : MethodTransformer() {
val currentLabels = hashSetOf<LabelNode>()
for (insn in insns.reverse()) {
if (insn.TEMP_isMeaningful) {
if (insn.isMeaningful) {
if (insn.getOpcode() == Opcodes.GOTO && (insn as JumpInsnNode).label in currentLabels) {
insnsToRemove.add(insn)
}
@@ -21,7 +21,7 @@ import org.jetbrains.org.objectweb.asm.tree.InsnList
import org.jetbrains.org.objectweb.asm.tree.MethodNode
import org.jetbrains.org.objectweb.asm.tree.analysis.BasicValue
val AbstractInsnNode.TEMP_isMeaningful: Boolean get() =
val AbstractInsnNode.isMeaningful: Boolean get() =
when (this.getType()) {
AbstractInsnNode.LABEL, AbstractInsnNode.LINE, AbstractInsnNode.FRAME -> false
else -> true
@@ -46,21 +46,21 @@ public class InsnSequence(val from: AbstractInsnNode, val to: AbstractInsnNode?)
fun MethodNode.prepareForEmitting() {
tryCatchBlocks = tryCatchBlocks.filter { tcb ->
InsnSequence(tcb.start, tcb.end).any { insn ->
insn.TEMP_isMeaningful
insn.isMeaningful
}
}
// local variables with live ranges starting after last meaningful instruction lead to VerifyError
localVariables = localVariables.filter { lv ->
InsnSequence(lv.start, lv.end).any { insn ->
insn.TEMP_isMeaningful
insn.isMeaningful
}
}
// We should remove linenumbers after last meaningful instruction
// because they point to index of non-existing instruction and it leads to VerifyError
var current = instructions.getLast()
while (!current.TEMP_isMeaningful) {
while (!current.isMeaningful) {
val prev = current.getPrevious()
if (current.getType() == AbstractInsnNode.LINE) {
@@ -363,7 +363,7 @@ public class ReplInterpreter {
private void setReplScriptExecuting(boolean isExecuting) {
if (replReader != null) {
replReader.setTEMP_isReplScriptExecuting(isExecuting);
replReader.setIsReplScriptExecuting(isExecuting);
}
}
@@ -33,11 +33,11 @@ public class ReplSystemInWrapper(
private val isAtBufferEnd: Boolean
get() = curBytePos == inputByteArray.size()
@Volatile var TEMP_isReplScriptExecuting = false
@Volatile var isReplScriptExecuting = false
override fun read(): Int {
if (isLastByteProcessed) {
if (TEMP_isReplScriptExecuting) {
if (isReplScriptExecuting) {
isReadLineStartSent = false
replWriter.printlnReadLineEnd()
}
@@ -47,7 +47,7 @@ public class ReplSystemInWrapper(
}
while (isXmlIncomplete) {
if (!isReadLineStartSent && TEMP_isReplScriptExecuting) {
if (!isReadLineStartSent && isReplScriptExecuting) {
replWriter.printlnReadLineStart()
isReadLineStartSent = true
}
@@ -71,7 +71,7 @@ public class ReplSystemInWrapper(
val xmlInput = byteBuilder.toString()
val unescapedXml = parseXml(xmlInput)
val resultLine = if (TEMP_isReplScriptExecuting)
val resultLine = if (isReplScriptExecuting)
unescapeLineBreaks(unescapedXml)
else
unescapedXml
@@ -273,7 +273,7 @@ public class OverloadsAnnotationChecker: DeclarationChecker {
if (descriptor is FunctionDescriptor && descriptor.getModality() == Modality.ABSTRACT) {
diagnosticHolder.report(ErrorsJvm.OVERLOADS_ABSTRACT.on(declaration))
}
else if ((!descriptor.getVisibility().TEMP_isPublicAPI && descriptor.getVisibility() != Visibilities.INTERNAL) ||
else if ((!descriptor.getVisibility().isPublicAPI && descriptor.getVisibility() != Visibilities.INTERNAL) ||
DescriptorUtils.isLocal(descriptor)) {
diagnosticHolder.report(ErrorsJvm.OVERLOADS_PRIVATE.on(declaration))
}
@@ -34,7 +34,7 @@ fun syntheticExtensionVisibility(originalDescriptor: DeclarationDescriptorWithVi
return when (originalVisibility) {
Visibilities.PUBLIC -> Visibilities.PUBLIC
else -> object : Visibility(originalVisibility.name, originalVisibility.TEMP_isPublicAPI) {
else -> object : Visibility(originalVisibility.name, originalVisibility.isPublicAPI) {
override fun isVisible(receiver: ReceiverValue, what: DeclarationDescriptorWithVisibility, from: DeclarationDescriptor)
= originalVisibility.isVisible(receiver, originalDescriptor, from)
@@ -336,7 +336,7 @@ public class JetFlowInformationProvider {
}
if (!(instruction instanceof WriteValueInstruction)) return;
WriteValueInstruction writeValueInstruction = (WriteValueInstruction) instruction;
JetElement element = writeValueInstruction.getTEMP_lValue();
JetElement element = writeValueInstruction.getlValue();
boolean error = checkBackingField(ctxt, element);
if (!(element instanceof JetExpression)) return;
if (!error) {
@@ -50,7 +50,7 @@ public class TailRecursionDetector extends InstructionVisitorWithResult<Boolean>
@Override
public Boolean visitSubroutineExit(@NotNull SubroutineExitInstruction instruction) {
return !instruction.getTEMP_isError() && instruction.getSubroutine() == subroutine;
return !instruction.getIsError() && instruction.getSubroutine() == subroutine;
}
@Override
@@ -89,7 +89,7 @@ public class PseudocodeUtil {
element = ((ReadValueInstruction) instruction).getElement();
}
else if (instruction instanceof WriteValueInstruction) {
element = ((WriteValueInstruction) instruction).getTEMP_lValue();
element = ((WriteValueInstruction) instruction).getlValue();
}
else if (instruction instanceof VariableDeclarationInstruction) {
element = ((VariableDeclarationInstruction) instruction).getVariableDeclarationElement();
@@ -91,7 +91,7 @@ public class WriteValueInstruction(
lexicalScope: LexicalScope,
target: AccessTarget,
receiverValues: Map<PseudoValue, ReceiverValue>,
public val TEMP_lValue: JetElement,
public val lValue: JetElement,
public val rValue: PseudoValue
) : AccessValueInstruction(assignment, lexicalScope, target, receiverValues) {
override val inputValues: List<PseudoValue>
@@ -106,10 +106,10 @@ public class WriteValueInstruction(
}
override fun toString(): String {
val lhs = (TEMP_lValue as? JetNamedDeclaration)?.getName() ?: render(TEMP_lValue)
val lhs = (lValue as? JetNamedDeclaration)?.getName() ?: render(lValue)
return "w($lhs|${inputValues.joinToString(", ")})"
}
override fun createCopy(): InstructionImpl =
WriteValueInstruction(element, lexicalScope, target, receiverValues, TEMP_lValue, rValue)
WriteValueInstruction(element, lexicalScope, target, receiverValues, lValue, rValue)
}
@@ -23,7 +23,7 @@ import java.util.*
public class SubroutineExitInstruction(
public val subroutine: JetElement,
lexicalScope: LexicalScope,
public val TEMP_isError: Boolean
public val isError: Boolean
) : InstructionImpl(lexicalScope) {
private var _sink: SubroutineSinkInstruction? = null
@@ -44,8 +44,8 @@ public class SubroutineExitInstruction(
return visitor.visitSubroutineExit(this)
}
override fun toString(): String = if (TEMP_isError) "<ERROR>" else "<END>"
override fun toString(): String = if (isError) "<ERROR>" else "<END>"
override fun createCopy(): InstructionImpl =
SubroutineExitInstruction(subroutine, lexicalScope, TEMP_isError)
SubroutineExitInstruction(subroutine, lexicalScope, isError)
}
@@ -110,7 +110,7 @@ public class BodyResolver {
// SCRIPT: resolve script bodies
scriptBodyResolverResolver.resolveScriptBodies(c);
if (!c.getTopDownAnalysisMode().getTEMP_isLocalDeclarations()) {
if (!c.getTopDownAnalysisMode().getIsLocalDeclarations()) {
computeDeferredTypes();
}
}
@@ -732,7 +732,7 @@ public class BodyResolver {
LexicalScope scope = c.getDeclaringScope(declaration);
assert scope != null : "Scope is null: " + PsiUtilPackage.getElementTextWithContext(declaration);
if (!c.getTopDownAnalysisMode().getTEMP_isLocalDeclarations() && !(bodyResolveCache instanceof BodyResolveCache.ThrowException) &&
if (!c.getTopDownAnalysisMode().getIsLocalDeclarations() && !(bodyResolveCache instanceof BodyResolveCache.ThrowException) &&
expressionTypingServices.getStatementFilter() != StatementFilter.NONE) {
bodyResolveCache.resolveFunctionBody(declaration).addOwnDataTo(trace, true);
}
@@ -74,7 +74,7 @@ public class ControlFlowAnalyzer {
// A pseudocode of class/object initialization corresponds to a class/object
// or initialization of properties corresponds to a package declared in a file
JetFlowInformationProvider flowInformationProvider = new JetFlowInformationProvider((JetElement) declarationContainer, trace);
if (c.getTopDownAnalysisMode().getTEMP_isLocalDeclarations()) {
if (c.getTopDownAnalysisMode().getIsLocalDeclarations()) {
flowInformationProvider.checkForLocalClassOrObjectMode();
return;
}
@@ -95,7 +95,7 @@ public class ControlFlowAnalyzer {
private void checkFunction(@NotNull BodiesResolveContext c, @NotNull JetDeclarationWithBody function, @Nullable JetType expectedReturnType) {
if (!function.hasBody()) return;
JetFlowInformationProvider flowInformationProvider = new JetFlowInformationProvider(function, trace);
if (c.getTopDownAnalysisMode().getTEMP_isLocalDeclarations()) {
if (c.getTopDownAnalysisMode().getIsLocalDeclarations()) {
flowInformationProvider.checkForLocalClassOrObjectMode();
return;
}
@@ -16,7 +16,7 @@
package org.jetbrains.kotlin.resolve
public enum class TopDownAnalysisMode(public val TEMP_isLocalDeclarations: Boolean) {
public enum class TopDownAnalysisMode(public val isLocalDeclarations: Boolean) {
LocalDeclarations(true),
TopLevelDeclarations(false)
}
@@ -385,7 +385,7 @@ public class CallExpressionResolver {
}
CompileTimeConstant<?> value = constantExpressionEvaluator.evaluateExpression(expression, context.trace, context.expectedType);
if (value != null && value.getTEMP_isPure()) {
if (value != null && value.getIsPure()) {
return dataFlowAnalyzer.createCompileTimeConstantTypeInfo(value, expression, context);
}
@@ -43,7 +43,7 @@ import java.util.Set;
import static org.jetbrains.kotlin.diagnostics.Errors.NON_LOCAL_RETURN_NOT_ALLOWED;
import static org.jetbrains.kotlin.diagnostics.Errors.USAGE_IS_NOT_INLINABLE;
import static org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilPackage.getTEMP_isEffectivelyPublicApi;
import static org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilPackage.getIsEffectivelyPublicApi;
import static org.jetbrains.kotlin.resolve.inline.InlineUtil.allowsNonLocalReturns;
import static org.jetbrains.kotlin.resolve.inline.InlineUtil.checkNonLocalReturnUsage;
@@ -55,7 +55,7 @@ class InlineChecker implements CallChecker {
public InlineChecker(@NotNull SimpleFunctionDescriptor descriptor) {
assert InlineUtil.isInline(descriptor) : "This extension should be created only for inline functions: " + descriptor;
this.descriptor = descriptor;
this.isEffectivelyPublicApiFunction = getTEMP_isEffectivelyPublicApi(descriptor);
this.isEffectivelyPublicApiFunction = getIsEffectivelyPublicApi(descriptor);
for (ValueParameterDescriptor param : descriptor.getValueParameters()) {
if (isInlinableParameter(param)) {
@@ -236,7 +236,7 @@ class InlineChecker implements CallChecker {
}
private void checkVisibility(@NotNull CallableDescriptor declarationDescriptor, @NotNull JetElement expression, @NotNull BasicCallResolutionContext context){
boolean declarationDescriptorIsPublicApi = getTEMP_isEffectivelyPublicApi(declarationDescriptor) || isDefinedInInlineFunction(declarationDescriptor);
boolean declarationDescriptorIsPublicApi = getIsEffectivelyPublicApi(declarationDescriptor) || isDefinedInInlineFunction(declarationDescriptor);
if (isEffectivelyPublicApiFunction && !declarationDescriptorIsPublicApi && declarationDescriptor.getVisibility() != Visibilities.LOCAL) {
context.trace.report(Errors.INVISIBLE_MEMBER_FROM_INLINE.on(expression, declarationDescriptor, descriptor));
}
@@ -443,7 +443,7 @@ private class ConstantExpressionEvaluatorVisitor(
private fun canBeUsedInAnnotation(expression: JetExpression) = ConstantExpressionEvaluator.getConstant(expression, trace.getBindingContext())?.canBeUsedInAnnotations ?: false
private fun isPureConstant(expression: JetExpression) = ConstantExpressionEvaluator.getConstant(expression, trace.getBindingContext())?.TEMP_isPure ?: false
private fun isPureConstant(expression: JetExpression) = ConstantExpressionEvaluator.getConstant(expression, trace.getBindingContext())?.isPure ?: false
private fun evaluateUnaryAndCheck(receiver: OperationArgument, name: String, callExpression: JetExpression): Any? {
val functions = unaryOperations[UnaryOperationKey(receiver.ctcType, name)]
@@ -52,7 +52,7 @@ public abstract class AbstractEvaluateExpressionTest : AbstractAnnotationDescrip
fun doIsPureTest(path: String) {
doTest(path) {
property, context ->
evaluateInitializer(context, property)?.TEMP_isPure.toString()
evaluateInitializer(context, property)?.isPure.toString()
}
}
@@ -21,7 +21,7 @@ import javax.xml.bind.DatatypeConverter.parseBase64Binary
import javax.xml.bind.DatatypeConverter.printBase64Binary
public class KotlinJavascriptMetadata(public val abiVersion: Int, public val moduleName: String, public val body: ByteArray) {
public val TEMP_isAbiVersionCompatible: Boolean = KotlinJavascriptMetadataUtils.isAbiVersionCompatible(abiVersion)
public val isAbiVersionCompatible: Boolean = KotlinJavascriptMetadataUtils.isAbiVersionCompatible(abiVersion)
}
public object KotlinJavascriptMetadataUtils {