Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit ff27eed

Browse files
Merge r169628 from ftlopt.
2014-06-04 Matthew Mirman <[email protected]> Added system for inlining native functions via the FTL. https://bugs.webkit.org/show_bug.cgi?id=131515 Reviewed by Filip Pizlo. Also fixed the build to not compress the bitcode and to include all of the relevant runtime. With GCC_GENERATE_DEBUGGING_SYMBOLS = NO, the produced bitcode files are a 100th the size they were before. Now we can include all of the relevant runtime files with only a 3mb overhead. This is the same overhead as for two compressed files before, but done more efficiently (on both ends) and with less code. Deciding whether to inline native functions is left up to LLVM. The entire module containing the function is linked into the current compiled JS so that inlining the native functions shouldn't make them smaller. Rather than loading Runtime.symtbl at runtime FTLState.cpp now generates a file InlineRuntimeSymbolTable.h which statically builds the symbol table hash table. * JavaScriptCore.xcodeproj/project.pbxproj: Added back runtime files to compile. * build-symbol-table-index.py: Changed bitcode suffix. Added inclusion of only tested symbols. Added output to InlineRuntimeSymbolTable.h. * build-symbol-table-index.sh: Changed bitcode suffix. * copy-llvm-ir-to-derived-sources.sh: Removed gzip compression. * tested-symbols.symlst: Added. * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::handleCall): Now sets the knownFunction of the call node if such a function exists and emits a check that during runtime the callee is in fact known. * dfg/DFGNode.h: Added functions to set the known function of a call node. (JSC::DFG::Node::canBeKnownFunction): Added. (JSC::DFG::Node::hasKnownFunction): Added. (JSC::DFG::Node::knownFunction): Added. (JSC::DFG::Node::giveKnownFunction): Added. * ftl/FTLAbbreviatedTypes.h: Added a typedef for LLVMMemoryBufferRef * ftl/FTLAbbreviations.h: Added some abbreviations. * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::isInlinableSize): Added. Hardcoded threshold to 275. (JSC::FTL::LowerDFGToLLVM::getModuleByPathForSymbol): Added. (JSC::FTL::LowerDFGToLLVM::getFunctionBySymbol): Added. (JSC::FTL::LowerDFGToLLVM::possiblyCompileInlineableNativeCall): Added. (JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct): Added call to possiblyCompileInlineableNativeCall * ftl/FTLOutput.h: (JSC::FTL::Output::allocaName): Added. Useful for debugging. * ftl/FTLState.cpp: (JSC::FTL::State::State): Added an include for InlineRuntimeSymbolTable.h * ftl/FTLState.h: Added symbol table hash table. * ftl/FTLCompile.cpp: (JSC::FTL::compile): Added inlining and dead function elimination passes. * heap/HandleStack.h: Added JS_EXPORT_PRIVATE to a few functions to get inlining to compile. * llvm/InitializeLLVMMac.mm: Deleted. * llvm/InitializeLLVMMac.cpp: Added. * llvm/LLVMAPIFunctions.h: Added macros to include Bitcode parsing and linking functions. * llvm/LLVMHeaders.h: Added includes for Bitcode parsing and linking. * runtime/BundlePath.h: Added. * runtime/BundlePath.mm: Added. * runtime/DateInstance.h: Added JS_EXPORT_PRIVATE to a few functions to get inlining to compile. * runtime/DateInstance.h: ditto. * runtime/DateConversion.h: ditto. * runtime/ExceptionHelpers.h: ditto. * runtime/JSCJSValue.h: ditto. * runtime/JSArray.h: ditto. * runtime/JSDateMath.h: ditto. * runtime/JSObject.h: ditto. * runtime/JSObject.h: ditto. * runtime/RegExp.h: ditto. * runtime/Structure.h: ditto. * runtime/Options.h: Added maximumLLVMInstructionCountForNativeInlining. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171391 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent b2c3028 commit ff27eed

33 files changed

+1514
-130
lines changed

