+2012-03-04 David Kilzer <ddkilzer@apple.com>
+
+ 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 JavaScriptCore/llint/LowLevelInterpreter.asm and ../../JSCLLIntOffsetsExtractor and creating assembly file LLIntAssembly.h.
+ ./JavaScriptCore/offlineasm/offsets.rb:145:in `offsetsAndConfigurationIndex': unhandled exception
+ from JavaScriptCore/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 JavaScriptCore/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 <jurij@wooyd.org>
SPARC also needs aligned accesses.
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
// compiler to kindly step aside and yield to our best intentions.
#include "LLIntDesiredOffsets.h"
return extractorTable;
+#else
+ return 0;
+#endif
}
} // namespace JSC
$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) +
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)
#
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