Changeset 34372 in webkit for trunk/JavaScriptCore/VM/Machine.h


Ignore:
Timestamp:
Jun 4, 2008, 10:36:55 PM (17 years ago)
Author:
[email protected]
Message:

2008-06-04 Sam Weinig <[email protected]>

Reviewed by Maciej Stachowiak.

Big cleanup of formatting and whitespace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/Machine.h

    r34351 r34372  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28  
     28
    2929#ifndef Machine_h
    3030#define Machine_h
     
    3232#include "Opcode.h"
    3333#include "RegisterFileStack.h"
     34#include <kjs/list.h>
    3435#include <wtf/HashMap.h>
    35 #include <kjs/list.h>
    3636
    3737namespace KJS {
     
    4646    class RegisterFileStack;
    4747    class ScopeChainNode;
    48    
     48
    4949    enum DebugHookID {
    5050        WillExecuteProgram,
     
    6060    class Machine {
    6161    public:
    62         enum { CallerCodeBlock = 0,
    63                ReturnVPC,
    64                CallerScopeChain,
    65                CallerRegisterOffset,
    66                ReturnValueRegister,
    67                ArgumentStartRegister,
    68                ArgumentCount,
    69                CalledAsConstructor,
    70                Callee,
    71                OptionalCalleeActivation,
    72                CallFrameHeaderSize};
    73        
     62        enum {
     63            CallerCodeBlock = 0,
     64            ReturnVPC,
     65            CallerScopeChain,
     66            CallerRegisterOffset,
     67            ReturnValueRegister,
     68            ArgumentStartRegister,
     69            ArgumentCount,
     70            CalledAsConstructor,
     71            Callee,
     72            OptionalCalleeActivation,
     73            CallFrameHeaderSize
     74        };
     75
    7476        enum { ProgramCodeThisRegister = -1 };
    7577
    7678        Machine();
    77        
    78         Opcode getOpcode(OpcodeID id) {
     79
     80        Opcode getOpcode(OpcodeID id)
     81        {
    7982            #if HAVE(COMPUTED_GOTO)
    80                 return m_opcodeTable[id]; 
     83                return m_opcodeTable[id];
    8184            #else
    8285                return id;
     
    8487        }
    8588
    86         OpcodeID getOpcodeID(Opcode opcode) {
     89        OpcodeID getOpcodeID(Opcode opcode)
     90        {
    8791            #if HAVE(COMPUTED_GOTO)
    8892                ASSERT(isOpcode(opcode));
     
    9498
    9599        bool isOpcode(Opcode opcode);
    96        
     100
    97101        JSValue* execute(ProgramNode*, ExecState*, ScopeChainNode*, JSObject* thisObj, RegisterFileStack*, JSValue** exception);
    98102        JSValue* execute(FunctionBodyNode*, ExecState*, FunctionImp*, JSObject* thisObj, const List& args, RegisterFileStack*, ScopeChainNode*, JSValue** exception);
    99103        JSValue* execute(EvalNode*, ExecState*, JSObject* thisObj, RegisterFile*, int registerOffset, ScopeChainNode*, JSValue** exception);
    100104        JSValue* execute(EvalNode*, ExecState*, JSObject* thisObj, RegisterFileStack*, ScopeChainNode*, JSValue** exception);
    101        
     105
    102106        JSValue* retrieveArguments(ExecState*, FunctionImp*) const;
    103107        JSValue* retrieveCaller(ExecState*, FunctionImp*) const;
    104        
     108
    105109        void getFunctionAndArguments(Register** registerBase, Register* callFrame, FunctionImp*&, Register*& argv, int& argc);
    106        
     110
    107111    private:
    108         typedef enum { Normal, InitializeAndReturn } ExecutionFlag;
     112        enum ExecutionFlag { Normal, InitializeAndReturn };
    109113
    110114        ALWAYS_INLINE void setScopeChain(ExecState* exec, ScopeChainNode*&, ScopeChainNode*);
     
    113117        NEVER_INLINE bool unwindCallFrame(ExecState*, JSValue*, Register**, const Instruction*&, CodeBlock*&, JSValue**&, ScopeChainNode*&, Register*&);
    114118        NEVER_INLINE Instruction* throwException(ExecState*, JSValue*, Register**, const Instruction*, CodeBlock*&, JSValue**&, ScopeChainNode*&, Register*&);
    115        
     119
    116120        bool getCallFrame(ExecState*, FunctionImp*, Register**& registerBase, int& callFrameOffset) const;
    117121
     
    120124        void dumpCallFrame(const CodeBlock*, ScopeChainNode*, RegisterFile*, const Register*);
    121125        void dumpRegisters(const CodeBlock*, RegisterFile*, const Register*);
    122        
     126
    123127        bool isGlobalCallFrame(Register** registerBase, const Register* r) const { return (*registerBase) == r; }
    124128
    125129        int m_reentryDepth;
    126 #if HAVE(COMPUTED_GOTO)       
     130#if HAVE(COMPUTED_GOTO)
    127131        Opcode m_opcodeTable[numOpcodeIDs]; // Maps OpcodeID => Opcode for compiling
    128132        HashMap<Opcode, OpcodeID> m_opcodeIDTable; // Maps Opcode => OpcodeID for decompiling
    129133#endif
    130134    };
    131    
     135
    132136    Machine& machine();
    133137
Note: See TracChangeset for help on using the changeset viewer.