From a28dd3890974d699070f08ab43781324411e6f5c Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Thu, 22 Oct 2020 18:55:00 -0700 Subject: [PATCH] Use default for hermes es6 proxy enabled (#30142) Summary: Proxy is now enabled by default in hermes 0.7 (https://github.com/facebook/hermes/releases/tag/v0.7.0). However we currently disable it because of the config we pass. This removes the config so proxy is now enabled. ## Changelog [Android] [Changed] - Use default for hermes es6 proxy enabled Pull Request resolved: https://github.com/facebook/react-native/pull/30142 Test Plan: Tested that proxy is now enabled (typeof Proxy !== 'undefined') with hermes 0.7. Reviewed By: cpojer Differential Revision: D24494182 Pulled By: mhorowitz fbshipit-source-id: 7f8a506e2c436f2f1611e183ca22d33dc763643c --- .../hermes/reactexecutor/HermesExecutor.java | 7 ++----- .../com/facebook/hermes/reactexecutor/OnLoad.cpp | 12 +++++------- .../facebook/hermes/reactexecutor/RuntimeConfig.java | 1 - 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/HermesExecutor.java b/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/HermesExecutor.java index bb065be4f4..7519f2146f 100644 --- a/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/HermesExecutor.java +++ b/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/HermesExecutor.java @@ -28,10 +28,7 @@ public class HermesExecutor extends JavaScriptExecutor { } HermesExecutor(@Nullable RuntimeConfig config) { - super( - config == null - ? initHybridDefaultConfig() - : initHybrid(config.heapSizeMB, config.es6Proxy)); + super(config == null ? initHybridDefaultConfig() : initHybrid(config.heapSizeMB)); } @Override @@ -50,5 +47,5 @@ public class HermesExecutor extends JavaScriptExecutor { private static native HybridData initHybridDefaultConfig(); - private static native HybridData initHybrid(long heapSizeMB, boolean es6Proxy); + private static native HybridData initHybrid(long heapSizeMB); } diff --git a/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/OnLoad.cpp b/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/OnLoad.cpp index d6cbef092d..0e666e328e 100644 --- a/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/OnLoad.cpp +++ b/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/OnLoad.cpp @@ -21,9 +21,7 @@ namespace facebook { namespace react { -static ::hermes::vm::RuntimeConfig makeRuntimeConfig( - jlong heapSizeMB, - bool es6Proxy) { +static ::hermes::vm::RuntimeConfig makeRuntimeConfig(jlong heapSizeMB) { namespace vm = ::hermes::vm; auto gcConfigBuilder = vm::GCConfig::Builder() @@ -40,7 +38,6 @@ static ::hermes::vm::RuntimeConfig makeRuntimeConfig( return vm::RuntimeConfig::Builder() .withGCConfig(gcConfigBuilder.build()) - .withES6Proxy(es6Proxy) .build(); } @@ -69,10 +66,11 @@ class HermesExecutorHolder std::make_unique(installBindings)); } - static jni::local_ref - initHybrid(jni::alias_ref, jlong heapSizeMB, bool es6Proxy) { + static jni::local_ref initHybrid( + jni::alias_ref, + jlong heapSizeMB) { JReactMarker::setLogPerfMarkerIfNeeded(); - auto runtimeConfig = makeRuntimeConfig(heapSizeMB, es6Proxy); + auto runtimeConfig = makeRuntimeConfig(heapSizeMB); return makeCxxInstance(std::make_unique( installBindings, JSIExecutor::defaultTimeoutInvoker, runtimeConfig)); } diff --git a/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/RuntimeConfig.java b/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/RuntimeConfig.java index 8300e5e55e..fec7c457bc 100644 --- a/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/RuntimeConfig.java +++ b/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/RuntimeConfig.java @@ -10,7 +10,6 @@ package com.facebook.hermes.reactexecutor; /** Holds runtime configuration for a Hermes VM instance (master or snapshot). */ public final class RuntimeConfig { public long heapSizeMB; - public boolean es6Proxy; RuntimeConfig() {}