KJS: remove obsolete classIndex

This commit is contained in:
Zalim Bashorov
2016-12-27 00:39:27 +03:00
parent be694d53ef
commit 70423e8129
4 changed files with 0 additions and 16 deletions
@@ -121,8 +121,6 @@ class CoroutineFunctionTransformer(private val program: JsProgram, private val f
val metadataObject = JsObjectLiteral(true)
metadataObject.propertyInitializers += JsPropertyInitializer(
JsNameRef("type"), JsNameRef("CLASS", JsNameRef("TYPE", Namer.KOTLIN_NAME)))
metadataObject.propertyInitializers += JsPropertyInitializer(
JsNameRef("classIndex"), JsInvocation(JsNameRef("newClassIndex", Namer.KOTLIN_NAME)))
metadataObject.propertyInitializers += JsPropertyInitializer(JsNameRef("simpleName"), JsLiteral.NULL)
metadataObject.propertyInitializers += JsPropertyInitializer(JsNameRef("baseClasses"), JsArrayLiteral(listOf(baseClassRefRef)))
@@ -133,7 +133,6 @@ function getPropertyRefMetadata(cache) {
cache.value = {
baseClasses: [cache.implementedInterface()],
baseClass: null,
classIndex: Kotlin.newClassIndex(),
functions: {},
properties: {},
types: {},
-11
View File
@@ -20,13 +20,6 @@ Kotlin.TYPE = {
OBJECT: "object"
};
Kotlin.classCount = 0;
Kotlin.newClassIndex = function () {
var tmp = Kotlin.classCount;
Kotlin.classCount++;
return tmp;
};
Kotlin.callGetter = function (thisObject, klass, propertyName) {
var propertyDescriptor = Object.getOwnPropertyDescriptor(klass, propertyName);
if (propertyDescriptor != null) {
@@ -60,10 +53,6 @@ Kotlin.callSetter = function (thisObject, klass, propertyName, value) {
};
function isInheritanceFromInterface(metadata, iface) {
// TODO: return this optimization
/*if (metadata == null || metadata.classIndex < iface.$metadata$.classIndex) {
return false;
}*/
var baseClasses = metadata.baseClasses;
var i;
for (i = 0; i < baseClasses.length; i++) {
@@ -177,10 +177,8 @@ class ClassTranslator private constructor(
DescriptorUtils.isObject(descriptor) -> JsNameRef("OBJECT", kotlinType)
else -> JsNameRef("CLASS", kotlinType)
}
val typeIndex = JsInvocation(JsNameRef("newClassIndex", Namer.KOTLIN_NAME))
metadataLiteral.propertyInitializers += JsPropertyInitializer(JsNameRef("type"), typeRef)
metadataLiteral.propertyInitializers += JsPropertyInitializer(JsNameRef("classIndex"), typeIndex)
val simpleName = descriptor.name
if (!simpleName.isSpecial) {