Qt 4.8
Public Functions | Static Public Functions | Public Variables | List of all members
QScriptProgramPrivate Class Reference

#include <qscriptprogram_p.h>

Public Functions

void detachFromEngine ()
 
JSC::EvalExecutable * executable (JSC::ExecState *exec, QScriptEnginePrivate *engine)
 
 QScriptProgramPrivate (const QString &sourceCode, const QString &fileName, int firstLineNumber)
 
 ~QScriptProgramPrivate ()
 

Static Public Functions

static QScriptProgramPrivateget (const QScriptProgram &q)
 

Public Variables

WTF::RefPtr< JSC::EvalExecutable > _executable
 
QScriptEnginePrivateengine
 
QString fileName
 
int firstLineNumber
 
bool isCompiled
 
QBasicAtomicInt ref
 
QString sourceCode
 
intptr_t sourceId
 

Detailed Description

Definition at line 52 of file qscriptprogram_p.h.

Constructors and Destructors

◆ QScriptProgramPrivate()

QScriptProgramPrivate::QScriptProgramPrivate ( const QString sourceCode,
const QString fileName,
int  firstLineNumber 
)

Definition at line 57 of file qscriptprogram.cpp.

60  : sourceCode(src), fileName(fn), firstLineNumber(ln),
61  engine(0), _executable(0), sourceId(-1), isCompiled(false)
62 {
63  ref = 0;
64 }
WTF::RefPtr< JSC::EvalExecutable > _executable
QScriptEnginePrivate * engine

◆ ~QScriptProgramPrivate()

QScriptProgramPrivate::~QScriptProgramPrivate ( )

Definition at line 66 of file qscriptprogram.cpp.

67 {
68  if (engine) {
70  _executable.clear();
72  }
73 }
WTF::RefPtr< JSC::EvalExecutable > _executable
void unregisterScriptProgram(QScriptProgramPrivate *program)
QScriptEnginePrivate * engine

Functions

◆ detachFromEngine()

void QScriptProgramPrivate::detachFromEngine ( )

Definition at line 102 of file qscriptprogram.cpp.

103 {
104  _executable.clear();
105  sourceId = -1;
106  isCompiled = false;
107  engine = 0;
108 }
WTF::RefPtr< JSC::EvalExecutable > _executable
QScriptEnginePrivate * engine

◆ executable()

JSC::EvalExecutable * QScriptProgramPrivate::executable ( JSC::ExecState *  exec,
QScriptEnginePrivate engine 
)

Definition at line 80 of file qscriptprogram.cpp.

Referenced by QScriptEngine::evaluate().

82 {
83  if (_executable) {
84  if (eng == engine)
85  return _executable.get();
86  // "Migrating" to another engine; clean up old state
87  QScript::APIShim shim(engine);
88  _executable.clear();
89  engine->unregisterScriptProgram(this);
90  }
91  WTF::PassRefPtr<QScript::UStringSourceProviderWithFeedback> provider
93  sourceId = provider->asID();
94  JSC::SourceCode source(provider, firstLineNumber); //after construction of SourceCode provider variable will be null.
96  engine = eng;
97  engine->registerScriptProgram(this);
98  isCompiled = false;
99  return _executable.get();
100 }
WTF::RefPtr< JSC::EvalExecutable > _executable
static Expression::Ptr create(Expression *const expr, const YYLTYPE &sourceLocator, const ParserContext *const parseInfo)
static PassRefPtr< UStringSourceProviderWithFeedback > create(const JSC::UString &source, const JSC::UString &url, int lineNumber, QScriptEnginePrivate *engine)
void registerScriptProgram(QScriptProgramPrivate *program)
void unregisterScriptProgram(QScriptProgramPrivate *program)

◆ get()

QScriptProgramPrivate * QScriptProgramPrivate::get ( const QScriptProgram q)
static

Definition at line 75 of file qscriptprogram.cpp.

Referenced by QScriptEngine::evaluate().

76 {
77  return const_cast<QScriptProgramPrivate*>(q.d_func());
78 }

Properties

◆ _executable

WTF::RefPtr<JSC::EvalExecutable> QScriptProgramPrivate::_executable

Definition at line 73 of file qscriptprogram_p.h.

Referenced by detachFromEngine(), executable(), and ~QScriptProgramPrivate().

◆ engine

QScriptEnginePrivate* QScriptProgramPrivate::engine

Definition at line 72 of file qscriptprogram_p.h.

Referenced by detachFromEngine(), executable(), and ~QScriptProgramPrivate().

◆ fileName

QString QScriptProgramPrivate::fileName

Definition at line 69 of file qscriptprogram_p.h.

Referenced by executable().

◆ firstLineNumber

int QScriptProgramPrivate::firstLineNumber

Definition at line 70 of file qscriptprogram_p.h.

Referenced by executable().

◆ isCompiled

bool QScriptProgramPrivate::isCompiled

Definition at line 75 of file qscriptprogram_p.h.

Referenced by detachFromEngine(), QScriptEngine::evaluate(), and executable().

◆ ref

QBasicAtomicInt QScriptProgramPrivate::ref

Definition at line 66 of file qscriptprogram_p.h.

Referenced by QScriptProgramPrivate().

◆ sourceCode

QString QScriptProgramPrivate::sourceCode

Definition at line 68 of file qscriptprogram_p.h.

Referenced by executable().

◆ sourceId

intptr_t QScriptProgramPrivate::sourceId

Definition at line 74 of file qscriptprogram_p.h.

Referenced by detachFromEngine(), QScriptEngine::evaluate(), and executable().


The documentation for this class was generated from the following files: