Merge remote-tracking branch 'origin/master' into incremental

This commit is contained in:
Evgeny Gerashchenko
2014-06-19 11:43:11 +04:00
89 changed files with 1305 additions and 808 deletions
@@ -45,11 +45,16 @@ class GenerateProgressions(out: PrintWriter) : BuiltInsSourceGenerator(out) {
val constructor = checkNaN + checkZero
val hashCode = when (kind) {
BYTE, CHAR, SHORT -> "= 31 * (31 * start.toInt() + end) + increment"
INT -> "= 31 * (31 * start + end) + increment"
LONG -> "= (31 * (31 * ${hashLong("start")} + ${hashLong("end")}) + ${hashLong("increment")}).toInt()"
FLOAT -> "= 31 * (31 * ${floatToIntBits("start")} + ${floatToIntBits("end")}) + ${floatToIntBits("increment")}"
BYTE, CHAR, SHORT -> "=\n" +
" if (isEmpty()) -1 else (31 * (31 * start.toInt() + end) + increment)"
INT -> "=\n" +
" if (isEmpty()) -1 else (31 * (31 * start + end) + increment)"
LONG -> "=\n" +
" if (isEmpty()) -1 else (31 * (31 * ${hashLong("start")} + ${hashLong("end")}) + ${hashLong("increment")}).toInt()"
FLOAT -> "=\n" +
" if (isEmpty()) -1 else (31 * (31 * ${floatToIntBits("start")} + ${floatToIntBits("end")}) + ${floatToIntBits("increment")})"
DOUBLE -> "{\n" +
" if (isEmpty()) return -1\n" +
" var temp = ${doubleToLongBits("start")}\n" +
" var result = ${hashLong("temp")}\n" +
" temp = ${doubleToLongBits("end")}\n" +
@@ -71,8 +76,11 @@ class GenerateProgressions(out: PrintWriter) : BuiltInsSourceGenerator(out) {
override fun iterator(): ${t}Iterator = ${t}ProgressionIterator(start, end, increment)
public fun isEmpty(): Boolean = if (increment > 0) start > end else start < end
override fun equals(other: Any?): Boolean =
other is $progression && ${compare("start")} && ${compare("end")} && ${compare("increment")}
other is $progression && (isEmpty() && other.isEmpty() ||
${compare("start")} && ${compare("end")} && ${compare("increment")})
override fun hashCode(): Int $hashCode
@@ -45,11 +45,16 @@ class GenerateRanges(out: PrintWriter) : BuiltInsSourceGenerator(out) {
fun compare(v: String) = areEqualNumbers(kind, v)
val hashCode = when (kind) {
BYTE, CHAR, SHORT -> "= 31 * start.toInt() + end"
INT -> "= 31 * start + end"
LONG -> "= (31 * ${hashLong("start")} + ${hashLong("end")}).toInt()"
FLOAT -> "= 31 * ${floatToIntBits("start")} + ${floatToIntBits("end")}"
BYTE, CHAR, SHORT -> "=\n" +
" if (isEmpty()) -1 else (31 * start.toInt() + end)"
INT -> "=\n" +
" if (isEmpty()) -1 else (31 * start + end)"
LONG -> "=\n" +
" if (isEmpty()) -1 else (31 * ${hashLong("start")} + ${hashLong("end")}).toInt()"
FLOAT -> "=\n" +
" if (isEmpty()) -1 else (31 * ${floatToIntBits("start")} + ${floatToIntBits("end")})"
DOUBLE -> "{\n" +
" if (isEmpty()) return -1\n" +
" var temp = ${doubleToLongBits("start")}\n" +
" val result = ${hashLong("temp")}\n" +
" temp = ${doubleToLongBits("end")}\n" +
@@ -66,8 +71,11 @@ class GenerateRanges(out: PrintWriter) : BuiltInsSourceGenerator(out) {
override fun iterator(): ${t}Iterator = ${t}ProgressionIterator(start, end, $increment)
override fun isEmpty(): Boolean = start > end
override fun equals(other: Any?): Boolean =
other is $range && ${compare("start")} && ${compare("end")}
other is $range && (isEmpty() && other.isEmpty() ||
${compare("start")} && ${compare("end")})
override fun hashCode(): Int $hashCode
@@ -35,7 +35,7 @@ import org.jetbrains.jet.lang.types.expressions.ExpressionTypingComponents
import org.jetbrains.jet.lang.types.expressions.ExpressionTypingUtils
import org.jetbrains.jet.lang.resolve.calls.CallResolver
import org.jetbrains.jet.lang.resolve.java.structure.impl.JavaPropertyInitializerEvaluatorImpl
import org.jetbrains.jet.lang.resolve.kotlin.DescriptorDeserializers
import org.jetbrains.jet.lang.resolve.kotlin.DeserializationGlobalContextForJava
// NOTE: After making changes, you need to re-generate the injectors.
// To do that, you can run main in this file.
@@ -98,7 +98,7 @@ private fun generatorForTopDownAnalyzerForJvm() =
commonForTopDownAnalyzer()
publicField(javaClass<JavaDescriptorResolver>())
publicField(javaClass<DescriptorDeserializers>())
publicField(javaClass<DeserializationGlobalContextForJava>())
fields(
javaClass<JavaClassFinderImpl>(),
@@ -270,6 +270,7 @@ public class GenerateMockJdk {
"javax/swing/SwingConstants.class",
"javax/swing/SwingUtilities.class",
"javax/swing/table/TableModel.class",
"sun/util/calendar/BaseCalendar.class",
"META-INF/",
"META-INF/MANIFEST.MF",
};