Bug 113437 - fourthTier: JITCode should abstract exactly how the JIT code is structured and where it was allocated
Summary: fourthTier: JITCode should abstract exactly how the JIT code is structured an...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on:
Blocks: 112840
  Show dependency treegraph
 
Reported: 2013-03-27 13:24 PDT by Filip Pizlo
Modified: 2013-03-27 15:56 PDT (History)
9 users (show)

See Also:


Attachments
the patch (55.71 KB, patch)
2013-03-27 14:07 PDT, Filip Pizlo
webkit-ews: commit-queue-
Details | Formatted Diff | Diff
the patch (55.76 KB, patch)
2013-03-27 14:15 PDT, Filip Pizlo
mhahnenberg: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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