Changeset 79904 in webkit
- Timestamp:
- Feb 28, 2011 1:05:22 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 3 added
- 60 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r79835 r79904 1 2011-02-28 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Gavin Barraclough. 4 5 Make ScopeChainNode GC allocated 6 https://bugs.webkit.org/show_bug.cgi?id=55283 7 8 Simplify lifetime and other issues with the scopechain 9 by making it gc allocated. This allows us to simplify 10 function exit and unwinding, as well as making the 11 current iterative refcounting go away. 12 13 * JavaScriptCore.exp: 14 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 15 * bytecode/CodeBlock.cpp: 16 (JSC::CodeBlock::createActivation): 17 * bytecode/StructureStubInfo.cpp: 18 * bytecompiler/BytecodeGenerator.cpp: 19 (JSC::BytecodeGenerator::generate): 20 (JSC::BytecodeGenerator::BytecodeGenerator): 21 (JSC::BytecodeGenerator::emitJumpIfNotFunctionCall): 22 (JSC::BytecodeGenerator::emitJumpIfNotFunctionApply): 23 * bytecompiler/BytecodeGenerator.h: 24 * debugger/Debugger.cpp: 25 (JSC::Recompiler::operator()): 26 * debugger/DebuggerCallFrame.h: 27 (JSC::DebuggerCallFrame::scopeChain): 28 * interpreter/CachedCall.h: 29 (JSC::CachedCall::CachedCall): 30 * interpreter/CallFrame.h: 31 * interpreter/Interpreter.cpp: 32 (JSC::depth): 33 (JSC::Interpreter::unwindCallFrame): 34 (JSC::Interpreter::throwException): 35 (JSC::Interpreter::execute): 36 (JSC::Interpreter::executeCall): 37 (JSC::Interpreter::executeConstruct): 38 (JSC::Interpreter::privateExecute): 39 * jit/JITCall.cpp: 40 (JSC::JIT::compileOpCallInitializeCallFrame): 41 (JSC::JIT::compileOpCall): 42 * jit/JITCall32_64.cpp: 43 (JSC::JIT::compileOpCallInitializeCallFrame): 44 (JSC::JIT::emit_op_ret): 45 (JSC::JIT::emit_op_ret_object_or_this): 46 (JSC::JIT::compileOpCall): 47 * jit/JITOpcodes.cpp: 48 (JSC::JIT::emit_op_end): 49 (JSC::JIT::emit_op_ret): 50 (JSC::JIT::emit_op_ret_object_or_this): 51 * jit/JITOpcodes32_64.cpp: 52 (JSC::JIT::emit_op_end): 53 * jit/JITStubs.cpp: 54 (JSC::DEFINE_STUB_FUNCTION): 55 * jit/JITStubs.h: 56 * runtime/ArgList.cpp: 57 * runtime/Completion.cpp: 58 (JSC::evaluate): 59 * runtime/Completion.h: 60 * runtime/DateConversion.cpp: 61 * runtime/Executable.cpp: 62 (JSC::EvalExecutable::compileInternal): 63 (JSC::ProgramExecutable::compileInternal): 64 (JSC::FunctionExecutable::compileForCallInternal): 65 (JSC::FunctionExecutable::compileForConstructInternal): 66 * runtime/FunctionConstructor.cpp: 67 (JSC::constructFunction): 68 * runtime/GCActivityCallbackCF.cpp: 69 * runtime/Identifier.cpp: 70 * runtime/JSCell.h: 71 * runtime/JSChunk.cpp: Added. 72 * runtime/JSChunk.h: Added. 73 * runtime/JSFunction.cpp: 74 (JSC::JSFunction::JSFunction): 75 (JSC::JSFunction::markChildren): 76 (JSC::JSFunction::getCallData): 77 (JSC::JSFunction::getOwnPropertySlot): 78 (JSC::JSFunction::getConstructData): 79 * runtime/JSFunction.h: 80 (JSC::JSFunction::scope): 81 (JSC::JSFunction::setScope): 82 * runtime/JSGlobalData.cpp: 83 (JSC::JSGlobalData::JSGlobalData): 84 * runtime/JSGlobalData.h: 85 * runtime/JSGlobalObject.cpp: 86 (JSC::JSGlobalObject::init): 87 (JSC::JSGlobalObject::markChildren): 88 * runtime/JSGlobalObject.h: 89 (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): 90 (JSC::JSGlobalObject::globalScopeChain): 91 * runtime/JSGlobalObjectFunctions.cpp: 92 (JSC::globalFuncEval): 93 * runtime/JSLock.cpp: 94 * runtime/JSNumberCell.cpp: 95 * runtime/JSZombie.cpp: 96 * runtime/MarkedBlock.cpp: 97 * runtime/MarkedSpace.cpp: 98 * runtime/PropertyNameArray.cpp: 99 * runtime/ScopeChain.cpp: 100 (JSC::ScopeChainNode::print): 101 (JSC::ScopeChainNode::localDepth): 102 (JSC::ScopeChainNode::markChildren): 103 * runtime/ScopeChain.h: 104 (JSC::ScopeChainNode::ScopeChainNode): 105 (JSC::ScopeChainNode::createStructure): 106 (JSC::ScopeChainNode::push): 107 (JSC::ScopeChainNode::pop): 108 (JSC::ScopeChainIterator::ScopeChainIterator): 109 (JSC::ScopeChainIterator::operator*): 110 (JSC::ScopeChainIterator::operator->): 111 (JSC::ScopeChainIterator::operator++): 112 (JSC::ScopeChainNode::begin): 113 (JSC::ScopeChainNode::end): 114 (JSC::ExecState::globalData): 115 (JSC::ExecState::lexicalGlobalObject): 116 (JSC::ExecState::globalThisValue): 117 * runtime/ScopeChainMark.h: 118 * wtf/DateMath.cpp: 119 1 120 2011-02-27 Adam Barth <abarth@webkit.org> 2 121 -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r79750 r79904 306 306 __ZN3JSC8Profiler14startProfilingEPNS_9ExecStateERKNS_7UStringE 307 307 __ZN3JSC8Profiler8profilerEv 308 __ZN3JSC8evaluateEPNS_9ExecStateE RNS_10ScopeChainERKNS_10SourceCodeENS_7JSValueE308 __ZN3JSC8evaluateEPNS_9ExecStateEPNS_14ScopeChainNodeERKNS_10SourceCodeENS_7JSValueE 309 309 __ZN3JSC9CodeBlockD1Ev 310 310 __ZN3JSC9CodeBlockD2Ev … … 588 588 __ZTVN3JSC12StringObjectE 589 589 __ZTVN3JSC14JSGlobalObjectE 590 __ZTVN3JSC14ScopeChainNodeE 590 591 __ZTVN3JSC15JSWrapperObjectE 591 592 __ZTVN3JSC16InternalFunctionE -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
r79750 r79904 151 151 ?equalUTF16WithUTF8@Unicode@WTF@@YA_NPB_W0PBD1@Z 152 152 ?evaluate@DebuggerCallFrame@JSC@@QBE?AVJSValue@2@ABVUString@2@AAV32@@Z 153 ?evaluate@JSC@@YA?AVCompletion@1@PAVExecState@1@ AAVScopeChain@1@ABVSourceCode@1@VJSValue@1@@Z153 ?evaluate@JSC@@YA?AVCompletion@1@PAVExecState@1@PAVScopeChainNode@1@ABVSourceCode@1@VJSValue@1@@Z 154 154 ?exclude@Profile@JSC@@QAEXPBVProfileNode@2@@Z 155 155 ?fastCalloc@WTF@@YAPAXII@Z -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r77360 r79904 1698 1698 JSActivation* activation = new (callFrame) JSActivation(callFrame, static_cast<FunctionExecutable*>(ownerExecutable())); 1699 1699 callFrame->uncheckedR(activationRegister()) = JSValue(activation); 1700 callFrame->setScopeChain(callFrame->scopeChain()-> copy()->push(activation));1700 callFrame->setScopeChain(callFrame->scopeChain()->push(activation)); 1701 1701 } 1702 1702 -
trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp
r64943 r79904 26 26 #include "config.h" 27 27 #include "StructureStubInfo.h" 28 29 #include "ScopeChain.h" 28 30 29 31 namespace JSC { -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r79177 r79904 34 34 #include "JSFunction.h" 35 35 #include "Interpreter.h" 36 #include "ScopeChain.h" 36 37 #include "UString.h" 37 38 … … 147 148 148 149 if (s_dumpsGeneratedCode) 149 m_codeBlock->dump(m_scopeChain->globalObject ()->globalExec());150 m_codeBlock->dump(m_scopeChain->globalObject->globalExec()); 150 151 #endif 151 152 … … 156 157 157 158 if (m_expressionTooDeep) 158 return createOutOfMemoryError(m_scopeChain->globalObject ());159 return createOutOfMemoryError(m_scopeChain->globalObject.get()); 159 160 return 0; 160 161 } … … 198 199 } 199 200 200 BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, const ScopeChain&scopeChain, SymbolTable* symbolTable, ProgramCodeBlock* codeBlock)201 : m_shouldEmitDebugHooks(scopeChain .globalObject()->debugger())202 , m_shouldEmitProfileHooks(scopeChain .globalObject()->supportsProfiling())203 , m_shouldEmitRichSourceInfo(scopeChain .globalObject()->supportsRichSourceInfo())204 , m_scopeChain( &scopeChain)201 BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, ScopeChainNode* scopeChain, SymbolTable* symbolTable, ProgramCodeBlock* codeBlock) 202 : m_shouldEmitDebugHooks(scopeChain->globalObject->debugger()) 203 , m_shouldEmitProfileHooks(scopeChain->globalObject->supportsProfiling()) 204 , m_shouldEmitRichSourceInfo(scopeChain->globalObject->supportsRichSourceInfo()) 205 , m_scopeChain(*scopeChain->globalData, scopeChain) 205 206 , m_symbolTable(symbolTable) 206 207 , m_scopeNode(programNode) … … 217 218 , m_firstLazyFunction(0) 218 219 , m_lastLazyFunction(0) 219 , m_globalData( &scopeChain.globalObject()->globalData())220 , m_globalData(scopeChain->globalData) 220 221 , m_lastOpcodeID(op_end) 221 222 #ifndef NDEBUG … … 238 239 m_codeBlock->m_numParameters = 1; // Allocate space for "this" 239 240 240 JSGlobalObject* globalObject = scopeChain .globalObject();241 JSGlobalObject* globalObject = scopeChain->globalObject.get(); 241 242 ExecState* exec = globalObject->globalExec(); 242 243 RegisterFile* registerFile = &exec->globalData().interpreter->registerFile(); … … 283 284 for (size_t i = 0; i < functionStack.size(); ++i) { 284 285 FunctionBodyNode* function = functionStack[i]; 285 globalObject->putWithAttributes(exec, function->ident(), new (exec) JSFunction(exec, makeFunction(exec, function), scopeChain .node()), DontDelete);286 globalObject->putWithAttributes(exec, function->ident(), new (exec) JSFunction(exec, makeFunction(exec, function), scopeChain), DontDelete); 286 287 } 287 288 for (size_t i = 0; i < varStack.size(); ++i) { … … 299 300 } 300 301 301 BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, const ScopeChain&scopeChain, SymbolTable* symbolTable, CodeBlock* codeBlock)302 : m_shouldEmitDebugHooks(scopeChain .globalObject()->debugger())303 , m_shouldEmitProfileHooks(scopeChain .globalObject()->supportsProfiling())304 , m_shouldEmitRichSourceInfo(scopeChain .globalObject()->supportsRichSourceInfo())305 , m_scopeChain( &scopeChain)302 BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, ScopeChainNode* scopeChain, SymbolTable* symbolTable, CodeBlock* codeBlock) 303 : m_shouldEmitDebugHooks(scopeChain->globalObject->debugger()) 304 , m_shouldEmitProfileHooks(scopeChain->globalObject->supportsProfiling()) 305 , m_shouldEmitRichSourceInfo(scopeChain->globalObject->supportsRichSourceInfo()) 306 , m_scopeChain(*scopeChain->globalData, scopeChain) 306 307 , m_symbolTable(symbolTable) 307 308 , m_scopeNode(functionBody) … … 317 318 , m_firstLazyFunction(0) 318 319 , m_lastLazyFunction(0) 319 , m_globalData( &scopeChain.globalObject()->globalData())320 , m_globalData(scopeChain->globalData) 320 321 , m_lastOpcodeID(op_end) 321 322 #ifndef NDEBUG … … 465 466 } 466 467 467 BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, const ScopeChain&scopeChain, SymbolTable* symbolTable, EvalCodeBlock* codeBlock)468 : m_shouldEmitDebugHooks(scopeChain .globalObject()->debugger())469 , m_shouldEmitProfileHooks(scopeChain .globalObject()->supportsProfiling())470 , m_shouldEmitRichSourceInfo(scopeChain .globalObject()->supportsRichSourceInfo())471 , m_scopeChain( &scopeChain)468 BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, ScopeChainNode* scopeChain, SymbolTable* symbolTable, EvalCodeBlock* codeBlock) 469 : m_shouldEmitDebugHooks(scopeChain->globalObject->debugger()) 470 , m_shouldEmitProfileHooks(scopeChain->globalObject->supportsProfiling()) 471 , m_shouldEmitRichSourceInfo(scopeChain->globalObject->supportsRichSourceInfo()) 472 , m_scopeChain(*scopeChain->globalData, scopeChain) 472 473 , m_symbolTable(symbolTable) 473 474 , m_scopeNode(evalNode) … … 483 484 , m_firstLazyFunction(0) 484 485 , m_lastLazyFunction(0) 485 , m_globalData( &scopeChain.globalObject()->globalData())486 , m_globalData(scopeChain->globalData) 486 487 , m_lastOpcodeID(op_end) 487 488 #ifndef NDEBUG … … 908 909 emitOpcode(op_jneq_ptr); 909 910 instructions().append(cond->index()); 910 instructions().append(m_scopeChain->globalObject ()->d()->callFunction.get());911 instructions().append(m_scopeChain->globalObject->d()->callFunction.get()); 911 912 instructions().append(target->bind(begin, instructions().size())); 912 913 return target; … … 919 920 emitOpcode(op_jneq_ptr); 920 921 instructions().append(cond->index()); 921 instructions().append(m_scopeChain->globalObject ()->d()->applyFunction.get());922 instructions().append(m_scopeChain->globalObject->d()->applyFunction.get()); 922 923 instructions().append(target->bind(begin, instructions().size())); 923 924 return target; -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r76248 r79904 48 48 49 49 class Identifier; 50 class ScopeChain; 51 class ScopeNode; 50 class ScopeChainNode; 52 51 53 52 class CallArguments { … … 94 93 static bool dumpsGeneratedCode(); 95 94 96 BytecodeGenerator(ProgramNode*, const ScopeChain&, SymbolTable*, ProgramCodeBlock*);97 BytecodeGenerator(FunctionBodyNode*, const ScopeChain&, SymbolTable*, CodeBlock*);98 BytecodeGenerator(EvalNode*, const ScopeChain&, SymbolTable*, EvalCodeBlock*);95 BytecodeGenerator(ProgramNode*, ScopeChainNode*, SymbolTable*, ProgramCodeBlock*); 96 BytecodeGenerator(FunctionBodyNode*, ScopeChainNode*, SymbolTable*, CodeBlock*); 97 BytecodeGenerator(EvalNode*, ScopeChainNode*, SymbolTable*, EvalCodeBlock*); 99 98 100 99 JSGlobalData* globalData() const { return m_globalData; } … … 521 520 bool m_shouldEmitRichSourceInfo; 522 521 523 const ScopeChain*m_scopeChain;522 Global<ScopeChainNode> m_scopeChain; 524 523 SymbolTable* m_symbolTable; 525 524 -
trunk/Source/JavaScriptCore/debugger/Debugger.cpp
r79132 r79904 77 77 return; 78 78 79 ExecState* exec = function->scope() .globalObject()->JSGlobalObject::globalExec();79 ExecState* exec = function->scope()->globalObject->JSGlobalObject::globalExec(); 80 80 executable->discardCode(); 81 if (m_debugger == function->scope() .globalObject()->debugger())81 if (m_debugger == function->scope()->globalObject->debugger()) 82 82 m_sourceProviders.add(executable->source().provider(), exec); 83 83 } -
trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.h
r44224 r79904 50 50 51 51 JSGlobalObject* dynamicGlobalObject() const { return m_callFrame->dynamicGlobalObject(); } 52 constScopeChainNode* scopeChain() const { return m_callFrame->scopeChain(); }52 ScopeChainNode* scopeChain() const { return m_callFrame->scopeChain(); } 53 53 const UString* functionName() const; 54 54 UString calculatedFunctionName() const; -
trunk/Source/JavaScriptCore/interpreter/CachedCall.h
r76248 r79904 39 39 : m_valid(false) 40 40 , m_interpreter(callFrame->interpreter()) 41 , m_globalObjectScope(callFrame, function->scope() .globalObject())41 , m_globalObjectScope(callFrame, function->scope()->globalObject.get()) 42 42 { 43 43 ASSERT(!function->isHostFunction()); 44 m_closure = m_interpreter->prepareForRepeatCall(function->jsExecutable(), callFrame, function, argCount, function->scope() .node());44 m_closure = m_interpreter->prepareForRepeatCall(function->jsExecutable(), callFrame, function, argCount, function->scope()); 45 45 m_valid = !callFrame->hadException(); 46 46 } -
trunk/Source/JavaScriptCore/interpreter/CallFrame.h
r77151 r79904 27 27 #include "MacroAssemblerCodeRef.h" 28 28 #include "RegisterFile.h" 29 #include "ScopeChain.h"30 29 31 30 namespace JSC { … … 34 33 class JSActivation; 35 34 class Interpreter; 35 class ScopeChainNode; 36 36 37 37 // Represents the current state of script execution. … … 52 52 // Global object in which the currently executing code was defined. 53 53 // Differs from dynamicGlobalObject() during function calls across web browser frames. 54 JSGlobalObject* lexicalGlobalObject() const 55 { 56 return scopeChain()->globalObject; 57 } 54 inline JSGlobalObject* lexicalGlobalObject() const; 58 55 59 56 // Differs from lexicalGlobalObject because this will have DOM window shell rather than 60 57 // the actual DOM window, which can't be "this" for security reasons. 61 JSObject* globalThisValue() const 62 { 63 return scopeChain()->globalThis; 64 } 58 inline JSObject* globalThisValue() const; 65 59 66 JSGlobalData& globalData() const 67 { 68 ASSERT(scopeChain()->globalData); 69 return *scopeChain()->globalData; 70 } 60 inline JSGlobalData& globalData() const; 71 61 72 62 // Convenience functions for access to global data. -
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r79475 r79904 77 77 78 78 // Returns the depth of the scope chain within a given call frame. 79 static int depth(CodeBlock* codeBlock, ScopeChain &sc)79 static int depth(CodeBlock* codeBlock, ScopeChainNode* sc) 80 80 { 81 81 if (!codeBlock->needsFullScopeChain()) 82 82 return 0; 83 return sc .localDepth();83 return sc->localDepth(); 84 84 } 85 85 … … 580 580 } 581 581 582 if (oldCodeBlock->needsFullScopeChain())583 scopeChain->deref();584 585 582 CallFrame* callerFrame = callFrame->callerFrame(); 586 583 if (callerFrame->hasHostCallFrameFlag()) … … 711 708 // Unwind the scope chain within the exception handler's call frame. 712 709 ScopeChainNode* scopeChain = callFrame->scopeChain(); 713 ScopeChain sc(scopeChain);714 710 int scopeDelta = 0; 715 711 if (!codeBlock->needsFullScopeChain() || codeBlock->codeType() != FunctionCode 716 712 || callFrame->uncheckedR(codeBlock->activationRegister()).jsValue()) 717 scopeDelta = depth(codeBlock, sc ) - handler->scopeDepth;713 scopeDelta = depth(codeBlock, scopeChain) - handler->scopeDepth; 718 714 ASSERT(scopeDelta >= 0); 719 715 while (scopeDelta--) … … 762 758 newCallFrame->uncheckedR(newCallFrame->hostThisRegister()) = JSValue(thisObj); 763 759 764 if (codeBlock->needsFullScopeChain()) 765 scopeChain->ref(); 766 767 DynamicGlobalObjectScope globalObjectScope(callFrame, scopeChain->globalObject); 760 DynamicGlobalObjectScope globalObjectScope(callFrame, scopeChain->globalObject.get()); 768 761 769 762 Profiler** profiler = Profiler::enabledProfilerReference(); … … 836 829 newCallFrame->init(newCodeBlock, 0, callDataScopeChain, callFrame->addHostCallFrameFlag(), argCount, function); 837 830 838 DynamicGlobalObjectScope globalObjectScope(newCallFrame, callDataScopeChain->globalObject );831 DynamicGlobalObjectScope globalObjectScope(newCallFrame, callDataScopeChain->globalObject.get()); 839 832 840 833 Profiler** profiler = Profiler::enabledProfilerReference(); … … 868 861 newCallFrame->init(0, 0, scopeChain, callFrame->addHostCallFrameFlag(), argCount, function); 869 862 870 DynamicGlobalObjectScope globalObjectScope(newCallFrame, scopeChain->globalObject );863 DynamicGlobalObjectScope globalObjectScope(newCallFrame, scopeChain->globalObject.get()); 871 864 872 865 Profiler** profiler = Profiler::enabledProfilerReference(); … … 925 918 newCallFrame->init(newCodeBlock, 0, constructDataScopeChain, callFrame->addHostCallFrameFlag(), argCount, constructor); 926 919 927 DynamicGlobalObjectScope globalObjectScope(newCallFrame, constructDataScopeChain->globalObject );920 DynamicGlobalObjectScope globalObjectScope(newCallFrame, constructDataScopeChain->globalObject.get()); 928 921 929 922 Profiler** profiler = Profiler::enabledProfilerReference(); … … 960 953 newCallFrame->init(0, 0, scopeChain, callFrame->addHostCallFrameFlag(), argCount, constructor); 961 954 962 DynamicGlobalObjectScope globalObjectScope(newCallFrame, scopeChain->globalObject );955 DynamicGlobalObjectScope globalObjectScope(newCallFrame, scopeChain->globalObject.get()); 963 956 964 957 Profiler** profiler = Profiler::enabledProfilerReference(); … … 1077 1070 return checkedReturn(throwStackOverflowError(callFrame)); 1078 1071 1079 DynamicGlobalObjectScope globalObjectScope(callFrame, scopeChain->globalObject );1072 DynamicGlobalObjectScope globalObjectScope(callFrame, scopeChain->globalObject.get()); 1080 1073 1081 1074 JSObject* compileError = eval->compile(callFrame, scopeChain); … … 1085 1078 1086 1079 JSObject* variableObject; 1087 for (ScopeChainNode* node = scopeChain; ; node = node->next ) {1080 for (ScopeChainNode* node = scopeChain; ; node = node->next.get()) { 1088 1081 ASSERT(node); 1089 1082 if (node->object->isVariableObject()) { … … 1133 1126 newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), codeBlock->m_numParameters, 0); 1134 1127 newCallFrame->uncheckedR(newCallFrame->hostThisRegister()) = JSValue(thisObj); 1135 1136 if (codeBlock->needsFullScopeChain())1137 scopeChain->ref();1138 1128 1139 1129 Profiler** profiler = Profiler::enabledProfilerReference(); … … 3806 3796 if (!function->name().isNull()) { 3807 3797 JSStaticScopeObject* functionScopeObject = new (callFrame) JSStaticScopeObject(callFrame, function->name(), func, ReadOnly | DontDelete); 3808 func->s cope().push(functionScopeObject);3798 func->setScope(*globalData, func->scope()->push(functionScopeObject)); 3809 3799 } 3810 3800 … … 3836 3826 Register* argv = newCallFrame - RegisterFile::CallFrameHeaderSize - argCount; 3837 3827 JSValue thisValue = argv[0].jsValue(); 3838 JSGlobalObject* globalObject = callFrame->scopeChain()->globalObject ;3828 JSGlobalObject* globalObject = callFrame->scopeChain()->globalObject.get(); 3839 3829 3840 3830 if (thisValue == globalObject && funcVal == globalObject->evalFunction()) { … … 4151 4141 int result = vPC[1].u.operand; 4152 4142 4153 if (callFrame->codeBlock()->needsFullScopeChain() && callFrame->r(codeBlock->activationRegister()).jsValue())4154 callFrame->scopeChain()->deref();4155 4156 4143 JSValue returnValue = callFrame->r(result).jsValue(); 4157 4144 … … 4192 4179 int result = vPC[1].u.operand; 4193 4180 4194 if (codeBlock->needsFullScopeChain() && callFrame->r(codeBlock->activationRegister()).jsValue())4195 callFrame->scopeChain()->deref();4196 4197 4181 JSValue returnValue = callFrame->r(result).jsValue(); 4198 4182 … … 4239 4223 JSActivation* activation = new (globalData) JSActivation(callFrame, static_cast<FunctionExecutable*>(codeBlock->ownerExecutable())); 4240 4224 callFrame->r(activationReg) = JSValue(activation); 4241 callFrame->setScopeChain(callFrame->scopeChain()-> copy()->push(activation));4225 callFrame->setScopeChain(callFrame->scopeChain()->push(activation)); 4242 4226 } 4243 4227 vPC += OPCODE_LENGTH(op_create_activation); … … 4278 4262 structure = asObject(proto)->inheritorID(); 4279 4263 else 4280 structure = constructor->scope() .node()->globalObject->emptyObjectStructure();4264 structure = constructor->scope()->globalObject->emptyObjectStructure(); 4281 4265 callFrame->uncheckedR(thisRegister) = constructEmptyObject(callFrame, structure); 4282 4266 … … 4644 4628 */ 4645 4629 4646 if (codeBlock->needsFullScopeChain()) {4647 ScopeChainNode* scopeChain = callFrame->scopeChain();4648 ASSERT(scopeChain->refCount > 1);4649 scopeChain->deref();4650 }4651 4630 int result = vPC[1].u.operand; 4652 4631 return callFrame->r(result).jsValue(); -
trunk/Source/JavaScriptCore/jit/JITCall.cpp
r70111 r79904 50 50 { 51 51 store32(regT1, Address(callFrameRegister, RegisterFile::ArgumentCount * static_cast<int>(sizeof(Register)))); 52 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain) + OBJECT_OFFSETOF(ScopeChain, m_node)), regT3); // newScopeChain52 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain)), regT3); // newScopeChain 53 53 storePtr(regT0, Address(callFrameRegister, RegisterFile::Callee * static_cast<int>(sizeof(Register)))); 54 54 storePtr(regT3, Address(callFrameRegister, RegisterFile::ScopeChain * static_cast<int>(sizeof(Register)))); … … 199 199 // Note that this omits to set up RegisterFile::CodeBlock, which is set in the callee 200 200 201 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain) + OBJECT_OFFSETOF(ScopeChain, m_node)), regT1); // newScopeChain201 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain)), regT1); // newScopeChain 202 202 203 203 store32(Imm32(argCount), Address(callFrameRegister, (registerOffset + RegisterFile::ArgumentCount) * static_cast<int>(sizeof(Register)))); -
trunk/Source/JavaScriptCore/jit/JITCall32_64.cpp
r79247 r79904 51 51 // regT0 holds callee, regT1 holds argCount 52 52 store32(regT1, Address(callFrameRegister, RegisterFile::ArgumentCount * static_cast<int>(sizeof(Register)))); 53 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain) + OBJECT_OFFSETOF(ScopeChain, m_node)), regT3); // scopeChain53 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain)), regT3); // scopeChain 54 54 storePtr(regT0, Address(callFrameRegister, RegisterFile::Callee * static_cast<int>(sizeof(Register)))); // callee 55 55 storePtr(regT3, Address(callFrameRegister, RegisterFile::ScopeChain * static_cast<int>(sizeof(Register)))); // scopeChain … … 108 108 unsigned dst = currentInstruction[1].u.operand; 109 109 110 // We could JIT generate the deref, only calling out to C when the refcount hits zero.111 if (m_codeBlock->needsFullScopeChain()) {112 Jump activationNotCreated = branch32(Equal, tagFor(m_codeBlock->activationRegister()), Imm32(JSValue::EmptyValueTag));113 JITStubCall(this, cti_op_ret_scopeChain).call();114 activationNotCreated.link(this);115 }116 110 emitLoad(dst, regT1, regT0); 117 111 emitGetFromCallFrameHeaderPtr(RegisterFile::ReturnPC, regT2); … … 126 120 unsigned result = currentInstruction[1].u.operand; 127 121 unsigned thisReg = currentInstruction[2].u.operand; 128 129 // We could JIT generate the deref, only calling out to C when the refcount hits zero.130 if (m_codeBlock->needsFullScopeChain()) {131 Jump activationNotCreated = branch32(Equal, tagFor(m_codeBlock->activationRegister()), Imm32(JSValue::EmptyValueTag));132 JITStubCall(this, cti_op_ret_scopeChain).call();133 activationNotCreated.link(this);134 }135 122 136 123 emitLoad(result, regT1, regT0); … … 292 279 // Fast version of stack frame initialization, directly relative to edi. 293 280 // Note that this omits to set up RegisterFile::CodeBlock, which is set in the callee 294 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain) + OBJECT_OFFSETOF(ScopeChain, m_node)), regT2);281 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain)), regT2); 295 282 296 283 store32(Imm32(argCount), Address(callFrameRegister, (registerOffset + RegisterFile::ArgumentCount) * static_cast<int>(sizeof(Register)))); -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r78732 r79904 331 331 void JIT::emit_op_end(Instruction* currentInstruction) 332 332 { 333 if (m_codeBlock->needsFullScopeChain())334 JITStubCall(this, cti_op_end).call();335 336 333 ASSERT(returnValueRegister != callFrameRegister); 337 334 emitGetVirtualRegister(currentInstruction[1].u.operand, returnValueRegister); … … 544 541 void JIT::emit_op_ret(Instruction* currentInstruction) 545 542 { 546 // We could JIT generate the deref, only calling out to C when the refcount hits zero.547 if (m_codeBlock->needsFullScopeChain()) {548 Jump activationNotCreated = branchTestPtr(Zero, addressFor(m_codeBlock->activationRegister()));549 JITStubCall(this, cti_op_ret_scopeChain).call();550 activationNotCreated.link(this);551 }552 543 ASSERT(callFrameRegister != regT1); 553 544 ASSERT(regT1 != returnValueRegister); … … 570 561 void JIT::emit_op_ret_object_or_this(Instruction* currentInstruction) 571 562 { 572 // We could JIT generate the deref, only calling out to C when the refcount hits zero.573 if (m_codeBlock->needsFullScopeChain()) {574 Jump activationNotCreated = branchTestPtr(Zero, addressFor(m_codeBlock->activationRegister()));575 JITStubCall(this, cti_op_ret_scopeChain).call();576 activationNotCreated.link(this);577 }578 579 563 ASSERT(callFrameRegister != regT1); 580 564 ASSERT(regT1 != returnValueRegister); -
trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r78732 r79904 449 449 void JIT::emit_op_end(Instruction* currentInstruction) 450 450 { 451 if (m_codeBlock->needsFullScopeChain())452 JITStubCall(this, cti_op_end).call();453 451 ASSERT(returnValueRegister != callFrameRegister); 454 452 emitLoad(currentInstruction[1].u.operand, regT1, regT0); -
trunk/Source/JavaScriptCore/jit/JITStubs.cpp
r79551 r79904 1175 1175 structure = asObject(proto)->inheritorID(); 1176 1176 else 1177 structure = constructor->scope() .node()->globalObject->emptyObjectStructure();1177 structure = constructor->scope()->globalObject->emptyObjectStructure(); 1178 1178 JSValue result = constructEmptyObject(callFrame, structure); 1179 1179 … … 1203 1203 CHECK_FOR_EXCEPTION_AT_END(); 1204 1204 return JSValue::encode(result); 1205 }1206 1207 DEFINE_STUB_FUNCTION(void, op_end)1208 {1209 STUB_INIT_STACK_FRAME(stackFrame);1210 1211 ScopeChainNode* scopeChain = stackFrame.callFrame->scopeChain();1212 ASSERT(scopeChain->refCount > 1);1213 scopeChain->deref();1214 1205 } 1215 1206 … … 1848 1839 ASSERT(!function->isHostFunction()); 1849 1840 FunctionExecutable* executable = function->jsExecutable(); 1850 ScopeChainNode* callDataScopeChain = function->scope() .node();1841 ScopeChainNode* callDataScopeChain = function->scope(); 1851 1842 JSObject* error = executable->compileForCall(stackFrame.callFrame, callDataScopeChain); 1852 1843 if (error) { … … 1869 1860 ASSERT(!function->isHostFunction()); 1870 1861 FunctionExecutable* executable = function->jsExecutable(); 1871 ScopeChainNode* callDataScopeChain = function->scope() .node();1862 ScopeChainNode* callDataScopeChain = function->scope(); 1872 1863 JSObject* error = executable->compileForConstruct(stackFrame.callFrame, callDataScopeChain); 1873 1864 if (error) { … … 1930 1921 callFrame->setArgumentCountIncludingThis(argCount); 1931 1922 callFrame->setCallee(callee); 1932 callFrame->setScopeChain(callee->scope() .node());1923 callFrame->setScopeChain(callee->scope()); 1933 1924 callFrame->setReturnPC(pc.value()); 1934 1925 … … 1989 1980 callFrame->setArgumentCountIncludingThis(argCount); 1990 1981 callFrame->setCallee(callee); 1991 callFrame->setScopeChain(callee->scope() .node());1982 callFrame->setScopeChain(callee->scope()); 1992 1983 callFrame->setReturnPC(pc.value()); 1993 1984 … … 2010 2001 else { 2011 2002 FunctionExecutable* functionExecutable = static_cast<FunctionExecutable*>(executable); 2012 JSObject* error = functionExecutable->compileForCall(callFrame, callee->scope() .node());2003 JSObject* error = functionExecutable->compileForCall(callFrame, callee->scope()); 2013 2004 if (error) { 2014 2005 callFrame->globalData().exception = createStackOverflowError(callFrame); … … 2044 2035 else { 2045 2036 FunctionExecutable* functionExecutable = static_cast<FunctionExecutable*>(executable); 2046 JSObject* error = functionExecutable->compileForConstruct(callFrame, callee->scope() .node());2037 JSObject* error = functionExecutable->compileForConstruct(callFrame, callee->scope()); 2047 2038 if (error) { 2048 2039 throwStackOverflowError(callFrame, stackFrame.globalData, ReturnAddressPtr(callFrame->returnPC()), STUB_RETURN_ADDRESS); … … 2071 2062 2072 2063 JSActivation* activation = new (stackFrame.globalData) JSActivation(stackFrame.callFrame, static_cast<FunctionExecutable*>(stackFrame.callFrame->codeBlock()->ownerExecutable())); 2073 stackFrame.callFrame->setScopeChain(stackFrame.callFrame->scopeChain()-> copy()->push(activation));2064 stackFrame.callFrame->setScopeChain(stackFrame.callFrame->scopeChain()->push(activation)); 2074 2065 return activation; 2075 2066 } … … 2173 2164 ASSERT(*stackFrame.enabledProfilerReference); 2174 2165 (*stackFrame.enabledProfilerReference)->didExecute(stackFrame.callFrame, stackFrame.args[0].jsValue()); 2175 }2176 2177 DEFINE_STUB_FUNCTION(void, op_ret_scopeChain)2178 {2179 STUB_INIT_STACK_FRAME(stackFrame);2180 2181 ASSERT(stackFrame.callFrame->codeBlock()->needsFullScopeChain());2182 stackFrame.callFrame->scopeChain()->deref();2183 2166 } 2184 2167 … … 3009 2992 if (!function->name().isNull()) { 3010 2993 JSStaticScopeObject* functionScopeObject = new (callFrame) JSStaticScopeObject(callFrame, function->name(), func, ReadOnly | DontDelete); 3011 func->s cope().push(functionScopeObject);2994 func->setScope(callFrame->globalData(), func->scope()->push(functionScopeObject)); 3012 2995 } 3013 2996 … … 3119 3102 Register* argv = newCallFrame - RegisterFile::CallFrameHeaderSize - argCount; 3120 3103 JSValue baseValue = argv[0].jsValue(); 3121 JSGlobalObject* globalObject = callFrame->scopeChain()->globalObject ;3104 JSGlobalObject* globalObject = callFrame->scopeChain()->globalObject.get(); 3122 3105 3123 3106 if (baseValue == globalObject && funcVal == globalObject->evalFunction()) { -
trunk/Source/JavaScriptCore/jit/JITStubs.h
r75408 r79904 391 391 void JIT_STUB cti_op_put_getter(STUB_ARGS_DECLARATION); 392 392 void JIT_STUB cti_op_put_setter(STUB_ARGS_DECLARATION); 393 void JIT_STUB cti_op_ret_scopeChain(STUB_ARGS_DECLARATION);394 393 void JIT_STUB cti_op_tear_off_activation(STUB_ARGS_DECLARATION); 395 394 void JIT_STUB cti_op_tear_off_arguments(STUB_ARGS_DECLARATION); -
trunk/Source/JavaScriptCore/runtime/ArgList.cpp
r77151 r79904 24 24 #include "JSValue.h" 25 25 #include "JSCell.h" 26 #include "ScopeChain.h" 26 27 27 28 using std::min; -
trunk/Source/JavaScriptCore/runtime/Completion.cpp
r70703 r79904 48 48 } 49 49 50 Completion evaluate(ExecState* exec, ScopeChain &scopeChain, const SourceCode& source, JSValue thisValue)50 Completion evaluate(ExecState* exec, ScopeChainNode* scopeChain, const SourceCode& source, JSValue thisValue) 51 51 { 52 52 JSLock lock(exec); … … 54 54 55 55 RefPtr<ProgramExecutable> program = ProgramExecutable::create(exec, source); 56 JSObject* error = program->compile(exec, scopeChain .node());56 JSObject* error = program->compile(exec, scopeChain); 57 57 if (error) 58 58 return Completion(Throw, error); … … 60 60 JSObject* thisObj = (!thisValue || thisValue.isUndefinedOrNull()) ? exec->dynamicGlobalObject() : thisValue.toObject(exec); 61 61 62 JSValue result = exec->interpreter()->execute(program.get(), exec, scopeChain .node(), thisObj);62 JSValue result = exec->interpreter()->execute(program.get(), exec, scopeChain, thisObj); 63 63 64 64 if (exec->hadException()) { -
trunk/Source/JavaScriptCore/runtime/Completion.h
r57192 r79904 29 29 30 30 class ExecState; 31 class ScopeChain ;31 class ScopeChainNode; 32 32 class SourceCode; 33 33 … … 57 57 58 58 Completion checkSyntax(ExecState*, const SourceCode&); 59 Completion evaluate(ExecState*, ScopeChain &, const SourceCode&, JSValue thisValue = JSValue());59 Completion evaluate(ExecState*, ScopeChainNode*, const SourceCode&, JSValue thisValue = JSValue()); 60 60 61 61 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/DateConversion.cpp
r69833 r79904 45 45 46 46 #include "CallFrame.h" 47 #include "ScopeChain.h" 47 48 #include "UString.h" 48 49 #include <wtf/DateMath.h> -
trunk/Source/JavaScriptCore/runtime/Executable.cpp
r79177 r79904 102 102 recordParse(evalNode->features(), evalNode->hasCapturedVariables(), evalNode->lineNo(), evalNode->lastLine()); 103 103 104 ScopeChain scopeChain(scopeChainNode); 105 JSGlobalObject* globalObject = scopeChain.globalObject(); 104 JSGlobalObject* globalObject = scopeChainNode->globalObject.get(); 106 105 107 106 ASSERT(!m_evalCodeBlock); 108 m_evalCodeBlock = adoptPtr(new EvalCodeBlock(this, globalObject, source().provider(), scopeChain .localDepth()));109 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(evalNode.get(), scopeChain , m_evalCodeBlock->symbolTable(), m_evalCodeBlock.get())));107 m_evalCodeBlock = adoptPtr(new EvalCodeBlock(this, globalObject, source().provider(), scopeChainNode->localDepth())); 108 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(evalNode.get(), scopeChainNode, m_evalCodeBlock->symbolTable(), m_evalCodeBlock.get()))); 110 109 if ((exception = generator->generate())) { 111 110 m_evalCodeBlock.clear(); … … 155 154 recordParse(programNode->features(), programNode->hasCapturedVariables(), programNode->lineNo(), programNode->lastLine()); 156 155 157 ScopeChain scopeChain(scopeChainNode); 158 JSGlobalObject* globalObject = scopeChain.globalObject(); 156 JSGlobalObject* globalObject = scopeChainNode->globalObject.get(); 159 157 160 158 m_programCodeBlock = adoptPtr(new ProgramCodeBlock(this, GlobalCode, globalObject, source().provider())); 161 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(programNode.get(), scopeChain , &globalObject->symbolTable(), m_programCodeBlock.get())));159 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(programNode.get(), scopeChainNode, &globalObject->symbolTable(), m_programCodeBlock.get()))); 162 160 if ((exception = generator->generate())) { 163 161 m_programCodeBlock.clear(); … … 195 193 recordParse(body->features(), body->hasCapturedVariables(), body->lineNo(), body->lastLine()); 196 194 197 ScopeChain scopeChain(scopeChainNode); 198 JSGlobalObject* globalObject = scopeChain.globalObject(); 195 JSGlobalObject* globalObject = scopeChainNode->globalObject.get(); 199 196 200 197 ASSERT(!m_codeBlockForCall); 201 198 m_codeBlockForCall = adoptPtr(new FunctionCodeBlock(this, FunctionCode, globalObject, source().provider(), source().startOffset(), false)); 202 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(body.get(), scopeChain , m_codeBlockForCall->symbolTable(), m_codeBlockForCall.get())));199 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(body.get(), scopeChainNode, m_codeBlockForCall->symbolTable(), m_codeBlockForCall.get()))); 203 200 if ((exception = generator->generate())) { 204 201 m_codeBlockForCall.clear(); … … 241 238 recordParse(body->features(), body->hasCapturedVariables(), body->lineNo(), body->lastLine()); 242 239 243 ScopeChain scopeChain(scopeChainNode); 244 JSGlobalObject* globalObject = scopeChain.globalObject(); 240 JSGlobalObject* globalObject = scopeChainNode->globalObject.get(); 245 241 246 242 ASSERT(!m_codeBlockForConstruct); 247 243 m_codeBlockForConstruct = adoptPtr(new FunctionCodeBlock(this, FunctionCode, globalObject, source().provider(), source().startOffset(), true)); 248 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(body.get(), scopeChain , m_codeBlockForConstruct->symbolTable(), m_codeBlockForConstruct.get())));244 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(body.get(), scopeChainNode, m_codeBlockForConstruct->symbolTable(), m_codeBlockForConstruct.get()))); 249 245 if ((exception = generator->generate())) { 250 246 m_codeBlockForConstruct.clear(); -
trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp
r77151 r79904 107 107 } 108 108 109 ScopeChain scopeChain(globalObject, &globalData, globalObject, exec->globalThisValue());110 return new (exec) JSFunction(exec, function, scopeChain .node());109 ScopeChainNode* scopeChain = new (exec) ScopeChainNode(0, globalObject, &globalData, globalObject, exec->globalThisValue()); 110 return new (exec) JSFunction(exec, function, scopeChain); 111 111 } 112 112 -
trunk/Source/JavaScriptCore/runtime/GCActivityCallbackCF.cpp
r79434 r79904 34 34 #include "JSGlobalData.h" 35 35 #include "JSLock.h" 36 #include "ScopeChain.h" 36 37 #include <wtf/RetainPtr.h> 37 38 #include <wtf/WTFThreadData.h> -
trunk/Source/JavaScriptCore/runtime/Identifier.cpp
r72592 r79904 24 24 #include "CallFrame.h" 25 25 #include "NumericStrings.h" 26 #include "ScopeChain.h" 26 27 #include <new> // for placement new 27 28 #include <string.h> // for strlen -
trunk/Source/JavaScriptCore/runtime/JSCell.h
r79750 r79904 66 66 friend class MarkedSpace; 67 67 friend class MarkedBlock; 68 friend class ScopeChainNode; 68 69 69 70 private: -
trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
r79240 r79904 60 60 : Base(structure) 61 61 , m_executable(adoptRef(new VPtrHackExecutable())) 62 , m_scopeChain(NoScopeChain())63 62 { 64 63 ASSERT(inherits(&s_info)); … … 68 67 : Base(globalObject, structure) 69 68 , m_executable(thunk) 70 , m_scopeChain( globalObject->globalScopeChain())69 , m_scopeChain(exec->globalData(), this, globalObject->globalScopeChain()) 71 70 { 72 71 ASSERT(inherits(&s_info)); … … 78 77 : Base(globalObject, structure) 79 78 , m_executable(exec->globalData().getHostFunction(func)) 80 , m_scopeChain( globalObject->globalScopeChain())79 , m_scopeChain(exec->globalData(), this, globalObject->globalScopeChain()) 81 80 { 82 81 ASSERT(inherits(&s_info)); … … 86 85 87 86 JSFunction::JSFunction(ExecState* exec, NonNullPassRefPtr<FunctionExecutable> executable, ScopeChainNode* scopeChainNode) 88 : Base(scopeChainNode->globalObject , scopeChainNode->globalObject->functionStructure())87 : Base(scopeChainNode->globalObject.get(), scopeChainNode->globalObject->functionStructure()) 89 88 , m_executable(executable) 90 , m_scopeChain( scopeChainNode)89 , m_scopeChain(exec->globalData(), this, scopeChainNode) 91 90 { 92 91 ASSERT(inherits(&s_info)); … … 152 151 if (!isHostFunction()) { 153 152 jsExecutable()->markAggregate(markStack); 154 scope().markAggregate(markStack);153 markStack.append(&m_scopeChain); 155 154 } 156 155 } … … 163 162 } 164 163 callData.js.functionExecutable = jsExecutable(); 165 callData.js.scopeChain = scope() .node();164 callData.js.scopeChain = scope(); 166 165 return CallTypeJS; 167 166 } … … 197 196 198 197 if (!location) { 199 JSObject* prototype = constructEmptyObject(exec, scope() .globalObject()->emptyObjectStructure());198 JSObject* prototype = constructEmptyObject(exec, scope()->globalObject->emptyObjectStructure()); 200 199 prototype->putDirect(exec->globalData(), exec->propertyNames().constructor, this, DontEnum); 201 200 putDirect(exec->globalData(), exec->propertyNames().prototype, prototype, DontDelete | DontEnum); … … 327 326 return ConstructTypeNone; 328 327 constructData.js.functionExecutable = jsExecutable(); 329 constructData.js.scopeChain = scope() .node();328 constructData.js.scopeChain = scope(); 330 329 return ConstructTypeJS; 331 330 } -
trunk/Source/JavaScriptCore/runtime/JSFunction.h
r79177 r79904 54 54 const UString calculatedDisplayName(ExecState*); 55 55 56 ScopeChain &scope()56 ScopeChainNode* scope() 57 57 { 58 58 ASSERT(!isHostFunctionNonInline()); 59 return m_scopeChain ;59 return m_scopeChain.get(); 60 60 } 61 void setScope( const ScopeChain&scopeChain)61 void setScope(JSGlobalData& globalData, ScopeChainNode* scopeChain) 62 62 { 63 63 ASSERT(!isHostFunctionNonInline()); 64 m_scopeChain = scopeChain;64 m_scopeChain.set(globalData, this, scopeChain); 65 65 } 66 66 … … 104 104 105 105 RefPtr<ExecutableBase> m_executable; 106 ScopeChainm_scopeChain;106 WriteBarrier<ScopeChainNode> m_scopeChain; 107 107 }; 108 108 -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp
r79616 r79904 133 133 , getterSetterStructure(GetterSetter::createStructure(jsNull())) 134 134 , apiWrapperStructure(JSAPIValueWrapper::createStructure(jsNull())) 135 , scopeChainNodeStructure(ScopeChainNode::createStructure(jsNull())) 135 136 , dummyMarkableCellStructure(JSCell::createDummyStructure()) 136 137 , identifierTable(globalDataType == Default ? wtfThreadData().currentIdentifierTable() : createIdentifierTable()) -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.h
r79616 r79904 154 154 RefPtr<Structure> getterSetterStructure; 155 155 RefPtr<Structure> apiWrapperStructure; 156 RefPtr<Structure> scopeChainNodeStructure; 156 157 RefPtr<Structure> dummyMarkableCellStructure; 157 158 -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r79616 r79904 113 113 114 114 d()->globalData = Heap::heap(this)->globalData(); 115 d()->globalScopeChain = ScopeChain(this, d()->globalData.get(), this, thisValue);116 117 JSGlobalObject::globalExec()->init(0, 0, d()->globalScopeChain. node(), CallFrame::noCaller(), 0, 0);115 d()->globalScopeChain.set(*d()->globalData, this, new (d()->globalData.get()) ScopeChainNode(0, this, d()->globalData.get(), this, thisValue)); 116 117 JSGlobalObject::globalExec()->init(0, 0, d()->globalScopeChain.get(), CallFrame::noCaller(), 0, 0); 118 118 119 119 d()->debugger = 0; … … 320 320 JSVariableObject::markChildren(markStack); 321 321 322 markIfNeeded(markStack, &d()->globalScopeChain); 323 322 324 markIfNeeded(markStack, &d()->regExpConstructor); 323 325 markIfNeeded(markStack, &d()->errorConstructor); -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r79177 r79904 70 70 , destructor(destructor) 71 71 , registerArraySize(0) 72 , globalScopeChain( NoScopeChain())72 , globalScopeChain() 73 73 , weakRandom(static_cast<unsigned>(randomNumber() * (std::numeric_limits<unsigned>::max() + 1.0))) 74 74 { … … 84 84 Debugger* debugger; 85 85 86 ScopeChainglobalScopeChain;86 WriteBarrier<ScopeChainNode> globalScopeChain; 87 87 Register globalCallFrame[RegisterFile::CallFrameHeaderSize]; 88 88 … … 229 229 virtual bool supportsRichSourceInfo() const { return true; } 230 230 231 ScopeChain & globalScopeChain() { return d()->globalScopeChain; }231 ScopeChainNode* globalScopeChain() { return d()->globalScopeChain.get(); } 232 232 233 233 virtual bool isGlobalObject() const { return true; } -
trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
r79177 r79904 451 451 452 452 RefPtr<EvalExecutable> eval = EvalExecutable::create(exec, makeSource(s), false); 453 JSObject* error = eval->compile(exec, static_cast<JSGlobalObject*>(unwrappedObject)->globalScopeChain() .node());453 JSObject* error = eval->compile(exec, static_cast<JSGlobalObject*>(unwrappedObject)->globalScopeChain()); 454 454 if (error) 455 455 return throwVMError(exec, error); 456 456 457 return JSValue::encode(exec->interpreter()->execute(eval.get(), exec, thisObject, static_cast<JSGlobalObject*>(unwrappedObject)->globalScopeChain() .node()));457 return JSValue::encode(exec->interpreter()->execute(eval.get(), exec, thisObject, static_cast<JSGlobalObject*>(unwrappedObject)->globalScopeChain())); 458 458 } 459 459 -
trunk/Source/JavaScriptCore/runtime/JSLock.cpp
r79564 r79904 24 24 #include "Heap.h" 25 25 #include "CallFrame.h" 26 #include "ScopeChain.h" 26 27 27 28 #if USE(PTHREADS) -
trunk/Source/JavaScriptCore/runtime/JSNumberCell.cpp
r70111 r79904 23 23 #include "config.h" 24 24 #include "JSNumberCell.h" 25 #include "ScopeChain.h" 25 26 26 27 // Keep our exported symbols lists happy. -
trunk/Source/JavaScriptCore/runtime/JSZombie.cpp
r79132 r79904 27 27 #include "JSZombie.h" 28 28 #include "ClassInfo.h" 29 #include "ScopeChain.h" 29 30 30 31 #if ENABLE(JSC_ZOMBIES) -
trunk/Source/JavaScriptCore/runtime/MarkedBlock.cpp
r79492 r79904 28 28 29 29 #include "JSCell.h" 30 #include "ScopeChain.h" 30 31 31 32 namespace JSC { -
trunk/Source/JavaScriptCore/runtime/MarkedSpace.cpp
r79750 r79904 25 25 #include "JSGlobalData.h" 26 26 #include "JSLock.h" 27 #include "ScopeChain.h" 27 28 28 29 namespace JSC { -
trunk/Source/JavaScriptCore/runtime/PropertyNameArray.cpp
r65104 r79904 22 22 #include "PropertyNameArray.h" 23 23 24 #include "ScopeChain.h" 24 25 #include "Structure.h" 25 26 #include "StructureChain.h" -
trunk/Source/JavaScriptCore/runtime/ScopeChain.cpp
r79132 r79904 32 32 #ifndef NDEBUG 33 33 34 void ScopeChainNode::print() const34 void ScopeChainNode::print() 35 35 { 36 36 ScopeChainIterator scopeEnd = end(); 37 37 for (ScopeChainIterator scopeIter = begin(); scopeIter != scopeEnd; ++scopeIter) { 38 DeprecatedPtr<JSObject> o = *scopeIter;38 JSObject* o = scopeIter->get(); 39 39 PropertyNameArray propertyNames(globalObject->globalExec()); 40 40 o->getPropertyNames(globalObject->globalExec(), propertyNames); 41 41 PropertyNameArray::const_iterator propEnd = propertyNames.end(); 42 42 43 fprintf(stderr, "----- [scope %p] -----\n", o .get());43 fprintf(stderr, "----- [scope %p] -----\n", o); 44 44 for (PropertyNameArray::const_iterator propIter = propertyNames.begin(); propIter != propEnd; propIter++) { 45 45 Identifier name = *propIter; … … 52 52 #endif 53 53 54 int ScopeChain ::localDepth() const54 int ScopeChainNode::localDepth() 55 55 { 56 56 int scopeDepth = 0; … … 66 66 } 67 67 68 void ScopeChainNode::markChildren(MarkStack& markStack) 69 { 70 if (next) 71 markStack.append(&next); 72 markStack.append(&object); 73 markStack.append(&globalObject); 74 markStack.append(&globalThis); 75 } 76 68 77 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/ScopeChain.h
r77151 r79904 22 22 #define ScopeChain_h 23 23 24 #include " WriteBarrier.h"24 #include "JSCell.h" 25 25 #include <wtf/FastAllocBase.h> 26 26 … … 33 33 class ScopeChainIterator; 34 34 35 class ScopeChainNode { 36 WTF_MAKE_FAST_ALLOCATED; 35 class ScopeChainNode : public JSCell { 37 36 public: 38 37 ScopeChainNode(ScopeChainNode* next, JSObject* object, JSGlobalData* globalData, JSGlobalObject* globalObject, JSObject* globalThis) 39 : next(next) 40 , object(object) 38 : JSCell(globalData->scopeChainNodeStructure.get()) 41 39 , globalData(globalData) 42 , globalObject(globalObject) 43 , globalThis(globalThis) 44 , refCount(1) 40 , next(*globalData, this, next) 41 , object(*globalData, this, object) 42 , globalObject(*globalData, this, globalObject) 43 , globalThis(*globalData, this, globalThis) 45 44 { 46 45 ASSERT(globalData); 47 46 ASSERT(globalObject); 48 47 } 49 #ifndef NDEBUG50 // Due to the number of subtle and timing dependent bugs that have occurred due51 // to deleted but still "valid" ScopeChainNodes we now deliberately clobber the52 // contents in debug builds.53 ~ScopeChainNode()54 {55 next = 0;56 globalData = 0;57 globalObject = 0;58 globalThis = 0;59 }60 #endif61 48 62 ScopeChainNode* next;63 DeprecatedPtr<JSObject> object;64 49 JSGlobalData* globalData; 65 JSGlobalObject* globalObject; 66 JSObject* globalThis; 67 int refCount; 68 69 void deref() { ASSERT(refCount); if (--refCount == 0) { release();} } 70 void ref() { ASSERT(refCount); ++refCount; } 71 void release(); 72 73 // Before calling "push" on a bare ScopeChainNode, a client should 74 // logically "copy" the node. Later, the client can "deref" the head 75 // of its chain of ScopeChainNodes to reclaim all the nodes it added 76 // after the logical copy, leaving nodes added before the logical copy 77 // (nodes shared with other clients) untouched. 78 ScopeChainNode* copy() 79 { 80 ref(); 81 return this; 82 } 50 WriteBarrier<ScopeChainNode> next; 51 WriteBarrier<JSObject> object; 52 WriteBarrier<JSGlobalObject> globalObject; 53 WriteBarrier<JSObject> globalThis; 83 54 84 55 ScopeChainNode* push(JSObject*); 85 56 ScopeChainNode* pop(); 86 57 87 ScopeChainIterator begin() const; 88 ScopeChainIterator end() const; 58 ScopeChainIterator begin(); 59 ScopeChainIterator end(); 60 61 int localDepth(); 89 62 90 63 #ifndef NDEBUG 91 void print() const;64 void print(); 92 65 #endif 66 67 static PassRefPtr<Structure> createStructure(JSValue proto) { return Structure::create(proto, TypeInfo(CompoundType, StructureFlags), AnonymousSlotCount, 0); } 68 virtual void markChildren(MarkStack&); 69 private: 70 static const unsigned StructureFlags = OverridesMarkChildren; 93 71 }; 94 72 … … 96 74 { 97 75 ASSERT(o); 98 return new ScopeChainNode(this, o, globalData, globalObject, globalThis);76 return new (globalData) ScopeChainNode(this, o, globalData, globalObject.get(), globalThis.get()); 99 77 } 100 78 … … 102 80 { 103 81 ASSERT(next); 104 ScopeChainNode* result = next; 105 106 if (--refCount != 0) 107 ++result->refCount; 108 else 109 delete this; 110 111 return result; 112 } 113 114 inline void ScopeChainNode::release() 115 { 116 // This function is only called by deref(), 117 // Deref ensures these conditions are true. 118 ASSERT(refCount == 0); 119 ScopeChainNode* n = this; 120 do { 121 ScopeChainNode* next = n->next; 122 delete n; 123 n = next; 124 } while (n && --n->refCount == 0); 82 return next.get(); 125 83 } 126 84 127 85 class ScopeChainIterator { 128 86 public: 129 ScopeChainIterator( constScopeChainNode* node)87 ScopeChainIterator(ScopeChainNode* node) 130 88 : m_node(node) 131 89 { 132 90 } 133 91 134 DeprecatedPtr<JSObject> const & operator*() const { return m_node->object; }135 DeprecatedPtr<JSObject> const * operator->() const { return &(operator*()); }92 WriteBarrier<JSObject> const & operator*() const { return m_node->object; } 93 WriteBarrier<JSObject> const * operator->() const { return &(operator*()); } 136 94 137 ScopeChainIterator& operator++() { m_node = m_node->next ; return *this; }95 ScopeChainIterator& operator++() { m_node = m_node->next.get(); return *this; } 138 96 139 97 // postfix ++ intentionally omitted … … 143 101 144 102 private: 145 const ScopeChainNode*m_node;103 DeprecatedPtr<ScopeChainNode> m_node; 146 104 }; 147 105 148 inline ScopeChainIterator ScopeChainNode::begin() const106 inline ScopeChainIterator ScopeChainNode::begin() 149 107 { 150 108 return ScopeChainIterator(this); 151 109 } 152 110 153 inline ScopeChainIterator ScopeChainNode::end() const111 inline ScopeChainIterator ScopeChainNode::end() 154 112 { 155 113 return ScopeChainIterator(0); 156 114 } 157 115 158 class NoScopeChain {}; 159 160 class ScopeChain { 161 friend class JIT; 162 public: 163 ScopeChain(NoScopeChain) 164 : m_node(0) 165 { 166 } 167 168 ScopeChain(JSObject* o, JSGlobalData* globalData, JSGlobalObject* globalObject, JSObject* globalThis) 169 : m_node(new ScopeChainNode(0, o, globalData, globalObject, globalThis)) 170 { 171 } 172 173 ScopeChain(const ScopeChain& c) 174 : m_node(c.m_node->copy()) 175 { 176 } 177 178 ScopeChain& operator=(const ScopeChain& c); 179 180 explicit ScopeChain(ScopeChainNode* node) 181 : m_node(node->copy()) 182 { 183 } 184 185 ~ScopeChain() 186 { 187 if (m_node) 188 m_node->deref(); 189 #ifndef NDEBUG 190 m_node = 0; 191 #endif 192 } 193 194 void swap(ScopeChain&); 195 196 ScopeChainNode* node() const { return m_node; } 197 198 JSObject* top() const { return m_node->object.get(); } 199 200 ScopeChainIterator begin() const { return m_node->begin(); } 201 ScopeChainIterator end() const { return m_node->end(); } 202 203 void push(JSObject* o) { m_node = m_node->push(o); } 204 205 void pop() { m_node = m_node->pop(); } 206 void clear() { m_node->deref(); m_node = 0; } 207 208 JSGlobalObject* globalObject() const { return m_node->globalObject; } 209 210 void markAggregate(MarkStack&) const; 211 212 // Caution: this should only be used if the codeblock this is being used 213 // with needs a full scope chain, otherwise this returns the depth of 214 // the preceeding call frame 215 // 216 // Returns the depth of the current call frame's scope chain 217 int localDepth() const; 218 219 #ifndef NDEBUG 220 void print() const { m_node->print(); } 221 #endif 222 223 private: 224 ScopeChainNode* m_node; 225 }; 226 227 inline void ScopeChain::swap(ScopeChain& o) 116 ALWAYS_INLINE JSGlobalData& ExecState::globalData() const 228 117 { 229 ScopeChainNode* tmp = m_node; 230 m_node = o.m_node; 231 o.m_node = tmp; 118 ASSERT(scopeChain()->globalData); 119 return *scopeChain()->globalData; 232 120 } 233 121 234 inline ScopeChain& ScopeChain::operator=(const ScopeChain& c)122 ALWAYS_INLINE JSGlobalObject* ExecState::lexicalGlobalObject() const 235 123 { 236 ScopeChain tmp(c); 237 swap(tmp); 238 return *this; 124 return scopeChain()->globalObject.get(); 125 } 126 127 ALWAYS_INLINE JSObject* ExecState::globalThisValue() const 128 { 129 return scopeChain()->globalThis.get(); 239 130 } 240 131 -
trunk/Source/JavaScriptCore/runtime/ScopeChainMark.h
r77151 r79904 26 26 namespace JSC { 27 27 28 inline void ScopeChain::markAggregate(MarkStack& markStack) const29 {30 for (ScopeChainNode* n = m_node; n; n = n->next)31 markStack.append(&n->object);32 }33 34 28 } // namespace JSC 35 29 -
trunk/Source/JavaScriptCore/wtf/DateMath.cpp
r79060 r79904 77 77 #include "CurrentTime.h" 78 78 #include "MathExtras.h" 79 #if USE(JSC) 80 #include "ScopeChain.h" 81 #endif 79 82 #include "StdLibExtras.h" 80 83 #include "StringExtras.h" -
trunk/Source/WebCore/ChangeLog
r79900 r79904 1 2011-02-28 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Gavin Barraclough. 4 5 Make ScopeChainNode GC allocated 6 https://bugs.webkit.org/show_bug.cgi?id=55283 7 8 Update WebCore to deal with the absence of the ScopeChain 9 class. 10 11 * ForwardingHeaders/runtime/ScopeChain.h: Added. 12 * bindings/js/JSHTMLElementCustom.cpp: 13 (WebCore::JSHTMLElement::pushEventHandlerScope): 14 * bindings/js/JSJavaScriptCallFrameCustom.cpp: 15 (WebCore::JSJavaScriptCallFrame::scopeChain): 16 (WebCore::JSJavaScriptCallFrame::scopeType): 17 * bindings/js/JSLazyEventListener.cpp: 18 (WebCore::JSLazyEventListener::initializeJSFunction): 19 * bindings/js/JSMainThreadExecState.h: 20 (WebCore::JSMainThreadExecState::evaluate): 21 * bindings/js/JSNodeCustom.cpp: 22 (WebCore::JSNode::pushEventHandlerScope): 23 * bindings/js/JavaScriptCallFrame.cpp: 24 (WebCore::JavaScriptCallFrame::scopeChain): 25 * bindings/js/JavaScriptCallFrame.h: 26 * bindings/scripts/CodeGeneratorJS.pm: 27 * bridge/c/c_class.cpp: 28 * bridge/c/c_runtime.cpp: 29 * bridge/jni/JNIBridge.cpp: 30 * bridge/qt/qt_runtime.cpp: 31 (JSC::Bindings::QtConnectionObject::execute): 32 * plugins/PluginViewNone.cpp: 33 1 34 2011-02-28 Chang Shu <cshu@webkit.org> 2 35 -
trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp
r46444 r79904 34 34 using namespace JSC; 35 35 36 void JSHTMLElement::pushEventHandlerScope(ExecState* exec, ScopeChain&scope) const36 ScopeChainNode* JSHTMLElement::pushEventHandlerScope(ExecState* exec, ScopeChainNode* scope) const 37 37 { 38 38 HTMLElement* element = impl(); 39 39 40 40 // The document is put on first, fall back to searching it only after the element and form. 41 scope .push(asObject(toJS(exec, globalObject(), element->ownerDocument())));41 scope = scope->push(asObject(toJS(exec, globalObject(), element->ownerDocument()))); 42 42 43 43 // The form is next, searched before the document, but after the element itself. 44 44 if (HTMLFormElement* form = element->form()) 45 scope .push(asObject(toJS(exec, globalObject(), form)));45 scope = scope->push(asObject(toJS(exec, globalObject(), form))); 46 46 47 47 // The element is on top, searched first. 48 scope.push(asObject(toJS(exec, globalObject(), element)));48 return scope->push(asObject(toJS(exec, globalObject(), element))); 49 49 } 50 50 -
trunk/Source/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp
r77151 r79904 71 71 return jsNull(); 72 72 73 constScopeChainNode* scopeChain = impl()->scopeChain();73 ScopeChainNode* scopeChain = impl()->scopeChain(); 74 74 ScopeChainIterator iter = scopeChain->begin(); 75 75 ScopeChainIterator end = scopeChain->end(); … … 96 96 int index = exec->argument(0).asInt32(); 97 97 98 constScopeChainNode* scopeChain = impl()->scopeChain();98 ScopeChainNode* scopeChain = impl()->scopeChain(); 99 99 ScopeChainIterator end = scopeChain->end(); 100 100 101 101 bool foundLocalScope = false; 102 102 for (ScopeChainIterator iter = scopeChain->begin(); iter != end; ++iter) { 103 JS C::DeprecatedPtr<JSObject> scope = *iter;103 JSObject* scope = iter->get(); 104 104 if (scope->isActivationObject()) { 105 105 if (!foundLocalScope) { -
trunk/Source/WebCore/bindings/js/JSLazyEventListener.cpp
r78634 r79904 121 121 // Add the event's home element to the scope 122 122 // (and the document, and the form - see JSHTMLElement::eventHandlerScope) 123 ScopeChain scope = listenerAsFunction->scope(); 124 static_cast<JSNode*>(wrapper())->pushEventHandlerScope(exec, scope); 125 listenerAsFunction->setScope(scope); 123 listenerAsFunction->setScope(exec->globalData(), static_cast<JSNode*>(wrapper())->pushEventHandlerScope(exec, listenerAsFunction->scope())); 126 124 } 127 125 -
trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h
r76248 r79904 49 49 }; 50 50 51 static JSC::Completion evaluate(JSC::ExecState* exec, JSC::ScopeChain &chain, const JSC::SourceCode& source, JSC::JSValue thisValue)51 static JSC::Completion evaluate(JSC::ExecState* exec, JSC::ScopeChainNode* chain, const JSC::SourceCode& source, JSC::JSValue thisValue) 52 52 { 53 53 JSMainThreadExecState currentState(exec); -
trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp
r78150 r79904 113 113 } 114 114 115 void JSNode::pushEventHandlerScope(ExecState*, ScopeChain&) const 116 { 115 ScopeChainNode* JSNode::pushEventHandlerScope(ExecState*, ScopeChainNode* node) const 116 { 117 return node; 117 118 } 118 119 -
trunk/Source/WebCore/bindings/js/JavaScriptCallFrame.cpp
r78482 r79904 57 57 } 58 58 59 constJSC::ScopeChainNode* JavaScriptCallFrame::scopeChain() const59 JSC::ScopeChainNode* JavaScriptCallFrame::scopeChain() const 60 60 { 61 61 ASSERT(m_isValid); -
trunk/Source/WebCore/bindings/js/JavaScriptCallFrame.h
r78482 r79904 70 70 String functionName() const; 71 71 JSC::DebuggerCallFrame::Type type() const; 72 constJSC::ScopeChainNode* scopeChain() const;72 JSC::ScopeChainNode* scopeChain() const; 73 73 JSC::JSGlobalObject* dynamicGlobalObject() const; 74 74 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r79675 r79904 759 759 760 760 # Custom pushEventHandlerScope function 761 push(@headerContent, " virtual void pushEventHandlerScope(JSC::ExecState*, JSC::ScopeChain&) const;\n\n") if $dataNode->extendedAttributes->{"CustomPushEventHandlerScope"};761 push(@headerContent, " virtual JSC::ScopeChainNode* pushEventHandlerScope(JSC::ExecState*, JSC::ScopeChainNode*) const;\n\n") if $dataNode->extendedAttributes->{"CustomPushEventHandlerScope"}; 762 762 763 763 # Custom call functions -
trunk/Source/WebCore/bridge/c/c_class.cpp
r65344 r79904 33 33 #include "c_runtime.h" 34 34 #include "npruntime_impl.h" 35 #include <runtime/ScopeChain.h> 35 36 #include <runtime/Identifier.h> 36 37 #include <runtime/JSLock.h> -
trunk/Source/WebCore/bridge/c/c_runtime.cpp
r54516 r79904 33 33 #include "c_utility.h" 34 34 #include "npruntime_impl.h" 35 #include <runtime/ScopeChain.h> 35 36 #include <runtime/JSLock.h> 36 37 -
trunk/Source/WebCore/bridge/jni/JNIBridge.cpp
r69594 r79904 30 30 #if ENABLE(JAVA_BRIDGE) 31 31 32 #include <runtime/ScopeChain.h> 32 33 #include <wtf/text/CString.h> 33 34 #include <wtf/text/StringBuilder.h> -
trunk/Source/WebCore/bridge/qt/qt_runtime.cpp
r79132 r79904 1827 1827 } 1828 1828 // Stuff in the __qt_sender property, if we can 1829 ScopeChain oldsc = ScopeChain(NoScopeChain());1829 ScopeChainNode* oldsc = 0; 1830 1830 JSFunction* fimp = 0; 1831 1831 if (m_funcObject->inherits(&JSFunction::s_info)) { … … 1837 1837 wrapper->put(exec, Identifier(exec, "__qt_sender__"), qt_sender, slot); 1838 1838 oldsc = fimp->scope(); 1839 ScopeChain sc = oldsc; 1840 sc.push(wrapper); 1841 fimp->setScope(sc); 1839 fimp->setScope(oldsc->push(wrapper)); 1842 1840 } 1843 1841 -
trunk/Source/WebCore/plugins/PluginViewNone.cpp
r66569 r79904 29 29 #if USE(JSC) 30 30 #include "Bridge.h" 31 #include <runtime/ScopeChain.h> 31 32 #endif 32 33 -
trunk/Source/WebKit/mac/ChangeLog
r79793 r79904 1 2011-02-28 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Gavin Barraclough. 4 5 Make ScopeChainNode GC allocated 6 https://bugs.webkit.org/show_bug.cgi?id=55283 7 8 More updates for the absence of the ScopeChain class 9 10 * WebView/WebScriptDebugDelegate.mm: 11 (-[WebScriptCallFrame scopeChain]): 12 1 13 2011-02-26 Vsevolod Vlasov <vsevik@chromium.org> 2 14 -
trunk/Source/WebKit/mac/WebView/WebScriptDebugDelegate.mm
r77151 r79904 177 177 JSLock lock(SilenceAssertionsOnly); 178 178 179 constScopeChainNode* scopeChain = _private->debuggerCallFrame->scopeChain();179 ScopeChainNode* scopeChain = _private->debuggerCallFrame->scopeChain(); 180 180 if (!scopeChain->next) // global frame 181 181 return [NSArray arrayWithObject:_private->globalObject];
Note: See TracChangeset
for help on using the changeset viewer.