From ee136d659436a538f1b243bcfb3069ed879a0969 Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Thu, 20 Feb 2014 12:33:18 +0400 Subject: [PATCH] Default inline flag = true --- .../src/org/jetbrains/jet/codegen/ExpressionCodegen.java | 7 +++++-- .../jet/cli/common/arguments/K2JVMCompilerArguments.java | 2 +- .../cli/src/org/jetbrains/jet/cli/jvm/K2JVMCompiler.java | 2 +- compiler/testData/cli/jvm/help.out | 2 +- compiler/testData/cli/jvm/inline/off.out | 2 +- compiler/testData/cli/jvm/inline/on.out | 2 +- compiler/testData/cli/jvm/inline/wrong.out | 2 +- compiler/testData/cli/jvm/wrongArgument.out | 2 +- .../src/org/jetbrains/jet/lang/types/lang/InlineUtil.java | 4 ++-- 9 files changed, 14 insertions(+), 11 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java index 7285d999718..10488d841f9 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java @@ -2121,9 +2121,12 @@ public class ExpressionCodegen extends JetVisitor implem @NotNull ResolvedCall resolvedCall, @NotNull StackValue receiver ) { - boolean disable = false; CallableDescriptor descriptor = resolvedCall.getResultingDescriptor(); - boolean isInline = call != null && descriptor instanceof SimpleFunctionDescriptor && ((SimpleFunctionDescriptor) descriptor).getInlineStrategy().isInline(); + boolean isInline = state.isInlineEnabled() && + call != null && + descriptor instanceof SimpleFunctionDescriptor && + ((SimpleFunctionDescriptor) descriptor).getInlineStrategy().isInline(); + Inliner inliner = !isInline ? Inliner.NOT_INLINE : new InlineCodegen(this, state, (SimpleFunctionDescriptor) unwrapFakeOverride( (CallableMemberDescriptor) descriptor.getOriginal()), call); diff --git a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JVMCompilerArguments.java b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JVMCompilerArguments.java index 6882000bebd..91e830ed936 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JVMCompilerArguments.java +++ b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JVMCompilerArguments.java @@ -66,6 +66,6 @@ public class K2JVMCompilerArguments extends CommonCompilerArguments { @Argument(value = "kotlinHome", description = "Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery") public String kotlinHome; - @Argument(value = "inline", description = "Inlining mode: on/off (default is off)") + @Argument(value = "inline", description = "Inlining mode: on/off (default is on)") public String enableInline; } diff --git a/compiler/cli/src/org/jetbrains/jet/cli/jvm/K2JVMCompiler.java b/compiler/cli/src/org/jetbrains/jet/cli/jvm/K2JVMCompiler.java index 01d6a7d0bce..b48aea59e4a 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/jvm/K2JVMCompiler.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/jvm/K2JVMCompiler.java @@ -107,7 +107,7 @@ public class K2JVMCompiler extends CLICompiler { configuration.put(JVMConfigurationKeys.GENERATE_NOT_NULL_ASSERTIONS, arguments.notNullAssertions); configuration.put(JVMConfigurationKeys.GENERATE_NOT_NULL_PARAMETER_ASSERTIONS, arguments.notNullParamAssertions); - configuration.put(JVMConfigurationKeys.ENABLE_INLINE, "on".equalsIgnoreCase(arguments.enableInline)); + configuration.put(JVMConfigurationKeys.ENABLE_INLINE, !"off".equalsIgnoreCase(arguments.enableInline)); configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, messageCollector); diff --git a/compiler/testData/cli/jvm/help.out b/compiler/testData/cli/jvm/help.out index 19c7d1240d0..46f8505bb50 100644 --- a/compiler/testData/cli/jvm/help.out +++ b/compiler/testData/cli/jvm/help.out @@ -13,7 +13,7 @@ Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments -module [String] module to compile -script [flag] evaluate script -kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery - -inline [String] Inlining mode: on/off (default is off) + -inline [String] Inlining mode: on/off (default is on) -tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag -verbose [flag] Enable verbose logging output -version [flag] Display compiler version diff --git a/compiler/testData/cli/jvm/inline/off.out b/compiler/testData/cli/jvm/inline/off.out index 19c7d1240d0..46f8505bb50 100644 --- a/compiler/testData/cli/jvm/inline/off.out +++ b/compiler/testData/cli/jvm/inline/off.out @@ -13,7 +13,7 @@ Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments -module [String] module to compile -script [flag] evaluate script -kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery - -inline [String] Inlining mode: on/off (default is off) + -inline [String] Inlining mode: on/off (default is on) -tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag -verbose [flag] Enable verbose logging output -version [flag] Display compiler version diff --git a/compiler/testData/cli/jvm/inline/on.out b/compiler/testData/cli/jvm/inline/on.out index 19c7d1240d0..46f8505bb50 100644 --- a/compiler/testData/cli/jvm/inline/on.out +++ b/compiler/testData/cli/jvm/inline/on.out @@ -13,7 +13,7 @@ Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments -module [String] module to compile -script [flag] evaluate script -kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery - -inline [String] Inlining mode: on/off (default is off) + -inline [String] Inlining mode: on/off (default is on) -tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag -verbose [flag] Enable verbose logging output -version [flag] Display compiler version diff --git a/compiler/testData/cli/jvm/inline/wrong.out b/compiler/testData/cli/jvm/inline/wrong.out index 958c602f282..b97fd79ad55 100644 --- a/compiler/testData/cli/jvm/inline/wrong.out +++ b/compiler/testData/cli/jvm/inline/wrong.out @@ -14,7 +14,7 @@ Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments -module [String] module to compile -script [flag] evaluate script -kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery - -inline [String] Inlining mode: on/off (default is off) + -inline [String] Inlining mode: on/off (default is on) -tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag -verbose [flag] Enable verbose logging output -version [flag] Display compiler version diff --git a/compiler/testData/cli/jvm/wrongArgument.out b/compiler/testData/cli/jvm/wrongArgument.out index 62df4537c91..cb802c6268d 100644 --- a/compiler/testData/cli/jvm/wrongArgument.out +++ b/compiler/testData/cli/jvm/wrongArgument.out @@ -14,7 +14,7 @@ Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments -module [String] module to compile -script [flag] evaluate script -kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery - -inline [String] Inlining mode: on/off (default is off) + -inline [String] Inlining mode: on/off (default is on) -tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag -verbose [flag] Enable verbose logging output -version [flag] Display compiler version diff --git a/core/descriptors/src/org/jetbrains/jet/lang/types/lang/InlineUtil.java b/core/descriptors/src/org/jetbrains/jet/lang/types/lang/InlineUtil.java index bd0f65dabd0..523de25ba45 100644 --- a/core/descriptors/src/org/jetbrains/jet/lang/types/lang/InlineUtil.java +++ b/core/descriptors/src/org/jetbrains/jet/lang/types/lang/InlineUtil.java @@ -29,11 +29,11 @@ import org.jetbrains.jet.lang.resolve.constants.EnumValue; public class InlineUtil { - public static boolean DEFAULT_INLINE_FLAG = false; + public static boolean DEFAULT_INLINE_FLAG = true; public static boolean DEFAULT_INLINE_FLAG_FOR_TEST = true; - public static boolean DEFAULT_INLINE_FLAG_FOR_TOOLWINDOW = false; + public static boolean DEFAULT_INLINE_FLAG_FOR_TOOLWINDOW = true; public static boolean DEFAULT_INLINE_FLAG_FOR_STUB = false; /*always false*/