Default inline flag = true
This commit is contained in:
@@ -2121,9 +2121,12 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
|||||||
@NotNull ResolvedCall<? extends CallableDescriptor> resolvedCall,
|
@NotNull ResolvedCall<? extends CallableDescriptor> resolvedCall,
|
||||||
@NotNull StackValue receiver
|
@NotNull StackValue receiver
|
||||||
) {
|
) {
|
||||||
boolean disable = false;
|
|
||||||
CallableDescriptor descriptor = resolvedCall.getResultingDescriptor();
|
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 :
|
Inliner inliner = !isInline ? Inliner.NOT_INLINE :
|
||||||
new InlineCodegen(this, state, (SimpleFunctionDescriptor) unwrapFakeOverride(
|
new InlineCodegen(this, state, (SimpleFunctionDescriptor) unwrapFakeOverride(
|
||||||
(CallableMemberDescriptor) descriptor.getOriginal()), call);
|
(CallableMemberDescriptor) descriptor.getOriginal()), call);
|
||||||
|
|||||||
+1
-1
@@ -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")
|
@Argument(value = "kotlinHome", description = "Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery")
|
||||||
public String kotlinHome;
|
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;
|
public String enableInline;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public class K2JVMCompiler extends CLICompiler<K2JVMCompilerArguments> {
|
|||||||
|
|
||||||
configuration.put(JVMConfigurationKeys.GENERATE_NOT_NULL_ASSERTIONS, arguments.notNullAssertions);
|
configuration.put(JVMConfigurationKeys.GENERATE_NOT_NULL_ASSERTIONS, arguments.notNullAssertions);
|
||||||
configuration.put(JVMConfigurationKeys.GENERATE_NOT_NULL_PARAMETER_ASSERTIONS, arguments.notNullParamAssertions);
|
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);
|
configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, messageCollector);
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments
|
|||||||
-module [String] module to compile
|
-module [String] module to compile
|
||||||
-script [flag] evaluate script
|
-script [flag] evaluate script
|
||||||
-kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery
|
-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
|
-tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag
|
||||||
-verbose [flag] Enable verbose logging output
|
-verbose [flag] Enable verbose logging output
|
||||||
-version [flag] Display compiler version
|
-version [flag] Display compiler version
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments
|
|||||||
-module [String] module to compile
|
-module [String] module to compile
|
||||||
-script [flag] evaluate script
|
-script [flag] evaluate script
|
||||||
-kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery
|
-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
|
-tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag
|
||||||
-verbose [flag] Enable verbose logging output
|
-verbose [flag] Enable verbose logging output
|
||||||
-version [flag] Display compiler version
|
-version [flag] Display compiler version
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments
|
|||||||
-module [String] module to compile
|
-module [String] module to compile
|
||||||
-script [flag] evaluate script
|
-script [flag] evaluate script
|
||||||
-kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery
|
-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
|
-tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag
|
||||||
-verbose [flag] Enable verbose logging output
|
-verbose [flag] Enable verbose logging output
|
||||||
-version [flag] Display compiler version
|
-version [flag] Display compiler version
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments
|
|||||||
-module [String] module to compile
|
-module [String] module to compile
|
||||||
-script [flag] evaluate script
|
-script [flag] evaluate script
|
||||||
-kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery
|
-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
|
-tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag
|
||||||
-verbose [flag] Enable verbose logging output
|
-verbose [flag] Enable verbose logging output
|
||||||
-version [flag] Display compiler version
|
-version [flag] Display compiler version
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments
|
|||||||
-module [String] module to compile
|
-module [String] module to compile
|
||||||
-script [flag] evaluate script
|
-script [flag] evaluate script
|
||||||
-kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery
|
-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
|
-tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag
|
||||||
-verbose [flag] Enable verbose logging output
|
-verbose [flag] Enable verbose logging output
|
||||||
-version [flag] Display compiler version
|
-version [flag] Display compiler version
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ import org.jetbrains.jet.lang.resolve.constants.EnumValue;
|
|||||||
|
|
||||||
public class InlineUtil {
|
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_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*/
|
public static boolean DEFAULT_INLINE_FLAG_FOR_STUB = false; /*always false*/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user