Title: [203355] branches/safari-602-branch/Source/_javascript_Core

Diff

Modified: branches/safari-602-branch/Source/_javascript_Core/ChangeLog (203354 => 203355)


--- branches/safari-602-branch/Source/_javascript_Core/ChangeLog	2016-07-18 18:48:23 UTC (rev 203354)
+++ branches/safari-602-branch/Source/_javascript_Core/ChangeLog	2016-07-18 18:51:13 UTC (rev 203355)
@@ -1,3 +1,37 @@
+2016-07-18  Babak Shafiei  <[email protected]>
+
+        Merge r203353.
+
+    2016-07-18  Youenn Fablet  <[email protected]>
+
+            REGRESSION(r202975): --minimal build is broken
+            https://bugs.webkit.org/show_bug.cgi?id=159765
+
+            Reviewed by Chris Dumez.
+
+            Covered partially by builtin generated test code.
+
+            Updating generator to add a global compilation guard around the code that generates all global internal properties.
+            Split the generate_methods function in two, one dedicated to the visit method and the second one dedicated to
+            the initialize method.
+
+            * Scripts/builtins/builtins_generate_internals_wrapper_implementation.py:
+            (BuiltinsInternalsWrapperImplementationGenerator.generate_section_for_object): Use splitted generation functions.
+            (BuiltinsInternalsWrapperImplementationGenerator.generate_visit_method): Response to generate the visit method.
+            (BuiltinsInternalsWrapperImplementationGenerator._generate_initialize_static_globals): Responsible to generate
+            the code to initialize the internal globals. This code is put in a global compilation guard in case all
+            internals are compiled out by specific builds.
+            (BuiltinsInternalsWrapperImplementationGenerator):
+            (BuiltinsInternalsWrapperImplementationGenerator.generate_initialize_method): Responsible to generate the
+            initialize method.
+            (BuiltinsInternalsWrapperImplementationGenerator.generate_methods): Deleted.
+            * Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result: Copyright change.
+            * Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result: Ditto.
+            * Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result: Ditto.
+            * Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result: Ditto.
+            * Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result: Reflects partially the built-in
+            generator change.
+
 2016-07-16  Filip Pizlo  <[email protected]>
 
         DFG CSE is broken for MultiGetByOffset

Modified: branches/safari-602-branch/Source/_javascript_Core/Scripts/builtins/builtins_generate_internals_wrapper_implementation.py (203354 => 203355)


--- branches/safari-602-branch/Source/_javascript_Core/Scripts/builtins/builtins_generate_internals_wrapper_implementation.py	2016-07-18 18:48:23 UTC (rev 203354)
+++ branches/safari-602-branch/Source/_javascript_Core/Scripts/builtins/builtins_generate_internals_wrapper_implementation.py	2016-07-18 18:51:13 UTC (rev 203355)
@@ -83,7 +83,8 @@
         lines = []
 
         lines.append(self.generate_constructor())
-        lines.append(self.generate_methods())
+        lines.append(self.generate_visit_method())
+        lines.append(self.generate_initialize_method())
         return '\n'.join(lines)
 
     def accessor_name(self, object):
@@ -113,26 +114,38 @@
         lines.append("#undef DECLARE_GLOBAL_STATIC")
         return '\n'.join(lines)
 
-    def generate_methods(self):
+    def generate_visit_method(self):
         lines = ["void JSBuiltinInternalFunctions::visit(JSC::SlotVisitor& visitor)",
                  "{"]
         for object in self.internals:
             visit = "    %s.visit(visitor);" % self.member_name(object)
             lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), visit))
-        lines.append("    UNUSED_PARAM(visitor);\n}")
+        lines.append("    UNUSED_PARAM(visitor);")
+        lines.append("}\n")
+        return '\n'.join(lines)
 
-        lines.append("void JSBuiltinInternalFunctions::initialize(JSDOMGlobalObject& globalObject)")
-        lines.append("{")
+    def _generate_initialize_static_globals(self):
+        lines = ["    JSVMClientData& clientData = *static_cast<JSVMClientData*>(m_vm.clientData);",
+                 "    JSDOMGlobalObject::GlobalPropertyInfo staticGlobals[] = {"]
         for object in self.internals:
