- Revision
- 172777
- Author
- [email protected]
- Date
- 2014-08-19 16:25:37 -0700 (Tue, 19 Aug 2014)
Log Message
LLInt build should be way faster
https://bugs.webkit.org/show_bug.cgi?id=136085
Reviewed by Geoffrey Garen.
This does three things to improve the LLInt build performance. One of them is only for
Xcode for now while the others should benefit all platforms:
- Don't exponentially build settings combinations that correspond to being on two backends
simultaneously. This is by far the biggest win.
- Don't generate offset extraction code for backends that aren't supported by the current
port. This currently only works on Xcode-based ports. This is a relatively small win.
- Remove the ALWAYS_ALLOCATE_SLOW option. Each option increases build time, and we haven't
used this one in a long time. Anyway, setting this option could be emulated by just
directly hacking the code.
This is an enormous speed-up in the LLInt build.
* _javascript_Core.xcodeproj/project.pbxproj: Prune the set of backends that we should consider on Xcode-based platforms.
* llint/LLIntOfflineAsmConfig.h: Remove ALWAYS_ALLOCATE_SLOW
* llint/LowLevelInterpreter.asm: Remove ALWAYS_ALLOCATE_SLOW
* offlineasm/backends.rb: Add infrastructure for reasoning about valid backends.
* offlineasm/generate_offset_extractor.rb: Allow the client to specify a filtered set of valid backends.
* offlineasm/settings.rb: Improve the construction of settings combinations so that it doesn't traverse the enourmous set of obviously invalid multi-backend combinations. Also glue into support for valid backends.
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (172776 => 172777)
--- trunk/Source/_javascript_Core/ChangeLog 2014-08-19 23:20:37 UTC (rev 172776)
+++ trunk/Source/_javascript_Core/ChangeLog 2014-08-19 23:25:37 UTC (rev 172777)
@@ -1,5 +1,34 @@
2014-08-19 Filip Pizlo <[email protected]>
+ LLInt build should be way faster
+ https://bugs.webkit.org/show_bug.cgi?id=136085
+
+ Reviewed by Geoffrey Garen.
+
+ This does three things to improve the LLInt build performance. One of them is only for
+ Xcode for now while the others should benefit all platforms:
+
+ - Don't exponentially build settings combinations that correspond to being on two backends
+ simultaneously. This is by far the biggest win.
+
+ - Don't generate offset extraction code for backends that aren't supported by the current
+ port. This currently only works on Xcode-based ports. This is a relatively small win.
+
+ - Remove the ALWAYS_ALLOCATE_SLOW option. Each option increases build time, and we haven't
+ used this one in a long time. Anyway, setting this option could be emulated by just
+ directly hacking the code.
+
+ This is an enormous speed-up in the LLInt build.
+
+ * _javascript_Core.xcodeproj/project.pbxproj: Prune the set of backends that we should consider on Xcode-based platforms.
+ * llint/LLIntOfflineAsmConfig.h: Remove ALWAYS_ALLOCATE_SLOW
+ * llint/LowLevelInterpreter.asm: Remove ALWAYS_ALLOCATE_SLOW
+ * offlineasm/backends.rb: Add infrastructure for reasoning about valid backends.
+ * offlineasm/generate_offset_extractor.rb: Allow the client to specify a filtered set of valid backends.
+ * offlineasm/settings.rb: Improve the construction of settings combinations so that it doesn't traverse the enourmous set of obviously invalid multi-backend combinations. Also glue into support for valid backends.
+
+2014-08-19 Filip Pizlo <[email protected]>
+
Fix indentation and style in LowLevelInterpreter.asm
https://bugs.webkit.org/show_bug.cgi?id=136083
Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (172776 => 172777)
--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2014-08-19 23:20:37 UTC (rev 172776)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2014-08-19 23:25:37 UTC (rev 172777)
@@ -6788,7 +6788,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "set -e\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/\"\n\n/usr/bin/env ruby \"${SRCROOT}/offlineasm/generate_offset_extractor.rb\" \"-I${BUILT_PRODUCTS_DIR}/DerivedSources/_javascript_Core\" \"${SRCROOT}/llint/LowLevelInterpreter.asm\" \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/LLIntDesiredOffsets.h\"\n";
+ shellScript = "set -e\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/\"\n\n/usr/bin/env ruby \"${SRCROOT}/offlineasm/generate_offset_extractor.rb\" \"-I${BUILT_PRODUCTS_DIR}/DerivedSources/_javascript_Core\" \"${SRCROOT}/llint/LowLevelInterpreter.asm\" \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/LLIntDesiredOffsets.h\" \"X86,X86_64,ARMv7,ARMv7s,ARM64,C_LOOP\"\n";
};
0FCEFAD91806191800472CE4 /* Copy LLVM Library Into Framework */ = {
isa = PBXShellScriptBuildPhase;
Modified: trunk/Source/_javascript_Core/llint/LLIntOfflineAsmConfig.h (172776 => 172777)
--- trunk/Source/_javascript_Core/llint/LLIntOfflineAsmConfig.h 2014-08-19 23:20:37 UTC (rev 172776)
+++ trunk/Source/_javascript_Core/llint/LLIntOfflineAsmConfig.h 2014-08-19 23:25:37 UTC (rev 172777)
@@ -154,12 +154,6 @@
#define OFFLINE_ASM_EXECUTION_TRACING 0
#endif
-#if LLINT_ALWAYS_ALLOCATE_SLOW
-#define OFFLINE_ASM_ALWAYS_ALLOCATE_SLOW 1
-#else
-#define OFFLINE_ASM_ALWAYS_ALLOCATE_SLOW 0
-#endif
-
#if ENABLE(GGC)
#define OFFLINE_ASM_GGC 1
#else
Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter.asm (172776 => 172777)
--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter.asm 2014-08-19 23:20:37 UTC (rev 172776)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter.asm 2014-08-19 23:25:37 UTC (rev 172777)
@@ -658,25 +658,21 @@
end
macro allocateJSObject(allocator, structure, result, scratch1, slowCase)
- if ALWAYS_ALLOCATE_SLOW
- jmp slowCase
- else
- const offsetOfFirstFreeCell =
- MarkedAllocator::m_freeList +
- MarkedBlock::FreeList::head
+ const offsetOfFirstFreeCell =
+ MarkedAllocator::m_freeList +
+ MarkedBlock::FreeList::head
- # Get the object from the free list.
- loadp offsetOfFirstFreeCell[allocator], result
- btpz result, slowCase
-
- # Remove the object from the free list.
- loadp [result], scratch1
- storep scratch1, offsetOfFirstFreeCell[allocator]
+ # Get the object from the free list.
+ loadp offsetOfFirstFreeCell[allocator], result
+ btpz result, slowCase
- # Initialize the object.
- storep 0, JSObject::m_butterfly[result]
- storeStructureWithTypeInfo(result, structure, scratch1)
- end
+ # Remove the object from the free list.
+ loadp [result], scratch1
+ storep scratch1, offsetOfFirstFreeCell[allocator]
+
+ # Initialize the object.
+ storep 0, JSObject::m_butterfly[result]
+ storeStructureWithTypeInfo(result, structure, scratch1)
end
macro doReturn()
Modified: trunk/Source/_javascript_Core/offlineasm/backends.rb (172776 => 172777)
--- trunk/Source/_javascript_Core/offlineasm/backends.rb 2014-08-19 23:20:37 UTC (rev 172776)
+++ trunk/Source/_javascript_Core/offlineasm/backends.rb 2014-08-19 23:25:37 UTC (rev 172777)
@@ -67,6 +67,37 @@
BACKEND_PATTERN = Regexp.new('\\A(' + BACKENDS.join(')|(') + ')\\Z')
+$allBackends = {}
+$validBackends = {}
+BACKENDS.each {
+ | backend |
+ $validBackends[backend] = true
+ $allBackends[backend] = true
+}
+
+def includeOnlyBackends(list)
+ newValidBackends = {}
+ list.each {
+ | backend |
+ if $validBackends[backend]
+ newValidBackends[backend] = true
+ end
+ }
+ $validBackends = newValidBackends
+end
+
+def isBackend?(backend)
+ $allBackends[backend]
+end
+
+def isValidBackend?(backend)
+ $validBackends[backend]
+end
+
+def validBackends
+ $validBackends.keys
+end
+
class Node
def lower(name)
begin
Modified: trunk/Source/_javascript_Core/offlineasm/generate_offset_extractor.rb (172776 => 172777)
--- trunk/Source/_javascript_Core/offlineasm/generate_offset_extractor.rb 2014-08-19 23:20:37 UTC (rev 172776)
+++ trunk/Source/_javascript_Core/offlineasm/generate_offset_extractor.rb 2014-08-19 23:25:37 UTC (rev 172777)
@@ -39,6 +39,12 @@
inputFlnm = ARGV.shift
outputFlnm = ARGV.shift
+validBackends = ARGV.shift
+if validBackends
+ $stderr.puts "Only dealing with backends: #{validBackends}"
+ includeOnlyBackends(validBackends.split(","))
+end
+
$stderr.puts "offlineasm: Parsing #{inputFlnm} and creating offset extractor #{outputFlnm}."
def emitMagicNumber
Modified: trunk/Source/_javascript_Core/offlineasm/settings.rb (172776 => 172777)
--- trunk/Source/_javascript_Core/offlineasm/settings.rb 2014-08-19 23:20:37 UTC (rev 172776)
+++ trunk/Source/_javascript_Core/offlineasm/settings.rb 2014-08-19 23:25:37 UTC (rev 172777)
@@ -54,8 +54,29 @@
settingsCombinator(settingsCombinations, newMap, remaining[1..-1])
end
- settingsCombinator(settingsCombinations, {}, (ast.filter(Setting).uniq.collect{|v| v.name} + BACKENDS).uniq)
+ nonBackendSettings = ast.filter(Setting).uniq.collect{ |v| v.name }
+ nonBackendSettings.delete_if {
+ | setting |
+ isBackend? setting
+ }
+ allBackendsFalse = {}
+ BACKENDS.each {
+ | backend |
+ allBackendsFalse[backend] = false
+ }
+
+ # This will create entries for invalid backends. That's fine. It's necessary
+ # because it ensures that generate_offsets_extractor (which knows about valid
+ # backends) has settings indices that are compatible with what asm will see
+ # (asm doesn't know about valid backends).
+ BACKENDS.each {
+ | backend |
+ map = allBackendsFalse.clone
+ map[backend] = true
+ settingsCombinator(settingsCombinations, map, nonBackendSettings)
+ }
+
settingsCombinations
end
@@ -73,15 +94,13 @@
selectedBackend = nil
BACKENDS.each {
| backend |
- isSupported = concreteSettings[backend]
- raise unless isSupported != nil
- numClaimedBackends += if isSupported then 1 else 0 end
- if isSupported
+ if concreteSettings[backend]
+ raise if selectedBackend
selectedBackend = backend
end
}
- return if numClaimedBackends > 1
+ return unless isValidBackend? selectedBackend
# Resolve the AST down to a low-level form (no macros or conditionals).
lowLevelAST = ast.resolveSettings(concreteSettings)