ProgramExecutable::ProgramExecutable(ExecState* exec, const SourceCode& source) : ScriptExecutable(exec->vm().programExecutableStructure.get(), exec->vm(), source, false) { m_typeProfilingStartOffset = 0; m_typeProfilingEndOffset = source.length() - 1; if (exec->vm().typeProfiler() || exec->vm().controlFlowProfiler()) exec->vm().functionHasExecutedCache()->insertUnexecutedRange(sourceID(), m_typeProfilingStartOffset, m_typeProfilingEndOffset); }
ModuleProgramExecutable::ModuleProgramExecutable(ExecState* exec, const SourceCode& source) : ScriptExecutable(exec->vm().moduleProgramExecutableStructure.get(), exec->vm(), source, false, DerivedContextType::None, false, EvalContextType::None, NoIntrinsic) { m_typeProfilingStartOffset = 0; m_typeProfilingEndOffset = source.length() - 1; if (exec->vm().typeProfiler() || exec->vm().controlFlowProfiler()) exec->vm().functionHasExecutedCache()->insertUnexecutedRange(sourceID(), m_typeProfilingStartOffset, m_typeProfilingEndOffset); }
FunctionExecutable::FunctionExecutable(JSGlobalData& globalData, const SourceCode& source, UnlinkedFunctionExecutable* unlinkedExecutable, unsigned firstLine, unsigned lastLine) : ScriptExecutable(globalData.functionExecutableStructure.get(), globalData, source, unlinkedExecutable->isInStrictContext()) , m_unlinkedExecutable(globalData, this, unlinkedExecutable) { ASSERT(!source.isNull()); ASSERT(source.length()); m_firstLine = firstLine; m_lastLine = lastLine; }
FunctionExecutable::FunctionExecutable(VM& vm, const SourceCode& source, UnlinkedFunctionExecutable* unlinkedExecutable, unsigned firstLine, unsigned lastLine) : ScriptExecutable(vm.functionExecutableStructure.get(), vm, source, unlinkedExecutable->isInStrictContext()) , m_unlinkedExecutable(vm, this, unlinkedExecutable) { RELEASE_ASSERT(!source.isNull()); ASSERT(source.length()); m_firstLine = firstLine; m_lastLine = lastLine; }
FunctionExecutable::FunctionExecutable(VM& vm, const SourceCode& source, UnlinkedFunctionExecutable* unlinkedExecutable, unsigned firstLine, unsigned lastLine, unsigned startColumn, unsigned endColumn, bool bodyIncludesBraces) : ScriptExecutable(vm.functionExecutableStructure.get(), vm, source, unlinkedExecutable->isInStrictContext()) , m_unlinkedExecutable(vm, this, unlinkedExecutable) , m_bodyIncludesBraces(bodyIncludesBraces) { RELEASE_ASSERT(!source.isNull()); ASSERT(source.length()); m_firstLine = firstLine; m_lastLine = lastLine; ASSERT(startColumn != UINT_MAX); ASSERT(endColumn != UINT_MAX); m_startColumn = startColumn; m_endColumn = endColumn; }
FunctionExecutable::FunctionExecutable(VM& vm, const SourceCode& source, UnlinkedFunctionExecutable* unlinkedExecutable, unsigned firstLine, unsigned lastLine, unsigned startColumn, unsigned endColumn, Intrinsic intrinsic) : ScriptExecutable(vm.functionExecutableStructure.get(), vm, source, unlinkedExecutable->isInStrictContext(), unlinkedExecutable->derivedContextType(), false, EvalContextType::None, intrinsic) , m_unlinkedExecutable(vm, this, unlinkedExecutable) { RELEASE_ASSERT(!source.isNull()); ASSERT(source.length()); m_firstLine = firstLine; m_lastLine = lastLine; ASSERT(startColumn != UINT_MAX); ASSERT(endColumn != UINT_MAX); m_startColumn = startColumn; m_endColumn = endColumn; m_parametersStartOffset = unlinkedExecutable->parametersStartOffset(); m_typeProfilingStartOffset = unlinkedExecutable->typeProfilingStartOffset(); m_typeProfilingEndOffset = unlinkedExecutable->typeProfilingEndOffset(); }
void WebDebugListenerImpl::sourceParsed(ExecState* execState, const SourceCode& source, int errorLine, const UString& errorMsg) { if (m_listener && !m_inDebug) { m_inDebug = true; WebCore::String coreSourceURL = WebCore::ustringToString(source.provider()->url()); WebCore::Frame *frame = static_cast<WebCore::JSDOMWindow*>(execState->lexicalGlobalObject())->impl()->frame(); if (!(coreSourceURL.isNull() || coreSourceURL.isEmpty())) { WebCore::KURL sourceURL(WebCore::ParsedURLString, coreSourceURL); WebCore::KURL mappedURL; if(WebCore::FrameLoaderClientApollo::mapFrameUrl(frame, sourceURL, &mappedURL)) { coreSourceURL = mappedURL.string(); } } WebCore::String coreErrorMsg = WebCore::ustringToString(errorMsg); WebCore::String coreSource(source.data(), source.length()); m_listener->m_pVTable->sourceParsed(m_listener, source.provider()->asID(), coreSourceURL.webString(), coreSource.webString(), source.firstLine(), errorLine, coreErrorMsg.webString()); m_inDebug = false; } }