summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/Executable.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-11-07 11:22:47 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-11-07 11:22:47 +0100
commitcfd86b747d32ac22246a1aa908eaa720c63a88c1 (patch)
tree24d68c6f61c464ecba1e05670b80390ea3b0e50c /Source/JavaScriptCore/runtime/Executable.h
parent69d7c744c9de19d152dbe2d8e46eb7dfd4511d1a (diff)
downloadqtwebkit-cfd86b747d32ac22246a1aa908eaa720c63a88c1.tar.gz
Imported WebKit commit 20271caf2e2c016d5cef40184cddeefeac4f1876 (http://svn.webkit.org/repository/webkit/trunk@133733)
New snapshot that contains all previous fixes as well as build fix for latest QtMultimedia API changes.
Diffstat (limited to 'Source/JavaScriptCore/runtime/Executable.h')
-rw-r--r--Source/JavaScriptCore/runtime/Executable.h68
1 files changed, 36 insertions, 32 deletions
diff --git a/Source/JavaScriptCore/runtime/Executable.h b/Source/JavaScriptCore/runtime/Executable.h
index 76a537da3..74b4add75 100644
--- a/Source/JavaScriptCore/runtime/Executable.h
+++ b/Source/JavaScriptCore/runtime/Executable.h
@@ -35,6 +35,7 @@
#include "LLIntCLoop.h"
#include "Nodes.h"
#include "SamplingTool.h"
+#include "UnlinkedCodeBlock.h"
#include <wtf/PassOwnPtr.h>
namespace JSC {
@@ -364,9 +365,19 @@ namespace JSC {
bool isStrictMode() const { return m_features & StrictModeFeature; }
void unlinkCalls();
+
+ CodeFeatures features() const { return m_features; }
static const ClassInfo s_info;
+ void recordParse(CodeFeatures features, bool hasCapturedVariables, int firstLine, int lastLine)
+ {
+ m_features = features;
+ m_hasCapturedVariables = hasCapturedVariables;
+ m_firstLine = firstLine;
+ m_lastLine = lastLine;
+ }
+
protected:
void finishCreation(JSGlobalData& globalData)
{
@@ -379,14 +390,6 @@ namespace JSC {
#endif
}
- void recordParse(CodeFeatures features, bool hasCapturedVariables, int firstLine, int lastLine)
- {
- m_features = features;
- m_hasCapturedVariables = hasCapturedVariables;
- m_firstLine = firstLine;
- m_lastLine = lastLine;
- }
-
SourceCode m_source;
CodeFeatures m_features;
bool m_hasCapturedVariables;
@@ -448,6 +451,8 @@ namespace JSC {
void clearCode();
+ ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false); }
+
private:
static const unsigned StructureFlags = OverridesVisitChildren | ScriptExecutable::StructureFlags;
EvalExecutable(ExecState*, const SourceCode&, bool);
@@ -456,6 +461,7 @@ namespace JSC {
static void visitChildren(JSCell*, SlotVisitor&);
OwnPtr<EvalCodeBlock> m_evalCodeBlock;
+ WriteBarrier<UnlinkedEvalCodeBlock> m_unlinkedEvalCodeBlock;
};
class ProgramExecutable : public ScriptExecutable {
@@ -470,6 +476,9 @@ namespace JSC {
return executable;
}
+
+ JSObject* initalizeGlobalProperties(JSGlobalData&, CallFrame*, JSScope*);
+
static void destroy(JSCell*);
JSObject* compile(ExecState* exec, JSScope* scope)
@@ -515,13 +524,21 @@ namespace JSC {
void clearCode();
+ ExecutableInfo executableInfo() const { return ExecutableInfo(needsActivation(), usesEval(), isStrictMode(), false); }
+
private:
static const unsigned StructureFlags = OverridesVisitChildren | ScriptExecutable::StructureFlags;
+
ProgramExecutable(ExecState*, const SourceCode&);
+ enum ConstantMode { IsConstant, IsVariable };
+ enum FunctionMode { IsFunctionToSpecialize, NotFunctionOrNotSpecializable };
+ int addGlobalVar(JSGlobalObject*, const Identifier&, ConstantMode, FunctionMode);
+
JSObject* compileInternal(ExecState*, JSScope*, JITCode::JITType, unsigned bytecodeIndex = UINT_MAX);
static void visitChildren(JSCell*, SlotVisitor&);
+ WriteBarrier<UnlinkedProgramCodeBlock> m_unlinkedProgramCodeBlock;
OwnPtr<ProgramCodeBlock> m_programCodeBlock;
};
@@ -531,9 +548,9 @@ namespace JSC {
public:
typedef ScriptExecutable Base;
- static FunctionExecutable* create(JSGlobalData& globalData, FunctionBodyNode* node)
+ static FunctionExecutable* create(JSGlobalData& globalData, const SourceCode& source, UnlinkedFunctionExecutable* unlinkedExecutable, unsigned firstLine, unsigned lastLine)
{
- FunctionExecutable* executable = new (NotNull, allocateCell<FunctionExecutable>(globalData.heap)) FunctionExecutable(globalData, node);
+ FunctionExecutable* executable = new (NotNull, allocateCell<FunctionExecutable>(globalData.heap)) FunctionExecutable(globalData, source, unlinkedExecutable, firstLine, lastLine);
executable->finishCreation(globalData);
return executable;
}
@@ -554,7 +571,7 @@ namespace JSC {
FunctionCodeBlock* codeBlockWithBytecodeFor(CodeSpecializationKind);
- PassOwnPtr<FunctionCodeBlock> produceCodeBlockFor(JSScope*, CompilationKind, CodeSpecializationKind, JSObject*& exception);
+ PassOwnPtr<FunctionCodeBlock> produceCodeBlockFor(JSScope*, CodeSpecializationKind, JSObject*& exception);
JSObject* compileForCall(ExecState* exec, JSScope* scope)
{
@@ -679,14 +696,15 @@ namespace JSC {
return baselineCodeBlockFor(kind);
}
- const Identifier& name() { return m_name; }
- const Identifier& inferredName() { return m_inferredName; }
- JSString* nameValue() const { return m_nameValue.get(); }
- size_t parameterCount() const { return m_parameters->size(); } // Excluding 'this'!
+ const Identifier& name() { return m_unlinkedExecutable->name(); }
+ const Identifier& inferredName() { return m_unlinkedExecutable->inferredName(); }
+ JSString* nameValue() const { return m_unlinkedExecutable->nameValue(); }
+ size_t parameterCount() const { return m_unlinkedExecutable->parameterCount(); } // Excluding 'this'!
String paramString() const;
- SharedSymbolTable* symbolTable() const { return m_symbolTable.get(); }
+ SharedSymbolTable* symbolTable(CodeSpecializationKind kind) const { return m_unlinkedExecutable->symbolTable(kind); }
void clearCodeIfNotCompiling();
+ void clearUnlinkedCodeIfNotCompiling();
static void visitChildren(JSCell*, SlotVisitor&);
static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto)
{
@@ -699,15 +717,8 @@ namespace JSC {
void clearCode();
- protected:
- void finishCreation(JSGlobalData& globalData)
- {
- Base::finishCreation(globalData);
- m_nameValue.set(globalData, this, jsString(&globalData, name().string()));
- }
-
private:
- FunctionExecutable(JSGlobalData&, FunctionBodyNode*);
+ FunctionExecutable(JSGlobalData&, const SourceCode&, UnlinkedFunctionExecutable*, unsigned firstLine, unsigned lastLine);
JSObject* compileForCallInternal(ExecState*, JSScope*, JITCode::JITType, unsigned bytecodeIndex = UINT_MAX);
JSObject* compileForConstructInternal(ExecState*, JSScope*, JITCode::JITType, unsigned bytecodeIndex = UINT_MAX);
@@ -732,16 +743,9 @@ namespace JSC {
}
static const unsigned StructureFlags = OverridesVisitChildren | ScriptExecutable::StructureFlags;
- bool m_forceUsesArguments;
-
- RefPtr<FunctionParameters> m_parameters;
+ WriteBarrier<UnlinkedFunctionExecutable> m_unlinkedExecutable;
OwnPtr<FunctionCodeBlock> m_codeBlockForCall;
OwnPtr<FunctionCodeBlock> m_codeBlockForConstruct;
- Identifier m_name;
- Identifier m_inferredName;
- FunctionNameIsInScopeToggle m_functionNameIsInScopeToggle;
- WriteBarrier<JSString> m_nameValue;
- WriteBarrier<SharedSymbolTable> m_symbolTable;
};
inline JSFunction::JSFunction(JSGlobalData& globalData, FunctionExecutable* executable, JSScope* scope)