JS IR: split serialization into a separate module
This commit is contained in:
@@ -10,7 +10,8 @@ dependencies {
|
||||
compile(project(":compiler:ir.tree"))
|
||||
compile(project(":compiler:ir.psi2ir"))
|
||||
compile(project(":compiler:ir.backend.common"))
|
||||
compile(project(":compiler:serialization.common"))
|
||||
compile(project(":compiler:ir.serialization.common"))
|
||||
compile(project(":compiler:ir.serialization.js"))
|
||||
compile(project(":js:js.ast"))
|
||||
compile(project(":js:js.frontend"))
|
||||
|
||||
|
||||
@@ -4,12 +4,8 @@ plugins {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile(project(":compiler:util"))
|
||||
compile(project(":compiler:frontend"))
|
||||
compile(project(":compiler:backend-common"))
|
||||
compile(project(":compiler:ir.backend.common"))
|
||||
compile(project(":compiler:ir.tree"))
|
||||
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile(project(":compiler:util"))
|
||||
compile(project(":compiler:frontend"))
|
||||
compile(project(":compiler:backend-common"))
|
||||
compile(project(":compiler:ir.tree"))
|
||||
compile(project(":compiler:ir.psi2ir"))
|
||||
compile(project(":compiler:ir.backend.common"))
|
||||
compile(project(":compiler:ir.serialization.common"))
|
||||
compile(project(":js:js.ast"))
|
||||
compile(project(":js:js.frontend"))
|
||||
|
||||
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
"main" { projectDefault() }
|
||||
"test" {}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.ir.backend.js.lower.serialization.metadata;
|
||||
|
||||
import "core/metadata/src/metadata.proto";
|
||||
|
||||
option java_outer_classname = "JsKlibMetadataProtoBuf";
|
||||
option optimize_for = LITE_RUNTIME;
|
||||
|
||||
message Header {
|
||||
/*
|
||||
preRelease
|
||||
*/
|
||||
optional int32 flags = 1;
|
||||
|
||||
// (patch << 16) + (minor << 8) + major
|
||||
optional int32 js_code_binary_version = 2 [default = 1];
|
||||
|
||||
optional string package_fq_name = 3;
|
||||
|
||||
optional org.jetbrains.kotlin.metadata.StringTable strings = 4;
|
||||
|
||||
optional org.jetbrains.kotlin.metadata.QualifiedNameTable qualified_names = 5;
|
||||
|
||||
// Annotations on the whole module
|
||||
repeated org.jetbrains.kotlin.metadata.Annotation annotation = 6;
|
||||
}
|
||||
|
||||
message File {
|
||||
// If absent, id is the index of the file in the Files.file list
|
||||
optional int32 id = 1;
|
||||
|
||||
repeated org.jetbrains.kotlin.metadata.Annotation annotation = 2;
|
||||
}
|
||||
|
||||
message Files {
|
||||
repeated File file = 1;
|
||||
}
|
||||
|
||||
message DescriptorUniqId {
|
||||
required int64 index = 1;
|
||||
}
|
||||
|
||||
|
||||
extend org.jetbrains.kotlin.metadata.Package {
|
||||
optional int32 package_fq_name = 131;
|
||||
}
|
||||
|
||||
extend org.jetbrains.kotlin.metadata.Class {
|
||||
repeated org.jetbrains.kotlin.metadata.Annotation class_annotation = 130;
|
||||
optional int32 class_containing_file_id = 135;
|
||||
optional DescriptorUniqId class_uniq_id = 136;
|
||||
}
|
||||
|
||||
extend org.jetbrains.kotlin.metadata.Constructor {
|
||||
repeated org.jetbrains.kotlin.metadata.Annotation constructor_annotation = 130;
|
||||
optional DescriptorUniqId constructor_uniq_id = 131;
|
||||
}
|
||||
|
||||
extend org.jetbrains.kotlin.metadata.Function {
|
||||
repeated org.jetbrains.kotlin.metadata.Annotation function_annotation = 130;
|
||||
optional int32 function_containing_file_id = 135;
|
||||
optional DescriptorUniqId function_uniq_id = 136;
|
||||
}
|
||||
|
||||
extend org.jetbrains.kotlin.metadata.Property {
|
||||
repeated org.jetbrains.kotlin.metadata.Annotation property_annotation = 130;
|
||||
repeated org.jetbrains.kotlin.metadata.Annotation property_getter_annotation = 132;
|
||||
repeated org.jetbrains.kotlin.metadata.Annotation property_setter_annotation = 133;
|
||||
optional org.jetbrains.kotlin.metadata.Annotation.Argument.Value compile_time_value = 131;
|
||||
optional int32 property_containing_file_id = 135;
|
||||
optional DescriptorUniqId property_uniq_id = 136;
|
||||
|
||||
}
|
||||
|
||||
extend org.jetbrains.kotlin.metadata.EnumEntry {
|
||||
repeated org.jetbrains.kotlin.metadata.Annotation enum_entry_annotation = 130;
|
||||
optional DescriptorUniqId enum_entry_uniq_id = 131;
|
||||
}
|
||||
|
||||
extend org.jetbrains.kotlin.metadata.ValueParameter {
|
||||
repeated org.jetbrains.kotlin.metadata.Annotation parameter_annotation = 130;
|
||||
optional DescriptorUniqId value_param_uniq_id = 131;
|
||||
}
|
||||
|
||||
extend org.jetbrains.kotlin.metadata.Type {
|
||||
repeated org.jetbrains.kotlin.metadata.Annotation type_annotation = 130;
|
||||
}
|
||||
|
||||
extend org.jetbrains.kotlin.metadata.TypeParameter {
|
||||
repeated org.jetbrains.kotlin.metadata.Annotation type_parameter_annotation = 130;
|
||||
optional DescriptorUniqId type_param_uniq_id = 131;
|
||||
}
|
||||
|
||||
extend org.jetbrains.kotlin.metadata.PackageFragment {
|
||||
optional Files package_fragment_files = 130;
|
||||
}
|
||||
|
||||
message Classes {
|
||||
// id in StringTable
|
||||
repeated int32 class_name = 1 [packed = true];
|
||||
}
|
||||
|
||||
message Library {
|
||||
repeated org.jetbrains.kotlin.metadata.PackageFragment package_fragment = 2;
|
||||
|
||||
repeated string imported_module = 3;
|
||||
}
|
||||
+1
-1
@@ -30,7 +30,7 @@ import java.io.ByteArrayOutputStream
|
||||
import java.util.zip.GZIPInputStream
|
||||
import java.util.zip.GZIPOutputStream
|
||||
|
||||
internal object JsKlibMetadataSerializationUtil {
|
||||
object JsKlibMetadataSerializationUtil {
|
||||
const val CLASS_METADATA_FILE_EXTENSION: String = "klm"
|
||||
|
||||
fun serializeMetadata(
|
||||
+4
-2
@@ -44,7 +44,8 @@ include ":kotlin-build-common",
|
||||
":compiler:ir.psi2ir",
|
||||
":compiler:ir.ir2cfg",
|
||||
":compiler:ir.backend.common",
|
||||
":compiler:serialization.common",
|
||||
":compiler:ir.serialization.common",
|
||||
":compiler:ir.serialization.js",
|
||||
":compiler:backend.js",
|
||||
":compiler:backend.jvm",
|
||||
":compiler:backend-common",
|
||||
@@ -290,7 +291,8 @@ project(':compiler:ir.ir2cfg').projectDir = "$rootDir/compiler/ir/ir.ir2cfg" as
|
||||
project(':compiler:ir.backend.common').projectDir = "$rootDir/compiler/ir/backend.common" as File
|
||||
project(':compiler:backend.js').projectDir = "$rootDir/compiler/ir/backend.js" as File
|
||||
project(':compiler:backend.jvm').projectDir = "$rootDir/compiler/ir/backend.jvm" as File
|
||||
project(':compiler:serialization.common').projectDir = "$rootDir/compiler/ir/serialization.common" as File
|
||||
project(':compiler:ir.serialization.common').projectDir = "$rootDir/compiler/ir/serialization.common" as File
|
||||
project(':compiler:ir.serialization.js').projectDir = "$rootDir/compiler/ir/serialization.js" as File
|
||||
project(':kotlin-native:kotlin-native-utils').projectDir = "$rootDir/konan/utils" as File
|
||||
project(':kotlin-native:kotlin-native-library-reader').projectDir = "$rootDir/konan/library-reader" as File
|
||||
project(':kotlin-jps-plugin').projectDir = "$rootDir/prepare/jps-plugin" as File
|
||||
|
||||
Reference in New Issue
Block a user