Revert rewrite const as var workaround
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Apr 2016 00:24:18 +0000 (00:24 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Apr 2016 00:24:18 +0000 (00:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=155393

Reviewed by Mark Lam.

Source/JavaScriptCore:

* parser/Parser.h:
(JSC::Parser::next):
(JSC::Parser::nextExpectIdentifier):
* runtime/VM.h:
(JSC::VM::setShouldRewriteConstAsVar): Deleted.
(JSC::VM::shouldRewriteConstAsVar): Deleted.

Source/WebCore:

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::commonVM):
* page/Settings.cpp:
* page/Settings.h:
(WebCore::Settings::shouldUseHighResolutionTimers):
(WebCore::Settings::backgroundShouldExtendBeyondPage):
(WebCore::Settings::shouldRewriteConstAsVar): Deleted.
(WebCore::Settings::setShouldRewriteConstAsVar): Deleted.

Source/WebKit2:

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198932 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/Parser.h
Source/JavaScriptCore/runtime/VM.h
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebProcessCreationParameters.cpp
Source/WebKit2/Shared/WebProcessCreationParameters.h
Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm
Source/WebKit2/WebProcess/WebProcess.cpp

index 631798b..6e16c59 100644 (file)
@@ -1,5 +1,19 @@
 2016-03-31  Saam barati  <sbarati@apple.com>
 
+        Revert rewrite const as var workaround
+        https://bugs.webkit.org/show_bug.cgi?id=155393
+
+        Reviewed by Mark Lam.
+
+        * parser/Parser.h:
+        (JSC::Parser::next):
+        (JSC::Parser::nextExpectIdentifier):
+        * runtime/VM.h:
+        (JSC::VM::setShouldRewriteConstAsVar): Deleted.
+        (JSC::VM::shouldRewriteConstAsVar): Deleted.
+
+2016-03-31  Saam barati  <sbarati@apple.com>
+
         [ES6] Disallow var assignments in for-in loops
         https://bugs.webkit.org/show_bug.cgi?id=155451
 
index 342c199..d1dfda6 100644 (file)
@@ -1143,8 +1143,6 @@ private:
         m_lastTokenEndPosition = JSTextPosition(lastLine, lastTokenEnd, lastTokenLineStart);
         m_lexer->setLastLineNumber(lastLine);
         m_token.m_type = m_lexer->lex(&m_token, lexerFlags, strictMode());
-        if (UNLIKELY(m_token.m_type == CONSTTOKEN && m_vm->shouldRewriteConstAsVar()))
-            m_token.m_type = VAR;
     }
 
     ALWAYS_INLINE void nextExpectIdentifier(unsigned lexerFlags = 0)
index 5d29769..000ec81 100644 (file)
@@ -598,8 +598,6 @@ public:
 
     JS_EXPORT_PRIVATE void queueMicrotask(JSGlobalObject*, PassRefPtr<Microtask>);
     JS_EXPORT_PRIVATE void drainMicrotasks();
-    JS_EXPORT_PRIVATE void setShouldRewriteConstAsVar(bool shouldRewrite) { m_shouldRewriteConstAsVar = shouldRewrite; }
-    ALWAYS_INLINE bool shouldRewriteConstAsVar() { return m_shouldRewriteConstAsVar; }
 
     inline bool shouldTriggerTermination(ExecState*);
 
@@ -658,7 +656,6 @@ private:
     Exception* m_lastException { nullptr };
     bool m_failNextNewCodeBlock { false };
     bool m_inDefineOwnProperty;
-    bool m_shouldRewriteConstAsVar { false };
     bool m_shouldBuildPCToCodeOriginMapping { false };
     std::unique_ptr<CodeCache> m_codeCache;
     LegacyProfiler* m_enabledProfiler;
index 3a4d567..283cf60 100644 (file)
@@ -1,3 +1,19 @@
+2016-03-31  Saam barati  <sbarati@apple.com>
+
+        Revert rewrite const as var workaround
+        https://bugs.webkit.org/show_bug.cgi?id=155393
+
+        Reviewed by Mark Lam.
+
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::JSDOMWindowBase::commonVM):
+        * page/Settings.cpp:
+        * page/Settings.h:
+        (WebCore::Settings::shouldUseHighResolutionTimers):
+        (WebCore::Settings::backgroundShouldExtendBeyondPage):
+        (WebCore::Settings::shouldRewriteConstAsVar): Deleted.
+        (WebCore::Settings::setShouldRewriteConstAsVar): Deleted.
+
 2016-03-31  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed, rolling out r196854.
index 2457b91..22a42d2 100644 (file)
@@ -264,11 +264,6 @@ VM& JSDOMWindowBase::commonVM()
         vm->heap.machineThreads().addCurrentThread();
 #endif
 
-#if PLATFORM(MAC)
-        if (MacApplication::isITunes() || MacApplication::isIBooks() || Settings::shouldRewriteConstAsVar())
-            vm->setShouldRewriteConstAsVar(true);
-#endif
-
         initNormalWorldClientData(vm);
     }
 
