Changeset 115861 in webkit for trunk/Source/JavaScriptCore/interpreter
- Timestamp:
- May 2, 2012, 12:18:28 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore/interpreter
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp
r115388 r115861 43 43 dataLog("Callpoint => %s:%d\n", urlString.utf8().data(), signedLineNumber); 44 44 } 45 #endif46 45 47 46 RegisterFile* CallFrame::registerFile() … … 49 48 return &interpreter()->registerFile(); 50 49 } 50 51 #endif 51 52 52 53 #if USE(JSVALUE32_64) -
trunk/Source/JavaScriptCore/interpreter/CallFrame.h
r115388 r115861 172 172 { 173 173 ASSERT(callerFrame); // Use noCaller() rather than 0 for the outer host call frame caller. 174 ASSERT(callerFrame == noCaller() || callerFrame->removeHostCallFrameFlag()->registerFile()-> commitEnd() >= this);174 ASSERT(callerFrame == noCaller() || callerFrame->removeHostCallFrameFlag()->registerFile()->end() >= this); 175 175 176 176 setCodeBlock(codeBlock); … … 255 255 CallFrame* trueCallFrameFromVMCode() { return trueCallFrame(AbstractPC()); } 256 256 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 265 257 private: 266 258 static const intptr_t HostCallFrameFlag = 1; … … 268 260 static const int s_firstArgumentOffset = s_thisArgumentOffset - 1; 269 261 262 #ifndef NDEBUG 270 263 RegisterFile* registerFile(); 271 264 #endif 272 265 #if ENABLE(DFG_JIT) 273 266 bool isInlineCallFrameSlow(); -
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r115657 r115861 1209 1209 CodeBlock* codeBlock = &program->generatedBytecode(); 1210 1210 1211 Register* oldEnd = callFrame->startOfReusableRegisterFile();1211 Register* oldEnd = m_registerFile.end(); 1212 1212 Register* newEnd = oldEnd + codeBlock->numParameters() + RegisterFile::CallFrameHeaderSize + codeBlock->m_numCalleeRegisters; 1213 1213 if (!m_registerFile.grow(newEnd)) … … 1258 1258 return checkedReturn(throwStackOverflowError(callFrame)); 1259 1259 1260 Register* oldEnd = callFrame->startOfReusableRegisterFile();1260 Register* oldEnd = m_registerFile.end(); 1261 1261 ASSERT(callFrame->frameExtent() <= oldEnd || callFrame == callFrame->scopeChain()->globalObject->globalExec()); 1262 1262 int argCount = 1 + args.size(); // implicit "this" parameter … … 1355 1355 return checkedReturn(throwStackOverflowError(callFrame)); 1356 1356 1357 Register* oldEnd = callFrame->startOfReusableRegisterFile();1357 Register* oldEnd = m_registerFile.end(); 1358 1358 int argCount = 1 + args.size(); // implicit "this" parameter 1359 1359 size_t registerOffset = argCount + RegisterFile::CallFrameHeaderSize; … … 1457 1457 } 1458 1458 1459 Register* oldEnd = callFrame->startOfReusableRegisterFile();1459 Register* oldEnd = m_registerFile.end(); 1460 1460 size_t registerOffset = argumentCountIncludingThis + RegisterFile::CallFrameHeaderSize; 1461 1461 … … 1583 1583 } 1584 1584 1585 Register* oldEnd = m_registerFile.end(); 1585 1586 Register* newEnd = m_registerFile.begin() + globalRegisterOffset + codeBlock->m_numCalleeRegisters; 1586 1587 if (!m_registerFile.grow(newEnd)) { … … 1626 1627 (*profiler)->didExecute(callFrame, eval->sourceURL(), eval->lineNo()); 1627 1628 1629 m_registerFile.shrink(oldEnd); 1628 1630 if (pushedScope) 1629 1631 scopeChain->pop(); … … 4517 4519 if (UNLIKELY(!callFrame)) { 4518 4520 callFrame = previousCallFrame; 4519 *topCallFrameSlot = callFrame;4520 4521 exceptionValue = createStackOverflowError(callFrame); 4521 4522 goto vm_throw; … … 4596 4597 newCallFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, newCallFrame, 0, argCount); 4597 4598 if (UNLIKELY(!newCallFrame)) { 4598 *topCallFrameSlot = callFrame;4599 4599 exceptionValue = createStackOverflowError(callFrame); 4600 4600 goto vm_throw; … … 4918 4918 if (UNLIKELY(!callFrame)) { 4919 4919 callFrame = previousCallFrame; 4920 *topCallFrameSlot = callFrame;4921 4920 exceptionValue = createStackOverflowError(callFrame); 4922 4921 goto vm_throw; -
trunk/Source/JavaScriptCore/interpreter/Interpreter.h
r115388 r115861 295 295 inline JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSValue thisValue, ScopeChainNode* scopeChain) 296 296 { 297 return execute(eval, callFrame, thisValue, scopeChain, (callFrame->startOfReusableRegisterFile() - m_registerFile.begin()) + 1 + RegisterFile::CallFrameHeaderSize);297 return execute(eval, callFrame, thisValue, scopeChain, m_registerFile.size() + 1 + RegisterFile::CallFrameHeaderSize); 298 298 } 299 299 -
trunk/Source/JavaScriptCore/interpreter/RegisterFile.cpp
r115388 r115861 53 53 bool RegisterFile::growSlowCase(Register* newEnd) 54 54 { 55 ASSERT(newEnd > m_commitEnd); 55 if (newEnd <= m_commitEnd) { 56 m_end = newEnd; 57 return true; 58 } 56 59 57 60 long delta = roundUpAllocationSize(reinterpret_cast<char*>(newEnd) - reinterpret_cast<char*>(m_commitEnd), commitSize); … … 62 65 addToCommittedByteCount(delta); 63 66 m_commitEnd = reinterpret_cast_ptr<Register*>(reinterpret_cast<char*>(m_commitEnd) + delta); 67 m_end = newEnd; 64 68 return true; 65 69 } 66 70 67 void RegisterFile::gatherConservativeRoots( JSGlobalData& globalData,ConservativeRoots& conservativeRoots)71 void RegisterFile::gatherConservativeRoots(ConservativeRoots& conservativeRoots) 68 72 { 69 if (globalData.topCallFrame == CallFrame::noCaller()) 70 return; 71 conservativeRoots.add(begin(), globalData.topCallFrame->frameExtent()); 73 conservativeRoots.add(begin(), end()); 72 74 } 73 75 74 void RegisterFile::gatherConservativeRoots( JSGlobalData& globalData,ConservativeRoots& conservativeRoots, DFGCodeBlocks& dfgCodeBlocks)76 void RegisterFile::gatherConservativeRoots(ConservativeRoots& conservativeRoots, DFGCodeBlocks& dfgCodeBlocks) 75 77 { 76 if (globalData.topCallFrame == CallFrame::noCaller()) 77 return; 78 conservativeRoots.add(begin(), globalData.topCallFrame->frameExtent(), dfgCodeBlocks); 78 conservativeRoots.add(begin(), end(), dfgCodeBlocks); 79 79 } 80 80 -
trunk/Source/JavaScriptCore/interpreter/RegisterFile.h
r115388 r115861 64 64 ~RegisterFile(); 65 65 66 void gatherConservativeRoots( JSGlobalData&,ConservativeRoots&);67 void gatherConservativeRoots( JSGlobalData&,ConservativeRoots&, DFGCodeBlocks&);66 void gatherConservativeRoots(ConservativeRoots&); 67 void gatherConservativeRoots(ConservativeRoots&, DFGCodeBlocks&); 68 68 69 69 Register* begin() const { return static_cast<Register*>(m_reservation.base()); } 70 Register* commitEnd() const { return m_commitEnd; } 70 Register* end() const { return m_end; } 71 size_t size() const { return end() - begin(); } 71 72 72 73 bool grow(Register*); … … 78 79 Register* const * addressOfEnd() const 79 80 { 80 return &m_ commitEnd;81 return &m_end; 81 82 } 82 83 … … 87 88 void releaseExcessCapacity(); 88 89 void addToCommittedByteCount(long); 90 Register* m_end; 89 91 Register* m_commitEnd; 90 92 PageReservation m_reservation; … … 92 94 93 95 inline RegisterFile::RegisterFile(size_t capacity) 96 : m_end(0) 94 97 { 95 98 ASSERT(capacity && isPageAligned(capacity)); 96 99 97 100 m_reservation = PageReservation::reserve(roundUpAllocationSize(capacity * sizeof(Register), commitSize), OSAllocator::JSVMStackPages); 101 m_end = static_cast<Register*>(m_reservation.base()); 98 102 m_commitEnd = static_cast<Register*>(m_reservation.base()); 99 103 } … … 101 105 inline void RegisterFile::shrink(Register* newEnd) 102 106 { 103 ASSERT(newEnd <= m_commitEnd); 104 if (newEnd == m_reservation.base() && (m_commitEnd - begin()) >= maxExcessCapacity) 107 if (newEnd >= m_end) 108 return; 109 m_end = newEnd; 110 if (m_end == m_reservation.base() && (m_commitEnd - begin()) >= maxExcessCapacity) 105 111 releaseExcessCapacity(); 106 112 } … … 108 114 inline bool RegisterFile::grow(Register* newEnd) 109 115 { 110 if (newEnd <= m_ commitEnd)116 if (newEnd <= m_end) 111 117 return true; 112 118 return growSlowCase(newEnd);
Note:
See TracChangeset
for help on using the changeset viewer.