Changeset 214905 in webkit for trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
- Timestamp:
- Apr 4, 2017, 3:23:37 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r214645 r214905 473 473 474 474 if (m_remainingCapacityForFrameCapture) { 475 if ( !visitor->isWasmFrame()476 && !!visitor->codeBlock()477 475 if (visitor->isWasmFrame()) 476 m_results.append(StackFrame::wasm()); 477 else if (!!visitor->codeBlock() && !visitor->codeBlock()->unlinkedCodeBlock()->isBuiltinFunction()) { 478 478 m_results.append( 479 StackFrame(m_vm, visitor->callee() , visitor->codeBlock(), visitor->bytecodeOffset()));479 StackFrame(m_vm, visitor->callee().asCell(), visitor->codeBlock(), visitor->bytecodeOffset())); 480 480 } else { 481 481 m_results.append( 482 StackFrame(m_vm, visitor->callee()));482 StackFrame(m_vm, visitor->callee().asCell())); 483 483 } 484 484 … … 504 504 505 505 size_t framesCount = 0; 506 callFrame->iterate([&] (StackVisitor&) -> StackVisitor::Status {506 StackVisitor::visit(callFrame, &vm, [&] (StackVisitor&) -> StackVisitor::Status { 507 507 framesCount++; 508 508 return StackVisitor::Continue; … … 515 515 516 516 GetStackTraceFunctor functor(vm, results, framesToSkip, framesCount); 517 callFrame->iterate(functor);517 StackVisitor::visit(callFrame, &vm, functor); 518 518 ASSERT(results.size() == results.capacity()); 519 519 } … … 576 576 }; 577 577 578 ALWAYS_INLINE static void notifyDebuggerOfUnwinding(CallFrame* callFrame) 579 { 580 VM& vm = callFrame->vm(); 578 ALWAYS_INLINE static void notifyDebuggerOfUnwinding(VM& vm, CallFrame* callFrame) 579 { 581 580 auto catchScope = DECLARE_CATCH_SCOPE(vm); 582 if (Debugger* debugger = callFrame->vmEntryGlobalObject( )->debugger()) {581 if (Debugger* debugger = callFrame->vmEntryGlobalObject(vm)->debugger()) { 583 582 SuspendExceptionScope scope(&vm); 584 if (jsDynamicCast<JSFunction*>(vm, callFrame->jsCallee())) 583 if (callFrame->isAnyWasmCallee() 584 || (callFrame->callee().isCell() && callFrame->callee().asCell()->inherits(vm, JSFunction::info()))) 585 585 debugger->unwindEvent(callFrame); 586 586 else … … 592 592 class UnwindFunctor { 593 593 public: 594 UnwindFunctor(CallFrame*& callFrame, bool isTermination, CodeBlock*& codeBlock, HandlerInfo*& handler) 595 : m_callFrame(callFrame) 594 UnwindFunctor(VM& vm, CallFrame*& callFrame, bool isTermination, CodeBlock*& codeBlock, HandlerInfo*& handler) 595 : m_vm(vm) 596 , m_callFrame(callFrame) 596 597 , m_isTermination(isTermination) 597 598 , m_codeBlock(codeBlock) … … 615 616 } 616 617 617 notifyDebuggerOfUnwinding(m_ callFrame);618 notifyDebuggerOfUnwinding(m_vm, m_callFrame); 618 619 619 620 copyCalleeSavesToVMEntryFrameCalleeSavesBuffer(visitor); … … 635 636 return; 636 637 637 VM& vm = m_callFrame->vm();638 638 RegisterAtOffsetList* allCalleeSaves = VM::getAllCalleeSaveRegisterOffsets(); 639 639 RegisterSet dontCopyRegisters = RegisterSet::stackRegisters(); … … 641 641 642 642 unsigned registerCount = currentCalleeSaves->size(); 643 VMEntryRecord* record = vmEntryRecord( vm.topVMEntryFrame);643 VMEntryRecord* record = vmEntryRecord(m_vm.topVMEntryFrame); 644 644 for (unsigned i = 0; i < registerCount; i++) { 645 645 RegisterAtOffset currentEntry = currentCalleeSaves->at(i); … … 655 655 } 656 656 657 VM& m_vm; 657 658 CallFrame*& m_callFrame; 658 659 bool m_isTermination; … … 687 688 // Calculate an exception handler vPC, unwinding call frames as necessary. 688 689 HandlerInfo* handler = nullptr; 689 UnwindFunctor functor( callFrame, isTerminatedExecutionException(vm, exception), codeBlock, handler);690 callFrame->iterate(functor);690 UnwindFunctor functor(vm, callFrame, isTerminatedExecutionException(vm, exception), codeBlock, handler); 691 StackVisitor::visit(callFrame, &vm, functor); 691 692 if (!handler) 692 693 return nullptr; … … 695 696 } 696 697 697 void Interpreter::notifyDebuggerOfExceptionToBeThrown(CallFrame* callFrame, Exception* exception) 698 { 699 VM& vm = callFrame->vm(); 700 Debugger* debugger = callFrame->vmEntryGlobalObject()->debugger(); 698 void Interpreter::notifyDebuggerOfExceptionToBeThrown(VM& vm, CallFrame* callFrame, Exception* exception) 699 { 700 Debugger* debugger = callFrame->vmEntryGlobalObject(vm)->debugger(); 701 701 if (debugger && debugger->needsExceptionCallbacks() && !exception->didNotifyInspectorOfThrow()) { 702 702 // This code assumes that if the debugger is enabled then there is no inlining. … … 711 711 else { 712 712 GetCatchHandlerFunctor functor; 713 callFrame->iterate(functor);713 StackVisitor::visit(callFrame, &vm, functor); 714 714 HandlerInfo* handler = functor.handler(); 715 715 ASSERT(!handler || handler->isCatchHandler());
Note:
See TracChangeset
for help on using the changeset viewer.