index 25e6056..f627403 100644 (file)
@@ -97,7 +97,6 @@ bool Settings::gMockCaptureDevicesEnabled = false;
 bool Settings::gShouldUseHighResolutionTimers = true;
 #endif
     
-bool Settings::gShouldRewriteConstAsVar = false;
 bool Settings::gShouldRespectPriorityInCSSAttributeSetters = false;
 bool Settings::gLowPowerVideoAudioBufferSizeEnabled = false;
 bool Settings::gResourceLoadStatisticsEnabledEnabled = false;
index 33db5fe..d2600f5 100644 (file)
@@ -183,9 +183,6 @@ public:
     static bool shouldUseHighResolutionTimers() { return gShouldUseHighResolutionTimers; }
 #endif
 
-    static bool shouldRewriteConstAsVar() { return gShouldRewriteConstAsVar; }
-    static void setShouldRewriteConstAsVar(bool shouldRewriteConstAsVar) { gShouldRewriteConstAsVar = shouldRewriteConstAsVar; }
-
     WEBCORE_EXPORT void setBackgroundShouldExtendBeyondPage(bool);
     bool backgroundShouldExtendBeyondPage() const { return m_backgroundShouldExtendBeyondPage; }
 
@@ -366,7 +363,6 @@ private:
 #if PLATFORM(WIN)
     static bool gShouldUseHighResolutionTimers;
 #endif
-    WEBCORE_EXPORT static bool gShouldRewriteConstAsVar;
     static bool gShouldRespectPriorityInCSSAttributeSetters;
 #if PLATFORM(IOS)
     static bool gNetworkDataUsageTrackingEnabled;
index 3e30f19..0603e0a 100644 (file)
@@ -1,3 +1,19 @@
+2016-03-31  Saam barati  <sbarati@apple.com>
+
+        Revert rewrite const as var workaround
+        https://bugs.webkit.org/show_bug.cgi?id=155393
+
+        Reviewed by Mark Lam.
+
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode):
+        (WebKit::WebProcessCreationParameters::decode):
+        * Shared/WebProcessCreationParameters.h:
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::platformInitializeWebProcess):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+
 2016-03-31  Chris Dumez  <cdumez@apple.com>
 
         [iOS] Both WebPage's volatility timer and WebProcess's processSuspensionCleanupTimer are trying to make surfaces volatile with very short interval
index 8ff29f7..22d8d6c 100644 (file)
@@ -99,7 +99,6 @@ void WebProcessCreationParameters::encode(IPC::ArgumentEncoder& encoder) const
     encoder << resourceLoadStatisticsEnabled;
     encoder << fontWhitelist;
     encoder << iconDatabaseEnabled;
-    encoder << shouldRewriteConstAsVar;
     encoder << terminationTimeout;
     encoder << languages;
     encoder << textCheckerState;
@@ -220,8 +219,6 @@ bool WebProcessCreationParameters::decode(IPC::ArgumentDecoder& decoder, WebProc
         return false;
     if (!decoder.decode(parameters.iconDatabaseEnabled))
         return false;
-    if (!decoder.decode(parameters.shouldRewriteConstAsVar))
-        return false;
     if (!decoder.decode(parameters.terminationTimeout))
         return false;
     if (!decoder.decode(parameters.languages))
index e460a9e..7338a28 100644 (file)
@@ -112,7 +112,6 @@ struct WebProcessCreationParameters {
     Vector<String> fontWhitelist;
 
     bool iconDatabaseEnabled;
-    bool shouldRewriteConstAsVar { false };
 
     double terminationTimeout;
 
index 371c5b0..bfa0a9a 100644 (file)
@@ -172,10 +172,6 @@ void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters&
     parameters.shouldEnableMemoryPressureReliefLogging = [defaults boolForKey:@"LogMemoryJetsamDetails"];
     parameters.shouldSuppressMemoryPressureHandler = [defaults boolForKey:WebKitSuppressMemoryPressureHandlerDefaultsKey];
 
-#if PLATFORM(MAC)
-    parameters.shouldRewriteConstAsVar = MacApplication::isIBooks();
-#endif
-
 #if HAVE(HOSTED_CORE_ANIMATION)
 #if !PLATFORM(IOS)
     parameters.acceleratedCompositingPort = MachSendRight::create([CARemoteLayerServer sharedServer].serverPort);
index 2c2160a..c8d3c1f 100644 (file)
@@ -329,8 +329,6 @@ void WebProcess::initializeWebProcess(WebProcessCreationParameters&& parameters)
     for (auto& scheme : parameters.urlSchemesRegisteredAsAlwaysRevalidated)
         registerURLSchemeAsAlwaysRevalidated(scheme);
 
-    WebCore::Settings::setShouldRewriteConstAsVar(parameters.shouldRewriteConstAsVar);
-
 #if ENABLE(CACHE_PARTITIONING)
     for (auto& scheme : parameters.urlSchemesRegisteredAsCachePartitioned)
         registerURLSchemeAsCachePartitioned(scheme);