Changeset 10563 in webkit for trunk/JavaScriptCore/kjs/internal.cpp
- Timestamp:
- Sep 18, 2005, 11:57:28 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/internal.cpp
r10510 r10563 1 // -*- c-basic-offset: 2 -*-2 1 /* 3 2 * This file is part of the KDE libraries … … 452 451 // add this interpreter to the global chain 453 452 // as a root set for garbage collection 454 lockInterpreter(); 453 InterpreterLock lock; 454 455 455 m_interpreter = interp; 456 456 if (s_hook) { … … 475 475 476 476 recursion = 0; 477 unlockInterpreter();478 477 } 479 478 … … 623 622 //fprintf(stderr,"InterpreterImp::clear\n"); 624 623 // remove from global chain (see init()) 625 #if APPLE_CHANGES 626 lockInterpreter(); 627 #endif 624 InterpreterLock lock; 625 628 626 next->prev = prev; 629 627 prev->next = next; … … 636 634 } 637 635 InterpreterMap::removeInterpreterForGlobalObject(global); 638 639 #if APPLE_CHANGES640 unlockInterpreter();641 #endif642 636 } 643 637 … … 649 643 if (_context) 650 644 _context->mark(); 645 if (global) 646 global->mark(); 647 if (globExec._exception) 648 globExec._exception->mark(); 651 649 } 652 650 653 651 bool InterpreterImp::checkSyntax(const UString &code) 654 652 { 653 InterpreterLock lock; 654 655 655 // Parser::parse() returns 0 in a syntax error occurs, so we just check for that 656 656 SharedPtr<ProgramNode> progNode = Parser::parse(UString(), 0, code.data(),code.size(),0,0,0); … … 660 660 Completion InterpreterImp::evaluate(const UString &code, ValueImp *thisV, const UString &sourceURL, int startingLineNumber) 661 661 { 662 #if APPLE_CHANGES 663 lockInterpreter(); 664 #endif 662 InterpreterLock lock; 663 665 664 // prevent against infinite recursion 666 665 if (recursion >= 20) { 667 666 #if APPLE_CHANGES 668 667 Completion result = Completion(Throw, Error::create(&globExec, GeneralError, "Recursion too deep")); 669 unlockInterpreter();670 668 return result; 671 669 #else … … 673 671 #endif 674 672 } 675 673 676 674 // parse the source code 677 675 int sid; … … 684 682 bool cont = dbg->sourceParsed(&globExec, sid, sourceURL, code, errLine); 685 683 if (!cont) 686 #if APPLE_CHANGES687 {688 unlockInterpreter();689 return Completion(Break);690 }691 #else692 684 return Completion(Break); 693 #endif694 685 } 695 686 … … 697 688 if (!progNode) { 698 689 ObjectImp *err = Error::create(&globExec, SyntaxError, errMsg, errLine, sid, &sourceURL); 699 #if APPLE_CHANGES700 unlockInterpreter();701 #endif702 690 return Completion(Throw,err); 703 691 } … … 728 716 // execute the code 729 717 ContextImp ctx(globalObj, this, thisObj); 730 ExecState newExec(m_interpreter, &ctx);718 ExecState newExec(m_interpreter, &ctx); 731 719 progNode->processVarDecls(&newExec); 732 720 res = progNode->execute(&newExec); … … 735 723 recursion--; 736 724 737 #if APPLE_CHANGES738 unlockInterpreter();739 #endif740 725 return res; 741 726 }
Note:
See TracChangeset
for help on using the changeset viewer.