Ignore:
Timestamp:
Apr 26, 2012, 5:07:11 PM (13 years ago)
Author:
[email protected]
Message:

Remove RegisterFile::end()/m_end
https://bugs.webkit.org/show_bug.cgi?id=85011

Reviewed by Gavin Barraclough.

Source/JavaScriptCore:

Get rid of end() and m_end from RegisterFile. From now on
we only care about the end of the committed region when calling
code. When re-entering the VM we now plant the new CallFrame
immediately after whatever the current topCallFrame is. This
required adding a routine to CallFrame to determine exactly what
we should be doing (in the absence of an existing CallFrame, we
can't reason about the frameExtent() so we check for that).

This also now means that the GC only marks the portion of the
RegisterFile that is actually in use, and that VM re-entry doesn't
exhaust the RegisterFile as rapidly.

  • dfg/DFGOperations.cpp:
  • heap/Heap.cpp:

(JSC::Heap::getConservativeRegisterRoots):
(JSC::Heap::markRoots):

  • interpreter/CallFrame.h:

(JSC::ExecState::init):
(JSC::ExecState::startOfReusableRegisterFile):
(ExecState):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
(JSC::Interpreter::prepareForRepeatCall):
(JSC::Interpreter::privateExecute):

  • interpreter/Interpreter.h:

(JSC::Interpreter::execute):

  • interpreter/RegisterFile.cpp:

(JSC::RegisterFile::growSlowCase):
(JSC::RegisterFile::gatherConservativeRoots):

  • interpreter/RegisterFile.h:

(JSC::RegisterFile::commitEnd):
(JSC::RegisterFile::addressOfEnd):
(RegisterFile):
(JSC::RegisterFile::RegisterFile):
(JSC::RegisterFile::shrink):
(JSC::RegisterFile::grow):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):
(JSC::jitCompileFor):
(JSC::lazyLinkFor):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(JSC::LLInt::handleHostCall):

  • llint/LowLevelInterpreter.asm:
  • runtime/CommonSlowPaths.h:

(JSC::CommonSlowPaths::arityCheckFor):

LayoutTests:

Now that we recurse on the top of the used portion of the stack we
can provide an error message even when the stack is completely full.

Also made sure we were consistent in which callframe we used when
creating stack overflow errors.

  • fast/js/global-recursion-on-full-stack-expected.txt:
  • fast/js/stack-trace-expected.txt:
File:
1 edited

Legend:

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

    r114803 r115388  
    172172        {
    173173            ASSERT(callerFrame); // Use noCaller() rather than 0 for the outer host call frame caller.
    174             ASSERT(callerFrame == noCaller() || callerFrame->removeHostCallFrameFlag()->registerFile()->end() >= this);
     174            ASSERT(callerFrame == noCaller() || callerFrame->removeHostCallFrameFlag()->registerFile()->commitEnd() >= this);
    175175
    176176            setCodeBlock(codeBlock);
     
    255255        CallFrame* trueCallFrameFromVMCode() { return trueCallFrame(AbstractPC()); }
    256256
     257        Register* startOfReusableRegisterFile()
     258        {
     259            CallFrame* result = globalData().topCallFrame;
     260            if (result == noCaller() || result == registerFile()->begin())
     261                return registerFile()->begin();
     262            return result->frameExtent();
     263        }
     264       
    257265    private:
    258266        static const intptr_t HostCallFrameFlag = 1;
     
    260268        static const int s_firstArgumentOffset = s_thisArgumentOffset - 1;
    261269
    262 #ifndef NDEBUG
    263270        RegisterFile* registerFile();
    264 #endif
     271
    265272#if ENABLE(DFG_JIT)
    266273        bool isInlineCallFrameSlow();
Note: See TracChangeset for help on using the changeset viewer.