Source/JavaScriptCore/ChangeLog

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,81 @@
1+
2014-07-22 Filip Pizlo <[email protected]>
2+
3+
Merge r169628 from ftlopt.
4+
5+
2014-06-04 Matthew Mirman <[email protected]>
6+
7+
Added system for inlining native functions via the FTL.
8+
https://bugs.webkit.org/show_bug.cgi?id=131515
9+
10+
Reviewed by Filip Pizlo.
11+
12+
Also fixed the build to not compress the bitcode and to
13+
include all of the relevant runtime. With GCC_GENERATE_DEBUGGING_SYMBOLS = NO,
14+
the produced bitcode files are a 100th the size they were before.
15+
Now we can include all of the relevant runtime files with only a 3mb overhead.
16+
This is the same overhead as for two compressed files before,
17+
but done more efficiently (on both ends) and with less code.
18+
19+
Deciding whether to inline native functions is left up to LLVM.
20+
The entire module containing the function is linked into the current
21+
compiled JS so that inlining the native functions shouldn't make them smaller.
22+
23+
Rather than loading Runtime.symtbl at runtime FTLState.cpp now generates a file
24+
InlineRuntimeSymbolTable.h which statically builds the symbol table hash table.
25+
26+
* JavaScriptCore.xcodeproj/project.pbxproj: Added back runtime files to compile.
27+
* build-symbol-table-index.py: Changed bitcode suffix.
28+
Added inclusion of only tested symbols.
29+
Added output to InlineRuntimeSymbolTable.h.
30+
* build-symbol-table-index.sh: Changed bitcode suffix.
31+
* copy-llvm-ir-to-derived-sources.sh: Removed gzip compression.
32+
* tested-symbols.symlst: Added.
33+
* dfg/DFGByteCodeParser.cpp:
34+
(JSC::DFG::ByteCodeParser::handleCall):
35+
Now sets the knownFunction of the call node if such a function exists
36+
and emits a check that during runtime the callee is in fact known.
37+
* dfg/DFGNode.h:
38+
Added functions to set the known function of a call node.
39+
(JSC::DFG::Node::canBeKnownFunction): Added.
40+
(JSC::DFG::Node::hasKnownFunction): Added.
41+
(JSC::DFG::Node::knownFunction): Added.
42+
(JSC::DFG::Node::giveKnownFunction): Added.
43+
* ftl/FTLAbbreviatedTypes.h: Added a typedef for LLVMMemoryBufferRef
44+
* ftl/FTLAbbreviations.h: Added some abbreviations.
45+
* ftl/FTLLowerDFGToLLVM.cpp:
46+
(JSC::FTL::LowerDFGToLLVM::isInlinableSize): Added. Hardcoded threshold to 275.
47+
(JSC::FTL::LowerDFGToLLVM::getModuleByPathForSymbol): Added.
48+
(JSC::FTL::LowerDFGToLLVM::getFunctionBySymbol): Added.
49+
(JSC::FTL::LowerDFGToLLVM::possiblyCompileInlineableNativeCall): Added.
50+
(JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct):
51+
Added call to possiblyCompileInlineableNativeCall
52+
* ftl/FTLOutput.h:
53+
(JSC::FTL::Output::allocaName): Added. Useful for debugging.
54+
* ftl/FTLState.cpp:
55+
(JSC::FTL::State::State): Added an include for InlineRuntimeSymbolTable.h
56+
* ftl/FTLState.h: Added symbol table hash table.
57+
* ftl/FTLCompile.cpp:
58+
(JSC::FTL::compile): Added inlining and dead function elimination passes.
59+
* heap/HandleStack.h: Added JS_EXPORT_PRIVATE to a few functions to get inlining to compile.
60+
* llvm/InitializeLLVMMac.mm: Deleted.
61+
* llvm/InitializeLLVMMac.cpp: Added.
62+
* llvm/LLVMAPIFunctions.h: Added macros to include Bitcode parsing and linking functions.
63+
* llvm/LLVMHeaders.h: Added includes for Bitcode parsing and linking.
64+
* runtime/BundlePath.h: Added.
65+
* runtime/BundlePath.mm: Added.
66+
* runtime/DateInstance.h: Added JS_EXPORT_PRIVATE to a few functions to get inlining to compile.
67+
* runtime/DateInstance.h: ditto.
68+
* runtime/DateConversion.h: ditto.
69+
* runtime/ExceptionHelpers.h: ditto.
70+
* runtime/JSCJSValue.h: ditto.
71+
* runtime/JSArray.h: ditto.
72+
* runtime/JSDateMath.h: ditto.
73+
* runtime/JSObject.h: ditto.
74+
* runtime/JSObject.h: ditto.
75+
* runtime/RegExp.h: ditto.
76+
* runtime/Structure.h: ditto.
77+
* runtime/Options.h: Added maximumLLVMInstructionCountForNativeInlining.
78+
179
2014-07-22 Mark Lam <[email protected]>
280

381
Array.concat() should work on runtime arrays too.

0 commit comments

Comments
 (0)