massive refactoring of CodegenUtil

- generation method names standartized on genXXX
- many methods moved to newly created AsmUtil
- some methods moved to CodegenContext
- got rid of almost trivial StubCodegen
This commit is contained in:
Alex Tkachman
2012-09-20 20:19:01 +03:00
parent c355e182e8
commit bc1a4a1fe9
31 changed files with 663 additions and 635 deletions
@@ -29,7 +29,6 @@ import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.util.SmartList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.codegen.CodegenUtil;
import org.jetbrains.jet.codegen.NamespaceCodegen;
import org.jetbrains.jet.lang.psi.*;
import org.jetbrains.jet.lang.resolve.java.JavaPsiFacadeKotlinHacks;
@@ -41,6 +40,8 @@ import org.jetbrains.jet.util.QualifiedNamesUtil;
import java.util.*;
import static org.jetbrains.jet.codegen.CodegenUtil.getLocalNameForObject;
public class JavaElementFinder extends PsiElementFinder implements JavaPsiFacadeKotlinHacks.KotlinFinderMarker {
private final Project project;
private final PsiManager psiManager;
@@ -166,7 +167,7 @@ public class JavaElementFinder extends PsiElementFinder implements JavaPsiFacade
if (given != null) return given;
if (declaration instanceof JetObjectDeclaration) {
return CodegenUtil.getLocalNameForObject((JetObjectDeclaration) declaration);
return getLocalNameForObject((JetObjectDeclaration) declaration);
}
return null;
@@ -266,7 +266,7 @@ public class JetLightClass extends AbstractLightClass implements JetJavaMirrorMa
public static PsiMethod wrapMethod(@NotNull JetNamedFunction function) {
//noinspection unchecked
if (PsiTreeUtil.getParentOfType(function, JetFunction.class, JetProperty.class) != null) {
// Don't generate method wrappers for internal declarations. Their classes are not generated during calcStub
// Don't genClassOrObject method wrappers for internal declarations. Their classes are not generated during calcStub
// with ClassBuilderMode.SIGNATURES mode, and this produces "Class not found exception" in getDelegate()
return null;
}