mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Promote enableFunctionCallSignatureOptimizations to stable (remove flag)
Per title, this feature flag is enabled everywhere and is clearly stable, let's promote to stable and remove the flag to simplify.
This commit is contained in:
@@ -116,7 +116,6 @@ function parsePragma(pragma: string) {
|
||||
let enableEmitFreeze = null;
|
||||
let inlineUseMemo = true;
|
||||
let validateHooksUsage = true;
|
||||
let enableFunctionCallSignatureOptimizations = true;
|
||||
let validateFrozenLambdas = true;
|
||||
let assertValidMutableRanges = true;
|
||||
|
||||
@@ -141,9 +140,6 @@ function parsePragma(pragma: string) {
|
||||
if (pragma.includes("@inlineUseMemo false")) {
|
||||
inlineUseMemo = false;
|
||||
}
|
||||
if (pragma.includes("@enableFunctionCallSignatureOptimizations false")) {
|
||||
enableFunctionCallSignatureOptimizations = false;
|
||||
}
|
||||
if (pragma.includes("@validateHooksUsage false")) {
|
||||
validateHooksUsage = false;
|
||||
}
|
||||
@@ -156,7 +152,6 @@ function parsePragma(pragma: string) {
|
||||
|
||||
return {
|
||||
enableAssumeHooksFollowRulesOfReact,
|
||||
enableFunctionCallSignatureOptimizations,
|
||||
disableAllMemoization,
|
||||
inlineUseMemo,
|
||||
memoizeJsxElements,
|
||||
|
||||
@@ -140,13 +140,6 @@ export type EnvironmentConfig = {
|
||||
*/
|
||||
inlineUseMemo: boolean;
|
||||
|
||||
/**
|
||||
* Enable optimizations based on the signature of (non-method) built-in function calls.
|
||||
*
|
||||
* Defaults to false
|
||||
*/
|
||||
enableFunctionCallSignatureOptimizations: boolean;
|
||||
|
||||
/**
|
||||
* Enable optimizations based on the `noAlias` flag of method signatures. When enabled,
|
||||
* function signatures can declare that they do not alias their arguments, allowing
|
||||
@@ -240,7 +233,6 @@ const DEFAULT_ENVIRONMENT_CONFIG: Readonly<EnvironmentConfig> = {
|
||||
customHooks: null,
|
||||
|
||||
memoizeJsxElements: true,
|
||||
enableFunctionCallSignatureOptimizations: true,
|
||||
inlineUseMemo: true,
|
||||
validateHooksUsage: true,
|
||||
enableNoAliasOptimizations: true,
|
||||
|
||||
@@ -742,15 +742,10 @@ function inferBlock(
|
||||
continue;
|
||||
}
|
||||
case "CallExpression": {
|
||||
let signature = getFunctionCallSignature(
|
||||
const signature = getFunctionCallSignature(
|
||||
env,
|
||||
instrValue.callee.identifier.type
|
||||
);
|
||||
signature =
|
||||
env.config.enableFunctionCallSignatureOptimizations ||
|
||||
signature?.hookKind != null
|
||||
? signature
|
||||
: null;
|
||||
|
||||
const effects =
|
||||
signature !== null ? getFunctionEffects(instrValue, signature) : null;
|
||||
|
||||
+1
-4
@@ -250,10 +250,7 @@ function mayAllocate(env: Environment, instruction: Instruction): boolean {
|
||||
}
|
||||
case "CallExpression":
|
||||
case "MethodCall": {
|
||||
if (env.config.enableFunctionCallSignatureOptimizations) {
|
||||
return instruction.lvalue.identifier.type.kind !== "Primitive";
|
||||
}
|
||||
return true;
|
||||
return instruction.lvalue.identifier.type.kind !== "Primitive";
|
||||
}
|
||||
case "RegExpLiteral":
|
||||
case "PropertyStore":
|
||||
|
||||
Reference in New Issue
Block a user