-            init = "    %s.init(globalObject);" % self.member_name(object)
-            lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), init))
-
-        lines.append("    JSVMClientData& clientData = *static_cast<JSVMClientData*>(m_vm.clientData);")
-        lines.append("    JSDOMGlobalObject::GlobalPropertyInfo staticGlobals[] = {")
-        for object in self.internals:
             lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), self.property_macro(object)))
         lines.append("    };")
         lines.append("    globalObject.addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals));")
         lines.append("    UNUSED_PARAM(clientData);")
+        return '\n'.join(lines)
+
+    def generate_initialize_method(self):
+        lines = ["void JSBuiltinInternalFunctions::initialize(JSDOMGlobalObject& globalObject)",
+                "{",
+                "    UNUSED_PARAM(globalObject);"]
+
+        for object in self.internals:
+            init = "    %s.init(globalObject);" % self.member_name(object)
+            lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), init))
+        lines.append("")
+
+        guards = set([object.annotations.get('conditional') for object in self.internals if 'conditional' in object.annotations])
+        lines.append(BuiltinsGenerator.wrap_with_guard(" || ".join(guards), self._generate_initialize_static_globals()))
+
         lines.append("}")
         return '\n'.join(lines)

Modified: branches/safari-602-branch/Source/_javascript_Core/Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result (203354 => 203355)


--- branches/safari-602-branch/Source/_javascript_Core/Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result	2016-07-18 18:48:23 UTC (rev 203354)
+++ branches/safari-602-branch/Source/_javascript_Core/Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result	2016-07-18 18:51:13 UTC (rev 203355)
@@ -199,6 +199,7 @@
 ### Begin File: WebCoreJSBuiltins.h
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -260,6 +261,7 @@
 ### Begin File: WebCoreJSBuiltins.cpp
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -293,6 +295,7 @@
 ### Begin File: WebCoreJSBuiltinInternals.h
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -346,6 +349,7 @@
 ### Begin File: WebCoreJSBuiltinInternals.cpp
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -393,8 +397,11 @@
 {
     UNUSED_PARAM(visitor);
 }
+
 void JSBuiltinInternalFunctions::initialize(JSDOMGlobalObject& globalObject)
 {
+    UNUSED_PARAM(globalObject);
+
     JSVMClientData& clientData = *static_cast<JSVMClientData*>(m_vm.clientData);
     JSDOMGlobalObject::GlobalPropertyInfo staticGlobals[] = {
     };

Modified: branches/safari-602-branch/Source/_javascript_Core/Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result (203354 => 203355)


--- branches/safari-602-branch/Source/_javascript_Core/Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result	2016-07-18 18:48:23 UTC (rev 203354)
+++ branches/safari-602-branch/Source/_javascript_Core/Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result	2016-07-18 18:51:13 UTC (rev 203355)
@@ -199,6 +199,7 @@
 ### Begin File: WebCoreJSBuiltins.h
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -260,6 +261,7 @@
 ### Begin File: WebCoreJSBuiltins.cpp
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -293,6 +295,7 @@
 ### Begin File: WebCoreJSBuiltinInternals.h
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -346,6 +349,7 @@
 ### Begin File: WebCoreJSBuiltinInternals.cpp
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -393,8 +397,11 @@
 {
     UNUSED_PARAM(visitor);
 }
+
 void JSBuiltinInternalFunctions::initialize(JSDOMGlobalObject& globalObject)
 {
+    UNUSED_PARAM(globalObject);
+
     JSVMClientData& clientData = *static_cast<JSVMClientData*>(m_vm.clientData);
     JSDOMGlobalObject::GlobalPropertyInfo staticGlobals[] = {
     };

Modified: branches/safari-602-branch/Source/_javascript_Core/Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result (203354 => 203355)


--- branches/safari-602-branch/Source/_javascript_Core/Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result	2016-07-18 18:48:23 UTC (rev 203354)
+++ branches/safari-602-branch/Source/_javascript_Core/Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result	2016-07-18 18:51:13 UTC (rev 203355)
@@ -231,6 +231,7 @@
 ### Begin File: WebCoreJSBuiltins.h
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -295,6 +296,7 @@
 ### Begin File: WebCoreJSBuiltins.cpp
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -328,6 +330,7 @@
 ### Begin File: WebCoreJSBuiltinInternals.h
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -388,6 +391,7 @@
 ### Begin File: WebCoreJSBuiltinInternals.cpp
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -441,11 +445,15 @@
 #endif // ENABLE(STREAMS_API)
     UNUSED_PARAM(visitor);
 }
+
 void JSBuiltinInternalFunctions::initialize(JSDOMGlobalObject& globalObject)
 {
+    UNUSED_PARAM(globalObject);
 #if ENABLE(STREAMS_API)
     m_guardedInternalBuiltin.init(globalObject);
 #endif // ENABLE(STREAMS_API)
+
+#if ENABLE(STREAMS_API)
     JSVMClientData& clientData = *static_cast<JSVMClientData*>(m_vm.clientData);
     JSDOMGlobalObject::GlobalPropertyInfo staticGlobals[] = {
 #if ENABLE(STREAMS_API)
@@ -458,6 +466,7 @@
     };
     globalObject.addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals));
     UNUSED_PARAM(clientData);
