Skip to content

Commit

Permalink
Back out "Add CLI/RuntimeConfig for conditionalizing Promise."
Browse files Browse the repository at this point in the history
Summary: Original commit: D20106660

Reviewed By: tmikov

Differential Revision: D24353313

fbshipit-source-id: 567328c695af44d4457255842304a84f39b2d134
  • Loading branch information
Huxpro authored and facebook-github-bot committed Oct 16, 2020
1 parent 3c494d6 commit 508b03a
Show file tree
Hide file tree
Showing 15 changed files with 6 additions and 81 deletions.
1 change: 0 additions & 1 deletion API/hermes/SynthTrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ SynthTrace::SynthTrace(
json_->closeDict();
}
json_->emitKeyValue("maxNumRegisters", conf.getMaxNumRegisters());
json_->emitKeyValue("ES6Promise", conf.getES6Promise());
json_->emitKeyValue("ES6Proxy", conf.getES6Proxy());
json_->emitKeyValue("ES6Symbol", conf.getES6Symbol());
json_->emitKeyValue("enableSampledStats", conf.getEnableSampledStats());
Expand Down
6 changes: 0 additions & 6 deletions include/hermes/ConsoleHost/RuntimeFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,6 @@ static opt<std::string> ProfilerSymbolsFile(
cat(RuntimeCategory));
#endif

static opt<bool> ES6Promise(
"Xes6-promise",
desc("Enable support for ES6 Promise"),
init(RuntimeConfig::getDefaultES6Promise()),
cat(RuntimeCategory));

static opt<bool> ES6Proxy(
"Xes6-proxy",
desc("Enable support for ES6 Proxy"),
Expand Down
7 changes: 0 additions & 7 deletions include/hermes/VM/Runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -747,10 +747,6 @@ class Runtime : public HandleRootOwner,
return runtimeModuleList_;
}

bool hasES6Promise() const {
return hasES6Promise_;
}

bool hasES6Proxy() const {
return hasES6Proxy_;
}
Expand Down Expand Up @@ -997,9 +993,6 @@ class Runtime : public HandleRootOwner,
/// All state related to JIT compilation.
JITContext jitContext_;

/// Set to true if we should enable ES6 Promise.
const bool hasES6Promise_;

/// Set to true if we should enable ES6 Proxy.
const bool hasES6Proxy_;

