Ignore:
Timestamp:
Jun 1, 2009, 10:36:18 PM (16 years ago)
Author:
[email protected]
Message:

2009-06-01 Gavin Barraclough <[email protected]>

Reviewed by Olliej Hunt.

Change JITStub functions from being static members on the JITStub class to be
global extern "C" functions, and switch their the function signature declaration
in the definition of the functions to be C-macro generated. This makes it easier
to work with the stub functions from assembler code (since the names no longer
require mangling), and by delaring the functions with a macro we can look at
also auto-generating asm thunks to wrap the JITStub functions to perform the
work currently in 'restoreArgumentReference' (as a memory saving).

Making this change also forces us to be a bit more realistic about what is private
on the Register and CallFrame objects. Presently most everything on these classes
is private, and the classes have plenty of friends. We could befriend all the
global functions to perpetuate the delusion of encapsulation, but using friends is
a bit of a sledgehammer solution here - since friends can poke around with all of
the class's privates, and since all the major classes taht operate on Regsiters are
currently friends, right there is currently in practice very little protection at
all. Better to start removing friend delclarations, and exposing just the parts
that need to be exposed.

  • interpreter/CallFrame.h: (JSC::ExecState::returnPC): (JSC::ExecState::setCallerFrame): (JSC::ExecState::returnValueRegister): (JSC::ExecState::setArgumentCount): (JSC::ExecState::setCallee): (JSC::ExecState::setCodeBlock):
  • interpreter/Interpreter.h:
  • interpreter/Register.h: (JSC::Register::Register): (JSC::Register::i):
  • jit/JITStubs.cpp: (JSC::): (JSC::JITThunks::JITThunks): (JSC::JITThunks::tryCachePutByID): (JSC::JITThunks::tryCacheGetByID): (JSC::JITStubs::DEFINE_STUB_FUNCTION):
  • jit/JITStubs.h: (JSC::JITStubs::):
  • runtime/JSFunction.h: (JSC::JSFunction::nativeFunction): (JSC::JSFunction::classInfo):
  • runtime/JSGlobalData.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/interpreter/CallFrame.h

    r44224 r44344  
    9696        static const HashTable* stringTable(CallFrame* callFrame) { return callFrame->globalData().stringTable; }
    9797
    98     private:
    99         friend class Arguments;
    100         friend class JSActivation;
    101         friend class JSGlobalObject;
    102         friend class Interpreter;
    103         friend class JITStubs;
    104         friend struct CallFrameClosure;
    105 
    10698        static CallFrame* create(Register* callFrameBase) { return static_cast<CallFrame*>(callFrameBase); }
    10799        Register* registers() { return this; }
     
    112104        Arguments* optionalCalleeArguments() const { return this[RegisterFile::OptionalCalleeArguments].arguments(); }
    113105        Instruction* returnPC() const { return this[RegisterFile::ReturnPC].vPC(); }
    114         int returnValueRegister() const { return this[RegisterFile::ReturnValueRegister].i(); }
    115106
    116         void setArgumentCount(int count) { this[RegisterFile::ArgumentCount] = count; }
    117         void setCallee(JSFunction* callee) { this[RegisterFile::Callee] = callee; }
    118107        void setCalleeArguments(Arguments* arguments) { this[RegisterFile::OptionalCalleeArguments] = arguments; }
    119108        void setCallerFrame(CallFrame* callerFrame) { this[RegisterFile::CallerFrame] = callerFrame; }
    120         void setCodeBlock(CodeBlock* codeBlock) { this[RegisterFile::CodeBlock] = codeBlock; }
    121109        void setScopeChain(ScopeChainNode* scopeChain) { this[RegisterFile::ScopeChain] = scopeChain; }
    122110
     
    136124        }
    137125
     126    private:
     127        friend class Arguments;
     128        friend class JSActivation;
     129        friend class JSGlobalObject;
     130        friend class Interpreter;
     131        friend struct CallFrameClosure;
     132
     133        int returnValueRegister() const { return this[RegisterFile::ReturnValueRegister].i(); }
     134
     135        void setArgumentCount(int count) { this[RegisterFile::ArgumentCount] = count; }
     136        void setCallee(JSFunction* callee) { this[RegisterFile::Callee] = callee; }
     137        void setCodeBlock(CodeBlock* codeBlock) { this[RegisterFile::CodeBlock] = codeBlock; }
     138
    138139        static const intptr_t HostCallFrameFlag = 1;
    139140
Note: See TracChangeset for help on using the changeset viewer.