+#endif // ENABLE(STREAMS_API)
 }
 
 } // namespace WebCore

Modified: branches/safari-602-branch/Source/_javascript_Core/Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result (203354 => 203355)


--- branches/safari-602-branch/Source/_javascript_Core/Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result	2016-07-18 18:48:23 UTC (rev 203354)
+++ branches/safari-602-branch/Source/_javascript_Core/Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result	2016-07-18 18:51:13 UTC (rev 203355)
@@ -190,6 +190,7 @@
 ### Begin File: WebCoreJSBuiltins.h
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -245,6 +246,7 @@
 ### Begin File: WebCoreJSBuiltins.cpp
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -278,6 +280,7 @@
 ### Begin File: WebCoreJSBuiltinInternals.h
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -331,6 +334,7 @@
 ### Begin File: WebCoreJSBuiltinInternals.cpp
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -378,8 +382,11 @@
 {
     UNUSED_PARAM(visitor);
 }
+
 void JSBuiltinInternalFunctions::initialize(JSDOMGlobalObject& globalObject)
 {
+    UNUSED_PARAM(globalObject);
+
     JSVMClientData& clientData = *static_cast<JSVMClientData*>(m_vm.clientData);
     JSDOMGlobalObject::GlobalPropertyInfo staticGlobals[] = {
     };

Modified: branches/safari-602-branch/Source/_javascript_Core/Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result (203354 => 203355)


--- branches/safari-602-branch/Source/_javascript_Core/Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result	2016-07-18 18:48:23 UTC (rev 203354)
+++ branches/safari-602-branch/Source/_javascript_Core/Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result	2016-07-18 18:51:13 UTC (rev 203355)
@@ -282,6 +282,7 @@
 ### Begin File: WebCoreJSBuiltins.h
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -346,6 +347,7 @@
 ### Begin File: WebCoreJSBuiltins.cpp
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -379,6 +381,7 @@
 ### Begin File: WebCoreJSBuiltinInternals.h
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -439,6 +442,7 @@
 ### Begin File: WebCoreJSBuiltinInternals.cpp
 /*
  * Copyright (c) 2015 Canon Inc. All rights reserved.
+ * Copyright (c) 2016 Apple Inc. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -492,11 +496,15 @@
 #endif // ENABLE(STREAMS_API)
     UNUSED_PARAM(visitor);
 }
+
 void JSBuiltinInternalFunctions::initialize(JSDOMGlobalObject& globalObject)
 {
+    UNUSED_PARAM(globalObject);
 #if ENABLE(STREAMS_API)
     m_xmlCasingTest.init(globalObject);
 #endif // ENABLE(STREAMS_API)
+
+#if ENABLE(STREAMS_API)
     JSVMClientData& clientData = *static_cast<JSVMClientData*>(m_vm.clientData);
     JSDOMGlobalObject::GlobalPropertyInfo staticGlobals[] = {
 #if ENABLE(STREAMS_API)
@@ -509,6 +517,7 @@
     };
     globalObject.addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals));
     UNUSED_PARAM(clientData);
+#endif // ENABLE(STREAMS_API)
 }
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to