Ignore:
Timestamp:
Jan 15, 2012, 8:03:47 PM (13 years ago)
Author:
[email protected]
Message:

The C calling convention logic in DFG::SpeculativeJIT should be available even
when not generating code for the DFG speculative path
https://bugs.webkit.org/show_bug.cgi?id=76355

Reviewed by Dan Bernstein.

Moved all of the logic for placing C call arguments into the right place (stack
or registers) into a new class, DFG::CCallHelpers. This class inherits from
AssemblyHelpers, another DFG grab-bag of helper functions. I could have moved
this code into AssemblyHelpers, but decided against it, because I wanted to
limit the number of methods each class in the JIT has. Hence now we have a
slightly odd organization of JIT classes in DFG: MacroAssembler (basic instruction
emission) <= AssemblyHelpers (some additional JS smarts) <= CCallHelpers
(understands calls to C functions) <= JITCompiler (can compile a graph to machine
code). Each of these except for JITCompiler can be reused for stub compilation.

  • GNUmakefile.list.am:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • dfg/DFGCCallHelpers.h: Added.

(JSC::DFG::CCallHelpers::CCallHelpers):
(JSC::DFG::CCallHelpers::resetCallArguments):
(JSC::DFG::CCallHelpers::addCallArgument):
(JSC::DFG::CCallHelpers::setupArguments):
(JSC::DFG::CCallHelpers::setupArgumentsExecState):
(JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
(JSC::DFG::CCallHelpers::setupTwoStubArgs):
(JSC::DFG::CCallHelpers::setupStubArguments):

  • dfg/DFGJITCompiler.h:

(JSC::DFG::JITCompiler::JITCompiler):

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::callOperation):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.h

    r103294 r105035  
    3232#include <assembler/MacroAssembler.h>
    3333#include <bytecode/CodeBlock.h>
    34 #include <dfg/DFGAssemblyHelpers.h>
     34#include <dfg/DFGCCallHelpers.h>
    3535#include <dfg/DFGFPRInfo.h>
    3636#include <dfg/DFGGPRInfo.h>
     
    148148// compilation, and also records information used in linking (e.g. a list of all
    149149// call to be linked).
    150 class JITCompiler : public AssemblyHelpers {
     150class JITCompiler : public CCallHelpers {
    151151public:
    152152    JITCompiler(JSGlobalData* globalData, Graph& dfg, CodeBlock* codeBlock)
    153         : AssemblyHelpers(globalData, codeBlock)
     153        : CCallHelpers(globalData, codeBlock)
    154154        , m_graph(dfg)
    155155    {
Note: See TracChangeset for help on using the changeset viewer.