Changeset 127202 in webkit for trunk/Source/JavaScriptCore/runtime/Executable.cpp
- Timestamp:
- Aug 30, 2012, 3:50:00 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/Executable.cpp
r127191 r127202 159 159 } 160 160 161 JSObject* EvalExecutable::compileOptimized(ExecState* exec, ScopeChainNode* scopeChainNode, unsigned bytecodeIndex)161 JSObject* EvalExecutable::compileOptimized(ExecState* exec, JSScope* scope, unsigned bytecodeIndex) 162 162 { 163 163 ASSERT(exec->globalData().dynamicGlobalObject); … … 165 165 JSObject* error = 0; 166 166 if (m_evalCodeBlock->getJITType() != JITCode::topTierJIT()) 167 error = compileInternal(exec, scope ChainNode, JITCode::nextTierJIT(m_evalCodeBlock->getJITType()), bytecodeIndex);167 error = compileInternal(exec, scope, JITCode::nextTierJIT(m_evalCodeBlock->getJITType()), bytecodeIndex); 168 168 ASSERT(!!m_evalCodeBlock); 169 169 return error; … … 192 192 } 193 193 194 JSObject* EvalExecutable::compileInternal(ExecState* exec, ScopeChainNode* scopeChainNode, JITCode::JITType jitType, unsigned bytecodeIndex)194 JSObject* EvalExecutable::compileInternal(ExecState* exec, JSScope* scope, JITCode::JITType jitType, unsigned bytecodeIndex) 195 195 { 196 196 SamplingRegion samplingRegion(samplingDescription(jitType)); … … 218 218 recordParse(evalNode->features(), evalNode->hasCapturedVariables(), evalNode->lineNo(), evalNode->lastLine()); 219 219 220 JSGlobalObject* globalObject = scope ChainNode->globalObject.get();220 JSGlobalObject* globalObject = scope->globalObject(); 221 221 222 222 OwnPtr<CodeBlock> previousCodeBlock = m_evalCodeBlock.release(); 223 223 ASSERT((jitType == JITCode::bottomTierJIT()) == !previousCodeBlock); 224 m_evalCodeBlock = adoptPtr(new EvalCodeBlock(this, globalObject, source().provider(), scope ChainNode->localDepth(), previousCodeBlock.release()));225 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(evalNode.get(), scope ChainNode, m_evalCodeBlock->symbolTable(), m_evalCodeBlock.get(), !!m_evalCodeBlock->alternative() ? OptimizingCompilation : FirstCompilation)));224 m_evalCodeBlock = adoptPtr(new EvalCodeBlock(this, globalObject, source().provider(), scope->localDepth(), previousCodeBlock.release())); 225 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(evalNode.get(), scope, m_evalCodeBlock->symbolTable(), m_evalCodeBlock.get(), !!m_evalCodeBlock->alternative() ? OptimizingCompilation : FirstCompilation))); 226 226 if ((exception = generator->generate())) { 227 227 m_evalCodeBlock = static_pointer_cast<EvalCodeBlock>(m_evalCodeBlock->releaseAlternative()); … … 301 301 } 302 302 303 JSObject* ProgramExecutable::compileOptimized(ExecState* exec, ScopeChainNode* scopeChainNode, unsigned bytecodeIndex)303 JSObject* ProgramExecutable::compileOptimized(ExecState* exec, JSScope* scope, unsigned bytecodeIndex) 304 304 { 305 305 ASSERT(exec->globalData().dynamicGlobalObject); … … 307 307 JSObject* error = 0; 308 308 if (m_programCodeBlock->getJITType() != JITCode::topTierJIT()) 309 error = compileInternal(exec, scope ChainNode, JITCode::nextTierJIT(m_programCodeBlock->getJITType()), bytecodeIndex);309 error = compileInternal(exec, scope, JITCode::nextTierJIT(m_programCodeBlock->getJITType()), bytecodeIndex); 310 310 ASSERT(!!m_programCodeBlock); 311 311 return error; … … 319 319 #endif 320 320 321 JSObject* ProgramExecutable::compileInternal(ExecState* exec, ScopeChainNode* scopeChainNode, JITCode::JITType jitType, unsigned bytecodeIndex)321 JSObject* ProgramExecutable::compileInternal(ExecState* exec, JSScope* scope, JITCode::JITType jitType, unsigned bytecodeIndex) 322 322 { 323 323 SamplingRegion samplingRegion(samplingDescription(jitType)); … … 343 343 recordParse(programNode->features(), programNode->hasCapturedVariables(), programNode->lineNo(), programNode->lastLine()); 344 344 345 JSGlobalObject* globalObject = scope ChainNode->globalObject.get();345 JSGlobalObject* globalObject = scope->globalObject(); 346 346 347 347 OwnPtr<CodeBlock> previousCodeBlock = m_programCodeBlock.release(); 348 348 ASSERT((jitType == JITCode::bottomTierJIT()) == !previousCodeBlock); 349 349 m_programCodeBlock = adoptPtr(new ProgramCodeBlock(this, GlobalCode, globalObject, source().provider(), previousCodeBlock.release())); 350 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(programNode.get(), scope ChainNode, globalObject->symbolTable(), m_programCodeBlock.get(), !!m_programCodeBlock->alternative() ? OptimizingCompilation : FirstCompilation)));350 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(programNode.get(), scope, globalObject->symbolTable(), m_programCodeBlock.get(), !!m_programCodeBlock->alternative() ? OptimizingCompilation : FirstCompilation))); 351 351 if ((exception = generator->generate())) { 352 352 m_programCodeBlock = static_pointer_cast<ProgramCodeBlock>(m_programCodeBlock->releaseAlternative()); … … 432 432 } 433 433 434 JSObject* FunctionExecutable::compileOptimizedForCall(ExecState* exec, ScopeChainNode* scopeChainNode, unsigned bytecodeIndex)434 JSObject* FunctionExecutable::compileOptimizedForCall(ExecState* exec, JSScope* scope, unsigned bytecodeIndex) 435 435 { 436 436 ASSERT(exec->globalData().dynamicGlobalObject); … … 438 438 JSObject* error = 0; 439 439 if (m_codeBlockForCall->getJITType() != JITCode::topTierJIT()) 440 error = compileForCallInternal(exec, scope ChainNode, JITCode::nextTierJIT(m_codeBlockForCall->getJITType()), bytecodeIndex);440 error = compileForCallInternal(exec, scope, JITCode::nextTierJIT(m_codeBlockForCall->getJITType()), bytecodeIndex); 441 441 ASSERT(!!m_codeBlockForCall); 442 442 return error; 443 443 } 444 444 445 JSObject* FunctionExecutable::compileOptimizedForConstruct(ExecState* exec, ScopeChainNode* scopeChainNode, unsigned bytecodeIndex)445 JSObject* FunctionExecutable::compileOptimizedForConstruct(ExecState* exec, JSScope* scope, unsigned bytecodeIndex) 446 446 { 447 447 ASSERT(exec->globalData().dynamicGlobalObject); … … 449 449 JSObject* error = 0; 450 450 if (m_codeBlockForConstruct->getJITType() != JITCode::topTierJIT()) 451 error = compileForConstructInternal(exec, scope ChainNode, JITCode::nextTierJIT(m_codeBlockForConstruct->getJITType()), bytecodeIndex);451 error = compileForConstructInternal(exec, scope, JITCode::nextTierJIT(m_codeBlockForConstruct->getJITType()), bytecodeIndex); 452 452 ASSERT(!!m_codeBlockForConstruct); 453 453 return error; … … 471 471 } 472 472 473 PassOwnPtr<FunctionCodeBlock> FunctionExecutable::produceCodeBlockFor( ScopeChainNode* scopeChainNode, CompilationKind compilationKind, CodeSpecializationKind specializationKind, JSObject*& exception)473 PassOwnPtr<FunctionCodeBlock> FunctionExecutable::produceCodeBlockFor(JSScope* scope, CompilationKind compilationKind, CodeSpecializationKind specializationKind, JSObject*& exception) 474 474 { 475 475 if (!!codeBlockFor(specializationKind)) … … 477 477 478 478 exception = 0; 479 JSGlobalData* globalData = scope ChainNode->globalData;480 JSGlobalObject* globalObject = scope ChainNode->globalObject.get();479 JSGlobalData* globalData = scope->globalData(); 480 JSGlobalObject* globalObject = scope->globalObject(); 481 481 RefPtr<FunctionBodyNode> body = parse<FunctionBodyNode>(globalData, globalObject, m_source, m_parameters.get(), isStrictMode() ? JSParseStrict : JSParseNormal, FunctionBodyNode::isFunctionNode ? JSParseFunctionCode : JSParseProgramCode, 0, 0, &exception); 482 482 … … 493 493 ASSERT((compilationKind == FirstCompilation) == !codeBlockFor(specializationKind)); 494 494 result = adoptPtr(new FunctionCodeBlock(this, FunctionCode, globalObject, source().provider(), source().startOffset(), specializationKind == CodeForConstruct)); 495 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(body.get(), scope ChainNode, result->symbolTable(), result.get(), compilationKind)));495 OwnPtr<BytecodeGenerator> generator(adoptPtr(new BytecodeGenerator(body.get(), scope, result->symbolTable(), result.get(), compilationKind))); 496 496 exception = generator->generate(); 497 497 body->destroyData(); … … 503 503 } 504 504 505 JSObject* FunctionExecutable::compileForCallInternal(ExecState* exec, ScopeChainNode* scopeChainNode, JITCode::JITType jitType, unsigned bytecodeIndex)505 JSObject* FunctionExecutable::compileForCallInternal(ExecState* exec, JSScope* scope, JITCode::JITType jitType, unsigned bytecodeIndex) 506 506 { 507 507 SamplingRegion samplingRegion(samplingDescription(jitType)); … … 515 515 ASSERT((jitType == JITCode::bottomTierJIT()) == !m_codeBlockForCall); 516 516 JSObject* exception; 517 OwnPtr<FunctionCodeBlock> newCodeBlock = produceCodeBlockFor(scope ChainNode, !!m_codeBlockForCall ? OptimizingCompilation : FirstCompilation, CodeForCall, exception);517 OwnPtr<FunctionCodeBlock> newCodeBlock = produceCodeBlockFor(scope, !!m_codeBlockForCall ? OptimizingCompilation : FirstCompilation, CodeForCall, exception); 518 518 if (!newCodeBlock) 519 519 return exception; … … 546 546 } 547 547 548 JSObject* FunctionExecutable::compileForConstructInternal(ExecState* exec, ScopeChainNode* scopeChainNode, JITCode::JITType jitType, unsigned bytecodeIndex)548 JSObject* FunctionExecutable::compileForConstructInternal(ExecState* exec, JSScope* scope, JITCode::JITType jitType, unsigned bytecodeIndex) 549 549 { 550 550 SamplingRegion samplingRegion(samplingDescription(jitType)); … … 558 558 ASSERT((jitType == JITCode::bottomTierJIT()) == !m_codeBlockForConstruct); 559 559 JSObject* exception; 560 OwnPtr<FunctionCodeBlock> newCodeBlock = produceCodeBlockFor(scope ChainNode, !!m_codeBlockForConstruct ? OptimizingCompilation : FirstCompilation, CodeForConstruct, exception);560 OwnPtr<FunctionCodeBlock> newCodeBlock = produceCodeBlockFor(scope, !!m_codeBlockForConstruct ? OptimizingCompilation : FirstCompilation, CodeForConstruct, exception); 561 561 if (!newCodeBlock) 562 562 return exception;
Note:
See TracChangeset
for help on using the changeset viewer.