Changeset 209553 in webkit


Ignore:
Timestamp:
Dec 8, 2016 11:43:31 AM (7 years ago)
Author:
mark.lam@apple.com
Message:

Enable JSC restricted options by default in the jsc shell.
https://bugs.webkit.org/show_bug.cgi?id=165615

Reviewed by Keith Miller.

The jsc shell is only used for debugging and development testing. We should
allow it to use restricted options like JSC_useDollarVM even for release builds.

  • jsc.cpp:

(jscmain):

  • runtime/Options.cpp:

(JSC::Options::enableRestrictedOptions):
(JSC::Options::isAvailable):
(JSC::allowRestrictedOptions): Deleted.

  • runtime/Options.h:
Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r209544 r209553  
     12016-12-08  Mark Lam  <mark.lam@apple.com>
     2
     3        Enable JSC restricted options by default in the jsc shell.
     4        https://bugs.webkit.org/show_bug.cgi?id=165615
     5
     6        Reviewed by Keith Miller.
     7
     8        The jsc shell is only used for debugging and development testing.  We should
     9        allow it to use restricted options like JSC_useDollarVM even for release builds.
     10
     11        * jsc.cpp:
     12        (jscmain):
     13        * runtime/Options.cpp:
     14        (JSC::Options::enableRestrictedOptions):
     15        (JSC::Options::isAvailable):
     16        (JSC::allowRestrictedOptions): Deleted.
     17        * runtime/Options.h:
     18
    1192016-12-08  Chris Dumez  <cdumez@apple.com>
    220
  • trunk/Source/JavaScriptCore/jsc.cpp

    r209500 r209553  
    32223222int jscmain(int argc, char** argv)
    32233223{
     3224    // Need to override and enable restricted options before we start parsing options below.
     3225    Options::enableRestrictedOptions(true);
     3226
    32243227    // Note that the options parsing can affect VM creation, and thus
    32253228    // comes first.
  • trunk/Source/JavaScriptCore/runtime/Options.cpp

    r208866 r209553  
    5656namespace JSC {
    5757
    58 static bool allowRestrictedOptions()
    59 {
     58namespace {
    6059#ifdef NDEBUG
    61     return false;
     60bool restrictedOptionsEnabled = false;
    6261#else
    63     return true;
    64 #endif
    65 }
    66 
     62bool restrictedOptionsEnabled = true;
     63#endif
     64}
     65
     66void Options::enableRestrictedOptions(bool enableOrNot)
     67{
     68    restrictedOptionsEnabled = enableOrNot;
     69}
     70   
    6771static bool parse(const char* string, bool& value)
    6872{
     
    129133{
    130134    if (availability == Availability::Restricted)
    131         return allowRestrictedOptions();
     135        return restrictedOptionsEnabled;
    132136    ASSERT(availability == Availability::Configurable);
    133137   
  • trunk/Source/JavaScriptCore/runtime/Options.h

    r208897 r209553  
    507507    JS_EXPORT_PRIVATE static void ensureOptionsAreCoherent();
    508508
     509    JS_EXPORT_PRIVATE static void enableRestrictedOptions(bool enableOrNot);
     510
    509511    // Declare accessors for each option:
    510512#define FOR_EACH_OPTION(type_, name_, defaultValue_, availability_, description_) \
Note: See TracChangeset for help on using the changeset viewer.