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


Ignore:
Timestamp:
Oct 8, 2008, 10:50:42 AM (17 years ago)
Author:
[email protected]
Message:

Roll out r37427 because it causes an infinite recursion loading about:blank.

https://bugs.webkit.org/show_bug.cgi?id=21476

File:
1 edited

Legend:

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

    r37427 r37428  
    4545    class CodeBlock;
    4646    class EvalNode;
     47    class ExecState;
    4748    class FunctionBodyNode;
    4849    class Instruction;
     
    9596        bool isOpcode(Opcode opcode);
    9697       
    97         JSValue* execute(ProgramNode*, CallFrame*, ScopeChainNode*, JSObject* thisObj, JSValue** exception);
    98         JSValue* execute(FunctionBodyNode*, CallFrame*, JSFunction*, JSObject* thisObj, const ArgList& args, ScopeChainNode*, JSValue** exception);
    99         JSValue* execute(EvalNode* evalNode, CallFrame* exec, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue** exception);
    100 
    101         JSValue* retrieveArguments(CallFrame*, JSFunction*) const;
    102         JSValue* retrieveCaller(CallFrame*, InternalFunction*) const;
    103         void retrieveLastCaller(CallFrame*, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const;
    104        
    105         void getArgumentsData(CallFrame*, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc);
     98        JSValue* execute(ProgramNode*, ExecState*, ScopeChainNode*, JSObject* thisObj, JSValue** exception);
     99        JSValue* execute(FunctionBodyNode*, ExecState*, JSFunction*, JSObject* thisObj, const ArgList& args, ScopeChainNode*, JSValue** exception);
     100        JSValue* execute(EvalNode* evalNode, ExecState* exec, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue** exception);
     101
     102        JSValue* retrieveArguments(ExecState*, JSFunction*) const;
     103        JSValue* retrieveCaller(ExecState*, InternalFunction*) const;
     104        void retrieveLastCaller(ExecState* exec, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const;
     105       
     106        static ScopeChainNode* scopeChain(const Register* r) { return r[RegisterFile::ScopeChain].scopeChain(); }
     107        static CodeBlock* codeBlock(const Register* r) { return r[RegisterFile::CodeBlock].codeBlock(); }
     108
     109        void getArgumentsData(Register* callFrame, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc);
    106110        void setTimeoutTime(unsigned timeoutTime) { m_timeoutTime = timeoutTime; }
    107111       
     
    236240        bool isJSArray(JSValue* v) { return !JSImmediate::isImmediate(v) && v->asCell()->vptr() == m_jsArrayVptr; }
    237241        bool isJSString(JSValue* v) { return !JSImmediate::isImmediate(v) && v->asCell()->vptr() == m_jsStringVptr; }
     242       
     243        ALWAYS_INLINE static void initializeCallFrame(Register* callFrame, CodeBlock*, Instruction*, ScopeChainNode*, Register* r, int returnValueRegister, int argc, JSValue* function);
    238244
    239245    private:
    240246        enum ExecutionFlag { Normal, InitializeAndReturn };
    241247
    242         NEVER_INLINE JSValue* callEval(CallFrame*, JSObject* thisObject, ScopeChainNode*, RegisterFile*, int argv, int argc, JSValue*& exceptionValue);
    243         JSValue* execute(EvalNode*, CallFrame*, JSObject* thisObject, int registerOffset, ScopeChainNode*, JSValue** exception);
    244 
    245         NEVER_INLINE void debug(CallFrame*, DebugHookID, int firstLine, int lastLine);
    246 
    247         NEVER_INLINE bool resolve(CallFrame*, Instruction*, JSValue*& exceptionValue);
    248         NEVER_INLINE bool resolveSkip(CallFrame*, Instruction*, JSValue*& exceptionValue);
    249         NEVER_INLINE bool resolveGlobal(CallFrame*, Instruction*, JSValue*& exceptionValue);
    250         NEVER_INLINE void resolveBase(CallFrame*, Instruction* vPC);
    251         NEVER_INLINE bool resolveBaseAndProperty(CallFrame*, Instruction*, JSValue*& exceptionValue);
    252         NEVER_INLINE ScopeChainNode* createExceptionScope(CallFrame*, const Instruction* vPC);
    253 
    254         NEVER_INLINE bool unwindCallFrame(CallFrame*&, JSValue*, const Instruction*&, CodeBlock*&);
    255         NEVER_INLINE Instruction* throwException(CallFrame*&, JSValue*&, const Instruction*, bool);
    256         NEVER_INLINE bool resolveBaseAndFunc(CallFrame*, Instruction*, JSValue*& exceptionValue);
    257 
    258         static ALWAYS_INLINE CallFrame* slideRegisterWindowForCall(CodeBlock*, RegisterFile*, CallFrame*, size_t registerOffset, int argc);
    259 
    260         static CallFrame* findFunctionCallFrame(CallFrame*, InternalFunction*);
    261 
    262         JSValue* privateExecute(ExecutionFlag, RegisterFile*, CallFrame*, JSValue** exception);
    263 
    264         void dumpCallFrame(const RegisterFile*, CallFrame*);
    265         void dumpRegisters(const RegisterFile*, CallFrame*);
     248        NEVER_INLINE JSValue* callEval(ExecState* exec, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile*, Register* r, int argv, int argc, JSValue*& exceptionValue);
     249        JSValue* execute(EvalNode*, ExecState*, JSObject* thisObj, int registerOffset, ScopeChainNode*, JSValue** exception);
     250
     251        NEVER_INLINE void debug(ExecState*, Register*, DebugHookID, int firstLine, int lastLine);
     252
     253        NEVER_INLINE bool resolve(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue);
     254        NEVER_INLINE bool resolveSkip(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue);
     255        NEVER_INLINE bool resolveGlobal(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue);
     256        NEVER_INLINE void resolveBase(ExecState* exec, Instruction* vPC, Register* r);
     257        NEVER_INLINE bool resolveBaseAndProperty(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue);
     258        NEVER_INLINE ScopeChainNode* createExceptionScope(ExecState* exec, const Instruction* vPC, Register* r);
     259
     260        NEVER_INLINE bool unwindCallFrame(ExecState*&, JSValue*, const Instruction*&, CodeBlock*&, Register*&);
     261        NEVER_INLINE Instruction* throwException(ExecState*, JSValue*&, const Instruction*, Register*&, bool);
     262        NEVER_INLINE bool resolveBaseAndFunc(ExecState* exec, Instruction* vPC, Register* r, JSValue*& exceptionValue);
     263
     264        Register* callFrame(ExecState*, InternalFunction*) const;
     265
     266        JSValue* privateExecute(ExecutionFlag, RegisterFile*, Register*, JSValue** exception);
     267
     268        void dumpCallFrame(const RegisterFile*, const Register*);
     269        void dumpRegisters(const RegisterFile*, const Register*);
    266270
    267271        JSValue* checkTimeout(JSGlobalObject*);
    268272        void resetTimeoutCheck();
    269273
    270         void tryCacheGetByID(CallFrame*, CodeBlock*, Instruction*, JSValue* baseValue, const Identifier& propertyName, const PropertySlot&);
     274        void tryCacheGetByID(ExecState*, CodeBlock*, Instruction* vPC, JSValue* baseValue, const Identifier& propertyName, const PropertySlot&);
    271275        void uncacheGetByID(CodeBlock*, Instruction* vPC);
    272         void tryCachePutByID(CallFrame*, CodeBlock*, Instruction*, JSValue* baseValue, const PutPropertySlot&);
     276        void tryCachePutByID(ExecState* exec, CodeBlock*, Instruction* vPC, JSValue* baseValue, const PutPropertySlot&);
    273277        void uncachePutByID(CodeBlock*, Instruction* vPC);
    274278
    275279#if ENABLE(CTI)
    276         void tryCTICacheGetByID(CallFrame*, CodeBlock*, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot&);
    277         void tryCTICachePutByID(CallFrame*, CodeBlock*, void* returnAddress, JSValue* baseValue, const PutPropertySlot&);
    278 
    279         void* getCTIArrayLengthTrampoline(CallFrame*, CodeBlock*);
    280         void* getCTIStringLengthTrampoline(CallFrame*, CodeBlock*);
     280        void tryCTICacheGetByID(ExecState*, CodeBlock*, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot&);
     281        void tryCTICachePutByID(ExecState*, CodeBlock*, void* returnAddress, JSValue* baseValue, const PutPropertySlot&);
     282
     283        void* getCTIArrayLengthTrampoline(ExecState*, CodeBlock*);
     284        void* getCTIStringLengthTrampoline(ExecState*, CodeBlock*);
    281285
    282286        void* m_ctiArrayLengthTrampoline;
     
    306310    };
    307311
     312    ALWAYS_INLINE void Machine::initializeCallFrame(Register* callFrame, CodeBlock* codeBlock, Instruction* vPC, ScopeChainNode* scopeChain, Register* r, int returnValueRegister, int argc, JSValue* function)
     313    {
     314        ASSERT(r); // use makeHostCallFramePointer(0) to create a host call frame sentinel.
     315        callFrame[RegisterFile::CodeBlock] = codeBlock;
     316        callFrame[RegisterFile::ScopeChain] = scopeChain;
     317        callFrame[RegisterFile::CallerRegisters] = r;
     318        callFrame[RegisterFile::ReturnPC] = vPC;
     319        callFrame[RegisterFile::ReturnValueRegister] = returnValueRegister;
     320        callFrame[RegisterFile::ArgumentCount] = argc; // original argument count (for the sake of the "arguments" object)
     321        callFrame[RegisterFile::Callee] = function;
     322        callFrame[RegisterFile::OptionalCalleeArguments] = nullJSValue;
     323    }
     324
     325    const intptr_t HostCallFrameMask = 1;
     326
     327    inline Register* makeHostCallFramePointer(Register* callFrame)
     328    {
     329        return reinterpret_cast<Register*>(reinterpret_cast<intptr_t>(callFrame) | HostCallFrameMask);
     330    }
     331
     332    inline bool isHostCallFrame(Register* callFrame)
     333    {
     334        return reinterpret_cast<intptr_t>(callFrame) & HostCallFrameMask;
     335    }
     336
     337    inline Register* stripHostCallFrameBit(Register* callFrame)
     338    {
     339        return reinterpret_cast<Register*>(reinterpret_cast<intptr_t>(callFrame) & ~HostCallFrameMask);
     340    }
     341
    308342} // namespace JSC
    309343
Note: See TracChangeset for help on using the changeset viewer.