Title: [131748] trunk/Source/_javascript_Core
Revision
131748
Author
[email protected]
Date
2012-10-18 07:18:58 -0700 (Thu, 18 Oct 2012)

Log Message

[CMake] Avoid unnecessarily running the LLInt generation commands.
https://bugs.webkit.org/show_bug.cgi?id=99708

Reviewed by Rob Buis.

As described in the comments in the change itself, in some cases
the Ruby generation scripts used when LLInt is on would each be
run twice in every build even if nothing had changed.

Fix that by not setting the OBJECT_DEPENDS property of some source
files to depend on the generated headers; instead, they are now
just part of the final binaries/libraries which use them.

* CMakeLists.txt:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/CMakeLists.txt (131747 => 131748)


--- trunk/Source/_javascript_Core/CMakeLists.txt	2012-10-18 14:17:22 UTC (rev 131747)
+++ trunk/Source/_javascript_Core/CMakeLists.txt	2012-10-18 14:18:58 UTC (rev 131748)
@@ -337,8 +337,19 @@
         COMMAND ${RUBY_EXECUTABLE} ${_javascript_CORE_DIR}/offlineasm/generate_offset_extractor.rb ${_javascript_CORE_DIR}/llint/LowLevelInterpreter.asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
         VERBATIM)
 
-    ADD_SOURCE_DEPENDENCIES(${_javascript_CORE_DIR}/llint/LLIntOffsetsExtractor.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h)
-    ADD_EXECUTABLE(LLIntOffsetsExtractor ${_javascript_CORE_DIR}/llint/LLIntOffsetsExtractor.cpp)
+    # We add the header file directly to the ADD_EXECUTABLE call instead of setting the
+    # OBJECT_DEPENDS property in LLIntOffsetsExtractor.cpp because generate_offset_extractor.rb may
+    # not regenerate it in case the hash it calculates does not change.
+    # In this case, if some of the dependencies specified in the ADD_CUSTOM_COMMAND above have
+    # changed the command will always be called because the mtime of LLIntDesiredOffsets.h will
+    # always be older than that of its dependencies.
+    # Additionally, setting the OBJECT_DEPENDS property will make LLIntDesiredOffsets.h a Makefile
+    # dependency of both LLIntOffsetsExtractor and LLIntOffsetsExtractor.cpp, so the command will
+    # actually be run twice!
+    ADD_EXECUTABLE(LLIntOffsetsExtractor
+        ${_javascript_CORE_DIR}/llint/LLIntOffsetsExtractor.cpp
+        ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
+    )
     TARGET_LINK_LIBRARIES(LLIntOffsetsExtractor ${WTF_LIBRARY_NAME})
 
     ADD_CUSTOM_COMMAND(
@@ -348,7 +359,13 @@
         COMMAND ${RUBY_EXECUTABLE} ${_javascript_CORE_DIR}/offlineasm/asm.rb ${_javascript_CORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntOffsetsExtractor> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
         VERBATIM)
 
-    ADD_SOURCE_DEPENDENCIES(${_javascript_CORE_DIR}/llint/LowLevelInterpreter.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h)
+    # The explanation for not making LLIntAssembly.h part of the OBJECT_DEPENDS property of some of
+    # the .cpp files below is similar to the one in the previous comment. However, since these .cpp
+    # files are used to build _javascript_Core itself, we can just add LLIntAssembly.h to JSC_HEADERS
+    # since it is used in the ADD_LIBRARY() call at the end of this file.
+    LIST(APPEND _javascript_Core_HEADERS
+        ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
+    )
     LIST(APPEND _javascript_Core_SOURCES
         llint/LLIntCLoop.cpp
         llint/LLIntData.cpp

Modified: trunk/Source/_javascript_Core/ChangeLog (131747 => 131748)


--- trunk/Source/_javascript_Core/ChangeLog	2012-10-18 14:17:22 UTC (rev 131747)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-10-18 14:18:58 UTC (rev 131748)
@@ -1,3 +1,20 @@
+2012-10-18  Raphael Kubo da Costa  <[email protected]>
+
+        [CMake] Avoid unnecessarily running the LLInt generation commands.
+        https://bugs.webkit.org/show_bug.cgi?id=99708
+
+        Reviewed by Rob Buis.
+
+        As described in the comments in the change itself, in some cases
+        the Ruby generation scripts used when LLInt is on would each be
+        run twice in every build even if nothing had changed.
+
+        Fix that by not setting the OBJECT_DEPENDS property of some source
+        files to depend on the generated headers; instead, they are now
+        just part of the final binaries/libraries which use them.
+
+        * CMakeLists.txt:
+
 2012-10-17  Zoltan Horvath  <[email protected]>
 
         Remove the JSHeap memory measurement of the PageLoad performacetests since it creates bogus JSGlobalDatas
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to