Expand Down
1 change: 0 additions & 1 deletion include/hermes/VM/SerializeHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ struct SerializeHeader {
/// Runtime has the same runtime config as the Deserialize system. Write those
/// flags that affects S/D in the header so we can check them too.
bool enableEval;
bool hasES6Promise;
bool hasES6Proxy;
bool hasES6Symbol;
uint8_t bytecodeWarmupPercent;
Expand Down
2 changes: 1 addition & 1 deletion lib/VM/JSLib/HermesInternal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ hermesInternalIsProxy(void *, Runtime *runtime, NativeArgs args) {

CallResult<HermesValue>
hermesInternalHasPromise(void *, Runtime *runtime, NativeArgs args) {
return HermesValue::encodeBoolValue(runtime->hasES6Promise());
return HermesValue::encodeBoolValue(false);
}

#ifdef HERMESVM_EXCEPTION_ON_OOM
Expand Down
6 changes: 0 additions & 6 deletions lib/VM/Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ Runtime::Runtime(
runtimeConfig.getCrashMgr(),
std::move(provider)),
jitContext_(runtimeConfig.getEnableJIT(), (1 << 20) * 16, (1 << 20) * 32),
hasES6Promise_(runtimeConfig.getES6Promise()),
hasES6Proxy_(runtimeConfig.getES6Proxy()),
hasES6Symbol_(runtimeConfig.getES6Symbol()),
shouldRandomizeMemoryLayout_(runtimeConfig.getRandomizeMemoryLayout()),
Expand Down Expand Up @@ -2154,7 +2153,6 @@ void Runtime::deserializeImpl(Deserializer &d, bool currentlyInYoung) {

void Runtime::populateHeaderRuntimeConfig(SerializeHeader &header) {
header.enableEval = enableEval;
header.hasES6Promise = hasES6Promise_;
header.hasES6Proxy = hasES6Proxy_;
header.hasES6Symbol = hasES6Symbol_;
header.bytecodeWarmupPercent = bytecodeWarmupPercent_;
Expand All @@ -2166,10 +2164,6 @@ void Runtime::checkHeaderRuntimeConfig(SerializeHeader &header) const {
hermes_fatal(
"serialize/deserialize Runtime Configs don't match (enableEval)");
}
if (header.hasES6Promise != hasES6Promise_) {
hermes_fatal(
"serialize/deserialize Runtime Configs don't match (es6Promise)");
}
if (header.hasES6Proxy != hasES6Proxy_) {
hermes_fatal(
"serialize/deserialize Runtime Configs don't match (es6Proxy)");
Expand Down
3 changes: 0 additions & 3 deletions public/hermes/Public/RuntimeConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ class Deserializer;
/* Whether to optimize the code inside eval and Function ctor */ \
F(constexpr, bool, OptimizedEval, false) \
\
/* Support for ES6 Promise. */ \
F(constexpr, bool, ES6Promise, false) \
\
/* Support for ES6 Proxy. */ \
F(constexpr, bool, ES6Proxy, true) \
\
Expand Down
40 changes: 0 additions & 40 deletions test/hermes/promise.js

This file was deleted.

2 changes: 0 additions & 2 deletions tools/hermes/hermes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ static int executeHBCBytecodeFromCL(
.withVerifyEvalIR(cl::VerifyIR)
.withOptimizedEval(cl::OptimizedEval)
.withVMExperimentFlags(cl::VMExperimentFlags)
.withES6Promise(cl::ES6Promise)
.withES6Proxy(cl::ES6Proxy)
.withES6Symbol(cl::ES6Symbol)
.withEnableSampleProfiling(cl::SampleProfiling)
Expand Down Expand Up @@ -182,7 +181,6 @@ static vm::RuntimeConfig getReplRuntimeConfig() {
.build())
.withShouldRecordStats(cl::GCPrintStats)
.build())
.withES6Promise(cl::ES6Promise)
.withES6Proxy(cl::ES6Proxy)
.withES6Symbol(cl::ES6Symbol)
.withEnableHermesInternal(true)
Expand Down
1 change: 0 additions & 1 deletion tools/hvm/hvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ int main(int argc, char **argv) {
.withShouldReleaseUnused(vm::kReleaseUnusedNone)
.withName("hvm")
.build())
.withES6Promise(cl::ES6Promise)
.withES6Proxy(cl::ES6Proxy)
.withES6Symbol(cl::ES6Symbol)
.withTrackIO(cl::TrackBytecodeIO)
Expand Down
8 changes: 3 additions & 5 deletions unittests/API/APITest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ class HermesRuntimeTestBase : public ::testing::Test {
class HermesRuntimeTest : public HermesRuntimeTestBase {
public:
HermesRuntimeTest()
: HermesRuntimeTestBase(::hermes::vm::RuntimeConfig::Builder()
.withES6Proxy(true)
.withES6Promise(true)
.build()) {}
: HermesRuntimeTestBase(
::hermes::vm::RuntimeConfig::Builder().withES6Proxy(true).build()) {
}
};

using HermesRuntimeDeathTest = HermesRuntimeTest;
Expand Down Expand Up @@ -467,7 +466,6 @@ class HermesRuntimeTestWithAllowFunctionToString
: HermesRuntimeTestBase(
::hermes::vm::RuntimeConfig::Builder()
.withES6Proxy(true)
.withES6Promise(true)
.withAllowFunctionToStringWithRuntimeSource(true)
.build()) {}
};
Expand Down
4 changes: 1 addition & 3 deletions unittests/API/SynthTraceParserTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ TEST_F(SynthTraceParserTest, ParseHeader) {
"allocInYoung": false,
},
"maxNumRegisters": 100,
"ES6Promise": true,
"ES6Proxy": false,
"ES6Proxy": true,
"ES6Symbol": false,
"enableSampledStats": true,
"vmExperimentFlags": 123
Expand Down Expand Up @@ -72,7 +71,6 @@ TEST_F(SynthTraceParserTest, ParseHeader) {
EXPECT_FALSE(gcconf.getAllocInYoung());

EXPECT_EQ(rtconf.getMaxNumRegisters(), 100);
EXPECT_FALSE(rtconf.getES6Promise());
EXPECT_TRUE(rtconf.getES6Proxy());
EXPECT_FALSE(rtconf.getES6Symbol());
EXPECT_TRUE(rtconf.getEnableSampledStats());
Expand Down
3 changes: 0 additions & 3 deletions unittests/API/SynthTraceTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1234,9 +1234,6 @@ TEST_F(SynthTraceSerializationTest, TraceHeader) {
EXPECT_EQ(
conf.getMaxNumRegisters(),
llvh::cast<JSONNumber>(rtConfig->at("maxNumRegisters"))->getValue());
EXPECT_EQ(
conf.getES6Promise(),
llvh::cast<JSONBoolean>(rtConfig->at("ES6Promise"))->getValue());
EXPECT_EQ(
conf.getES6Proxy(),
llvh::cast<JSONBoolean>(rtConfig->at("ES6Proxy"))->getValue());
Expand Down
1 change: 0 additions & 1 deletion unittests/VMRuntime/StackTracesTreeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ struct StackTracesTreeTest : public RuntimeTestFixtureBase {
explicit StackTracesTreeTest()
: RuntimeTestFixtureBase(
RuntimeConfig::Builder(kTestRTConfigBuilder)
.withES6Promise(true)
.withES6Proxy(true)
.withGCConfig(GCConfig::Builder(kTestGCConfigBuilder).build())
.build()) {
Expand Down
2 changes: 1 addition & 1 deletion utils/testsuite/testsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def showStatus(filename):
print("Testing " + filename)


es6_args = ["-Xes6-promise", "-Xes6-proxy", "-Xes6-symbol"]
es6_args = ["-Xes6-proxy", "-Xes6-symbol"]
extra_run_args = ["-Xhermes-internal-test-methods"]

extra_compile_flags = ["-fno-static-builtins"]
Expand Down

0 comments on commit 508b03a

Please sign in to comment.