Bug 113437

Summary: fourthTier: JITCode should abstract exactly how the JIT code is structured and where it was allocated
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, ggaren, mark.lam, mhahnenberg, msaboff, oliver, sam, webkit-ews, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 112840    
Attachments:
Description Flags
the patch
webkit-ews: commit-queue-
the patch mhahnenberg: review+

Filip Pizlo
Reported Wednesday, March 27, 2013 9:24:51 PM UTC
This will make it easier to bring up the LLVM backend. At first, I'll probably just let LLVM use its own memory allocator. But even if we do switch to having LLVM use our allocator, we will probably want to give LLVM the ability to allocate the code for a function in multiple chunks, if it wanted to. But also, making JITCode be more abstract means that in the future we could even have a DFGJITCode, for example, which contains all of the DFGRareData things in CodeBlock. We could do likewise for the LLInt and Baseline JIT. This will save memory. Anyway, I think this is pure goodness.
Attachments
the patch (55.71 KB, patch)
2013-03-27 14:07 PDT, Filip Pizlo
webkit-ews: commit-queue-
the patch (55.76 KB, patch)
2013-03-27 14:15 PDT, Filip Pizlo
mhahnenberg: review+
Filip Pizlo
Comment 1 Wednesday, March 27, 2013 10:07:45 PM UTC
Created attachment 195391 [details] the patch
WebKit Review Bot
Comment 2 Wednesday, March 27, 2013 10:10:22 PM UTC
Attachment 195391 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source/JavaScriptCore/assembler/RepatchBuffer.h', u'Source/JavaScriptCore/bytecode/CodeBlock.cpp', u'Source/JavaScriptCore/bytecode/CodeBlock.h', u'Source/JavaScriptCore/dfg/DFGDriver.cpp', u'Source/JavaScriptCore/dfg/DFGDriver.h', u'Source/JavaScriptCore/dfg/DFGJITCompiler.cpp', u'Source/JavaScriptCore/dfg/DFGJITCompiler.h', u'Source/JavaScriptCore/dfg/DFGOSREntry.cpp', u'Source/JavaScriptCore/dfg/DFGOSRExit.cpp', u'Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp', u'Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp', u'Source/JavaScriptCore/dfg/DFGOperations.cpp', u'Source/JavaScriptCore/interpreter/Interpreter.cpp', u'Source/JavaScriptCore/jit/JIT.cpp', u'Source/JavaScriptCore/jit/JIT.h', u'Source/JavaScriptCore/jit/JITCode.cpp', u'Source/JavaScriptCore/jit/JITCode.h', u'Source/JavaScriptCore/jit/JITDriver.h', u'Source/JavaScriptCore/jit/JITStubs.cpp', u'Source/JavaScriptCore/jit/ThunkGenerators.cpp', u'Source/JavaScriptCore/llint/LLIntEntrypoints.cpp', u'Source/JavaScriptCore/llint/LLIntEntrypoints.h', u'Source/JavaScriptCore/llint/LLIntSlowPaths.cpp', u'Source/JavaScriptCore/runtime/Executable.cpp', u'Source/JavaScriptCore/runtime/Executable.h', u'Source/JavaScriptCore/runtime/ExecutionHarness.h']" exit_code: 1 Source/JavaScriptCore/jit/JITCode.h:50: enum members should use InterCaps with an initial capital letter. [readability/enum_casing] [4] Source/JavaScriptCore/jit/JITCode.h:79: The parameter name "jitType" adds no information, so it should be removed. [readability/parameter_name] [5] Source/JavaScriptCore/jit/JITCode.h:119: The parameter name "ref" adds no information, so it should be removed. [readability/parameter_name] [5] Source/JavaScriptCore/jit/JITCode.h:119: The parameter name "jitType" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 4 in 27 files If any of these errors are false positives, please file a bug against check-webkit-style.
Filip Pizlo
Comment 3 Wednesday, March 27, 2013 10:12:27 PM UTC
(In reply to comment #2) > Attachment 195391 [details] did not pass style-queue: > > Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source/JavaScriptCore/assembler/RepatchBuffer.h', u'Source/JavaScriptCore/bytecode/CodeBlock.cpp', u'Source/JavaScriptCore/bytecode/CodeBlock.h', u'Source/JavaScriptCore/dfg/DFGDriver.cpp', u'Source/JavaScriptCore/dfg/DFGDriver.h', u'Source/JavaScriptCore/dfg/DFGJITCompiler.cpp', u'Source/JavaScriptCore/dfg/DFGJITCompiler.h', u'Source/JavaScriptCore/dfg/DFGOSREntry.cpp', u'Source/JavaScriptCore/dfg/DFGOSRExit.cpp', u'Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp', u'Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp', u'Source/JavaScriptCore/dfg/DFGOperations.cpp', u'Source/JavaScriptCore/interpreter/Interpreter.cpp', u'Source/JavaScriptCore/jit/JIT.cpp', u'Source/JavaScriptCore/jit/JIT.h', u'Source/JavaScriptCore/jit/JITCode.cpp', u'Source/JavaScriptCore/jit/JITCode.h', u'Source/JavaScriptCore/jit/JITDriver.h', u'Source/JavaScriptCore/jit/JITStubs.cpp', u'Source/JavaScriptCore/jit/ThunkGenerators.cpp', u'Source/JavaScriptCore/llint/LLIntEntrypoints.cpp', u'Source/JavaScriptCore/llint/LLIntEntrypoints.h', u'Source/JavaScriptCore/llint/LLIntSlowPaths.cpp', u'Source/JavaScriptCore/runtime/Executable.cpp', u'Source/JavaScriptCore/runtime/Executable.h', u'Source/JavaScriptCore/runtime/ExecutionHarness.h']" exit_code: 1 > Source/JavaScriptCore/jit/JITCode.h:50: enum members should use InterCaps with an initial capital letter. [readability/enum_casing] [4] Nope. > Source/JavaScriptCore/jit/JITCode.h:79: The parameter name "jitType" adds no information, so it should be removed. [readability/parameter_name] [5] > Source/JavaScriptCore/jit/JITCode.h:119: The parameter name "ref" adds no information, so it should be removed. [readability/parameter_name] [5] > Source/JavaScriptCore/jit/JITCode.h:119: The parameter name "jitType" adds no information, so it should be removed. [readability/parameter_name] [5] I fixed them. > Total errors found: 4 in 27 files > > > If any of these errors are false positives, please file a bug against check-webkit-style.
Early Warning System Bot
Comment 4 Wednesday, March 27, 2013 10:14:13 PM UTC
Filip Pizlo
Comment 5 Wednesday, March 27, 2013 10:15:48 PM UTC
Created attachment 195393 [details] the patch Fixing unresolved symbols.
WebKit Review Bot
Comment 6 Wednesday, March 27, 2013 10:18:37 PM UTC
Attachment 195393 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source/JavaScriptCore/assembler/RepatchBuffer.h', u'Source/JavaScriptCore/bytecode/CodeBlock.cpp', u'Source/JavaScriptCore/bytecode/CodeBlock.h', u'Source/JavaScriptCore/dfg/DFGDriver.cpp', u'Source/JavaScriptCore/dfg/DFGDriver.h', u'Source/JavaScriptCore/dfg/DFGJITCompiler.cpp', u'Source/JavaScriptCore/dfg/DFGJITCompiler.h', u'Source/JavaScriptCore/dfg/DFGOSREntry.cpp', u'Source/JavaScriptCore/dfg/DFGOSRExit.cpp', u'Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp', u'Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp', u'Source/JavaScriptCore/dfg/DFGOperations.cpp', u'Source/JavaScriptCore/interpreter/Interpreter.cpp', u'Source/JavaScriptCore/jit/JIT.cpp', u'Source/JavaScriptCore/jit/JIT.h', u'Source/JavaScriptCore/jit/JITCode.cpp', u'Source/JavaScriptCore/jit/JITCode.h', u'Source/JavaScriptCore/jit/JITDriver.h', u'Source/JavaScriptCore/jit/JITStubs.cpp', u'Source/JavaScriptCore/jit/ThunkGenerators.cpp', u'Source/JavaScriptCore/llint/LLIntEntrypoints.cpp', u'Source/JavaScriptCore/llint/LLIntEntrypoints.h', u'Source/JavaScriptCore/llint/LLIntSlowPaths.cpp', u'Source/JavaScriptCore/runtime/Executable.cpp', u'Source/JavaScriptCore/runtime/Executable.h', u'Source/JavaScriptCore/runtime/ExecutionHarness.h']" exit_code: 1 Source/JavaScriptCore/jit/JITCode.h:50: enum members should use InterCaps with an initial capital letter. [readability/enum_casing] [4] Total errors found: 1 in 27 files If any of these errors are false positives, please file a bug against check-webkit-style.
Mark Hahnenberg
Comment 7 Wednesday, March 27, 2013 10:22:35 PM UTC
Comment on attachment 195393 [details] the patch r=me
Geoffrey Garen
Comment 8 Wednesday, March 27, 2013 11:40:14 PM UTC
> But also, making JITCode be more abstract means that in the future we could even have a DFGJITCode, for example, which contains all of the DFGRareData things in CodeBlock. We could do likewise for the LLInt and Baseline JIT. This will save memory. For a given piece of data, how would you describe the guideline for whether it belongs in JITCode or CodeBlock?
Filip Pizlo
Comment 9 Wednesday, March 27, 2013 11:49:44 PM UTC
(In reply to comment #8) > > But also, making JITCode be more abstract means that in the future we could even have a DFGJITCode, for example, which contains all of the DFGRareData things in CodeBlock. We could do likewise for the LLInt and Baseline JIT. This will save memory. > > For a given piece of data, how would you describe the guideline for whether it belongs in JITCode or CodeBlock? Specific to a particular execution engine? -> put it in JITCode not CodeBlock.
Filip Pizlo
Comment 10 Wednesday, March 27, 2013 11:56:55 PM UTC
Note You need to log in before you can comment on or make changes to this bug.