mirror of
https://github.com/facebookarchive/prepack.git
synced 2024-09-11 14:46:37 +03:00
Removing --serialize and --residual options (#2504)
Summary: Release notes: Removing --serialize and --residual options from Prepack (CLI) Pull Request resolved: https://github.com/facebook/prepack/pull/2504 Reviewed By: trueadm Differential Revision: D9582602 Pulled By: NTillmann fbshipit-source-id: d30a6ef662de5ebddd5e7d615ea37b3f772ce93d
This commit is contained in:
parent
3f2445db76
commit
12ae403cef
@ -454,7 +454,6 @@ function runTest(name, code, options: PrepackOptions, args) {
|
||||
if (code.includes(injectAtRuntime)) {
|
||||
let i = code.indexOf(injectAtRuntime);
|
||||
addedCode = code.substring(i + injectAtRuntime.length, code.indexOf("\n", i));
|
||||
options.residual = false;
|
||||
}
|
||||
if (args.es5) {
|
||||
code = transformWithBabel(code, [], [["@babel/env", { forceAllTransforms: true, modules: false }]]);
|
||||
@ -503,7 +502,6 @@ function runTest(name, code, options: PrepackOptions, args) {
|
||||
expectedDiagnostics.set(severity, errorCodeSet);
|
||||
errorCodeString.split(",").forEach(errorCode => errorCodeSet.add(errorCode.trim()));
|
||||
}
|
||||
options.residual = false;
|
||||
}
|
||||
if (expectedDiagnostics.size > 0)
|
||||
options.errorHandler = getErrorHandlerWithWarningCapture(diagnosticOutput, args.verbose);
|
||||
@ -793,7 +791,6 @@ function run(args) {
|
||||
delayInitializations,
|
||||
inlineExpressions,
|
||||
lazyObjectsRuntime,
|
||||
residual: args && args.residual,
|
||||
};
|
||||
return () =>
|
||||
runTest(test.name, test.file, options, args).then(testResult => {
|
||||
@ -831,7 +828,6 @@ class ProgramArgs {
|
||||
lazyObjectsRuntime: string;
|
||||
noLazySupport: boolean;
|
||||
fast: boolean;
|
||||
residual: boolean;
|
||||
cpuprofilePath: string;
|
||||
constructor(
|
||||
debugNames: boolean,
|
||||
@ -843,7 +839,6 @@ class ProgramArgs {
|
||||
lazyObjectsRuntime: string,
|
||||
noLazySupport: boolean,
|
||||
fast: boolean,
|
||||
residual: boolean,
|
||||
cpuProfilePath: string
|
||||
) {
|
||||
this.debugNames = debugNames;
|
||||
@ -855,7 +850,6 @@ class ProgramArgs {
|
||||
this.lazyObjectsRuntime = lazyObjectsRuntime;
|
||||
this.noLazySupport = noLazySupport;
|
||||
this.fast = fast;
|
||||
this.residual = residual;
|
||||
this.cpuprofilePath = cpuProfilePath;
|
||||
}
|
||||
}
|
||||
@ -920,7 +914,6 @@ function argsParse(): ProgramArgs {
|
||||
lazyObjectsRuntime: LAZY_OBJECTS_RUNTIME_NAME,
|
||||
noLazySupport: false,
|
||||
fast: false,
|
||||
residual: false,
|
||||
cpuprofilePath: "",
|
||||
},
|
||||
});
|
||||
@ -953,9 +946,6 @@ function argsParse(): ProgramArgs {
|
||||
if (typeof parsedArgs.noLazySupport !== "boolean") {
|
||||
throw new ArgsParseError("noLazySupport must be a boolean (either --noLazySupport or not)");
|
||||
}
|
||||
if (typeof parsedArgs.residual !== "boolean") {
|
||||
throw new ArgsParseError("residual must be a boolean (either --residual or not)");
|
||||
}
|
||||
if (typeof parsedArgs.cpuprofilePath !== "string") {
|
||||
throw new ArgsParseError("cpuprofilePath must be a string");
|
||||
}
|
||||
@ -969,7 +959,6 @@ function argsParse(): ProgramArgs {
|
||||
parsedArgs.lazyObjectsRuntime,
|
||||
parsedArgs.noLazySupport,
|
||||
parsedArgs.fast,
|
||||
parsedArgs.residual,
|
||||
parsedArgs.cpuprofilePath
|
||||
);
|
||||
return programArgs;
|
||||
|
@ -47,7 +47,6 @@ export type RealmOptions = {
|
||||
invariantMode?: InvariantModeTypes,
|
||||
emitConcreteModel?: boolean,
|
||||
uniqueSuffix?: string,
|
||||
residual?: boolean,
|
||||
serialize?: boolean,
|
||||
strictlyMonotonicDateNow?: boolean,
|
||||
timeout?: number,
|
||||
|
@ -62,10 +62,7 @@ function run(
|
||||
--initializeMoreModules Enable speculative initialization of modules (for the module system Prepack has builtin
|
||||
knowledge about). Prepack will try to execute all factory functions it is able to.
|
||||
--trace Traces the order of module initialization.
|
||||
--serialize Serializes the partially evaluated global environment as a program that recreates it.
|
||||
(default = true)
|
||||
--check [start[, count]] Check residual functions for diagnostic messages. Do not serialize or produce residual code.
|
||||
--residual Produces the residual program that results after constant folding.
|
||||
--check [start[, count]] Check residual functions for diagnostic messages. Do not generate code.
|
||||
--profile Collect statistics about time and memory usage of the different internal passes
|
||||
--logStatistics Log statistics to console
|
||||
--statsFile The name of the output file where statistics will be written to.
|
||||
@ -120,8 +117,6 @@ function run(
|
||||
delayInitializations: false,
|
||||
internalDebug: false,
|
||||
debugScopes: false,
|
||||
serialize: false,
|
||||
residual: false,
|
||||
profile: false,
|
||||
instantRender: false,
|
||||
reactEnabled: false,
|
||||
@ -335,12 +330,6 @@ function run(
|
||||
}
|
||||
}
|
||||
|
||||
if (!flags.serialize && !flags.residual) flags.serialize = true;
|
||||
if (check) {
|
||||
flags.serialize = false;
|
||||
flags.residual = false;
|
||||
}
|
||||
|
||||
let resolvedOptions = Object.assign(
|
||||
{},
|
||||
{
|
||||
@ -353,6 +342,7 @@ function run(
|
||||
timeout,
|
||||
debugIdentifiers,
|
||||
check,
|
||||
serialize: !check,
|
||||
lazyObjectsRuntime,
|
||||
debugInFilePath,
|
||||
debugOutFilePath,
|
||||
|
@ -40,7 +40,6 @@ export type PrepackOptions = {|
|
||||
reactOutput?: ReactOutputTypes,
|
||||
reactVerbose?: boolean,
|
||||
reactOptimizeNestedFunctions?: boolean,
|
||||
residual?: boolean,
|
||||
serialize?: boolean,
|
||||
check?: Array<number>,
|
||||
inlineExpressions?: boolean,
|
||||
@ -76,8 +75,7 @@ export function getRealmOptions({
|
||||
reactOutput,
|
||||
reactVerbose,
|
||||
reactOptimizeNestedFunctions,
|
||||
residual,
|
||||
serialize = !residual,
|
||||
serialize,
|
||||
check,
|
||||
strictlyMonotonicDateNow,
|
||||
stripFlow,
|
||||
@ -102,7 +100,6 @@ export function getRealmOptions({
|
||||
reactOutput,
|
||||
reactVerbose,
|
||||
reactOptimizeNestedFunctions,
|
||||
residual,
|
||||
serialize,
|
||||
check,
|
||||
strictlyMonotonicDateNow,
|
||||
|
@ -229,7 +229,7 @@ export class Realm {
|
||||
constructor(opts: RealmOptions, statistics: RealmStatistics) {
|
||||
this.statistics = statistics;
|
||||
this.isReadOnly = false;
|
||||
this.useAbstractInterpretation = opts.serialize === true || opts.residual === true || Array.isArray(opts.check);
|
||||
this.useAbstractInterpretation = opts.serialize === true || Array.isArray(opts.check);
|
||||
this.ignoreLeakLogic = false;
|
||||
this.isInPureTryStatement = false;
|
||||
if (opts.mathRandomSeed !== undefined) {
|
||||
|
Loading…
Reference in New Issue
Block a user