Ignore:
Timestamp:
Jun 21, 2010, 10:43:03 AM (15 years ago)
Author:
[email protected]
Message:

2010-06-19 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

Need to ensure that we grow the RegisterFile when creating a callframe for host code
https://bugs.webkit.org/show_bug.cgi?id=40858
<rdar://problem/8108986>

In the past the use of the callframe in hostcode was much more
limited. Now that we expect the callframe to always be valid
we need to grow the RegisterFile so that this is actually the
case. In this particular case the problem was failing to grow
the registerfile could lead to a callframe that extended beyond
RegisterFiler::end(), so vm re-entry would clobber the callframe
other scenarios could also lead to badness.

I was unable to construct a simple testcase to trigger badness,
and any such testcase would be so dependent on exact vm stack
layout that it would be unlikely to work as a testcase following
any callframe or register allocation changes anyway.

Thankfully the new assertion I added should help to catch these
failures in future, and triggers on a couple of tests currently.

  • interpreter/CallFrame.cpp: (JSC::CallFrame::registerFile):
  • interpreter/CallFrame.h: (JSC::ExecState::init):
  • interpreter/Interpreter.cpp: (JSC::Interpreter::privateExecute):
  • jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION):
File:
1 edited

Legend:

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

    r60762 r61553  
    118118        {
    119119            ASSERT(callerFrame); // Use noCaller() rather than 0 for the outer host call frame caller.
     120            ASSERT(callerFrame == noCaller() || callerFrame->removeHostCallFrameFlag()->registerFile()->end() >= this);
    120121
    121122            setCodeBlock(codeBlock);
     
    156157    private:
    157158        static const intptr_t HostCallFrameFlag = 1;
    158 
     159#ifndef NDEBUG
     160        RegisterFile* registerFile();
     161#endif
    159162        ExecState();
    160163        ~ExecState();
Note: See TracChangeset for help on using the changeset viewer.