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+

Description Filip Pizlo 2013-03-27 13:24:51 PDT
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.
Comment 1 Filip Pizlo 2013-03-27 14:07:45 PDT
Created attachment 195391 [details]
the patch
Comment 2 WebKit Review Bot 2013-03-27 14:10:22 PDT
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.
Comment 3 Filip Pizlo 2013-03-27 14:12:27 PDT
(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.
Comment 4 Early Warning System Bot 2013-03-27 14:14:13 PDT
Comment on attachment 195391 [details]
the patch

Attachment 195391 [details] did not pass qt-wk2-ews (qt):
Output: http://webkit-commit-queue.appspot.com/results/17304362
Comment 5 Filip Pizlo 2013-03-27 14:15:48 PDT
Created attachment 195393 [details]
the patch

Fixing unresolved symbols.
Comment 6 WebKit Review Bot 2013-03-27 14:18:37 PDT
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.
Comment 7 Mark Hahnenberg 2013-03-27 14:22:35 PDT
Comment on attachment 195393 [details]
the patch

r=me
Comment 8 Geoffrey Garen 2013-03-27 15:40:14 PDT
> 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?
Comment 9 Filip Pizlo 2013-03-27 15:49:44 PDT
(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.
Comment 10 Filip Pizlo 2013-03-27 15:56:55 PDT
Landed in http://trac.webkit.org/changeset/147014