Title: [109678] trunk/Source/_javascript_Core
Revision
109678
Author
[email protected]
Date
2012-03-04 10:53:51 -0800 (Sun, 04 Mar 2012)

Log Message

Fix build when the classic interpreter is enabled

Reviewed by Gavin Barraclough.

Fixes the following build error when running the "Generate
Derived Sources" build phase script:

    offlineasm: Parsing _javascript_Core/llint/LowLevelInterpreter.asm and ../../JSCLLIntOffsetsExtractor and creating assembly file LLIntAssembly.h.
    ./_javascript_Core/offlineasm/offsets.rb:145:in `offsetsAndConfigurationIndex': unhandled exception
            from _javascript_Core/offlineasm/asm.rb:131
    Command /bin/sh failed with exit code 1

Gavin's fix in r109674 avoided the #error statement in
JITStubs.h when compiling LLIntOffsetsExtractor.cpp, but it
caused the "Generate Derived Sources" build phase script to fail
when _javascript_Core/offlineasm/asm.rb was run.  The solution is
to detect when the classic interpreter is being built and simply
exit early from asm.rb in that case.

* llint/LLIntOffsetsExtractor.cpp:
(JSC::LLIntOffsetsExtractor::dummy): Return NULL pointer if the
JIT is disabled.  Note that offsets.rb doesn't care about the
return value here, but instead it cares about finding the magic
values in the binary.  The magic values are no longer present
when the JIT is disabled.
* offlineasm/asm.rb: Catch MissingMagicValuesException and exit
early with a status message.
* offlineasm/offsets.rb:
(MissingMagicValuesException): Add new exception class.
(offsetsAndConfigurationIndex): Throw
MissingMagicValuesException when no magic values are found.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (109677 => 109678)


--- trunk/Source/_javascript_Core/ChangeLog	2012-03-04 17:11:45 UTC (rev 109677)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-03-04 18:53:51 UTC (rev 109678)
@@ -1,3 +1,37 @@
+2012-03-04  David Kilzer  <[email protected]>
+
+        Fix build when the classic interpreter is enabled
+
+        Reviewed by Gavin Barraclough.
+
+        Fixes the following build error when running the "Generate
+        Derived Sources" build phase script:
+
+            offlineasm: Parsing _javascript_Core/llint/LowLevelInterpreter.asm and ../../JSCLLIntOffsetsExtractor and creating assembly file LLIntAssembly.h.
+            ./_javascript_Core/offlineasm/offsets.rb:145:in `offsetsAndConfigurationIndex': unhandled exception
+                    from _javascript_Core/offlineasm/asm.rb:131
+            Command /bin/sh failed with exit code 1
+
+        Gavin's fix in r109674 avoided the #error statement in
+        JITStubs.h when compiling LLIntOffsetsExtractor.cpp, but it
+        caused the "Generate Derived Sources" build phase script to fail
+        when _javascript_Core/offlineasm/asm.rb was run.  The solution is
+        to detect when the classic interpreter is being built and simply
+        exit early from asm.rb in that case.
+
+        * llint/LLIntOffsetsExtractor.cpp:
+        (JSC::LLIntOffsetsExtractor::dummy): Return NULL pointer if the
+        JIT is disabled.  Note that offsets.rb doesn't care about the
+        return value here, but instead it cares about finding the magic
+        values in the binary.  The magic values are no longer present
+        when the JIT is disabled.
+        * offlineasm/asm.rb: Catch MissingMagicValuesException and exit
+        early with a status message.
+        * offlineasm/offsets.rb:
+        (MissingMagicValuesException): Add new exception class.
+        (offsetsAndConfigurationIndex): Throw
+        MissingMagicValuesException when no magic values are found.
+
 2012-03-04  Jurij Smakov  <[email protected]>
 
         SPARC also needs aligned accesses.

Modified: trunk/Source/_javascript_Core/llint/LLIntOffsetsExtractor.cpp (109677 => 109678)


--- trunk/Source/_javascript_Core/llint/LLIntOffsetsExtractor.cpp	2012-03-04 17:11:45 UTC (rev 109677)
+++ trunk/Source/_javascript_Core/llint/LLIntOffsetsExtractor.cpp	2012-03-04 18:53:51 UTC (rev 109678)
@@ -61,6 +61,7 @@
 
 const unsigned* LLIntOffsetsExtractor::dummy()
 {
+#if ENABLE(JIT)
 // This is a file generated by offlineasm/generate_offsets_extractor.rb, and contains code
 // to create a table of offsets, sizes, and a header identifying what combination of
 // Platform.h macros we have set. We include it inside of a method on LLIntOffsetsExtractor
@@ -69,6 +70,9 @@
 // compiler to kindly step aside and yield to our best intentions.
 #include "LLIntDesiredOffsets.h"
     return extractorTable;
+#else
+    return 0;
+#endif
 }
 
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/offlineasm/asm.rb (109677 => 109678)


--- trunk/Source/_javascript_Core/offlineasm/asm.rb	2012-03-04 17:11:45 UTC (rev 109677)
+++ trunk/Source/_javascript_Core/offlineasm/asm.rb	2012-03-04 18:53:51 UTC (rev 109678)
@@ -128,7 +128,12 @@
 
 $stderr.puts "offlineasm: Parsing #{asmFile} and #{offsetsFile} and creating assembly file #{outputFlnm}."
 
-configurationList = offsetsAndConfigurationIndex(offsetsFile)
+begin
+    configurationList = offsetsAndConfigurationIndex(offsetsFile)
+rescue MissingMagicValuesException
+    $stderr.puts "offlineasm: No magic values found. Skipping assembly file generation assuming the classic interpreter is enabled."
+    exit 0
+end
 
 inputHash =
     "// offlineasm input hash: " + parseHash(asmFile) +

Modified: trunk/Source/_javascript_Core/offlineasm/offsets.rb (109677 => 109678)


--- trunk/Source/_javascript_Core/offlineasm/offsets.rb	2012-03-04 17:11:45 UTC (rev 109677)
+++ trunk/Source/_javascript_Core/offlineasm/offsets.rb	2012-03-04 18:53:51 UTC (rev 109678)
@@ -27,6 +27,16 @@
 OFFSET_MAGIC_NUMBERS = [ 0xec577ac7, 0x0ff5e755 ]
 
 #
+# MissingMagicValuesException
+#
+# Thrown when magic values are missing from the binary.
+# This is usually an indication that the classic interpreter is enabled.
+#
+
+class MissingMagicValuesException < Exception
+end
+
+#
 # offsetsList(ast)
 # sizesList(ast)
 #
@@ -142,7 +152,7 @@
         end
     }
     
-    raise unless result.length >= 1
+    raise MissingMagicValuesException unless result.length >= 1
     raise if result.map{|v| v[1]}.uniq.size < result.map{|v| v[1]}.size
     
     result
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to