+
+ RefPtr<TypeSet> returnStatementTypeSet()
+ {
+ if (!m_returnStatementTypeSet)
+ m_returnStatementTypeSet = TypeSet::create();
+
+ return m_returnStatementTypeSet;
+ }
+
+ FunctionMode functionMode() { return m_unlinkedExecutable->functionMode(); }
+ bool isBuiltinFunction() const { return m_unlinkedExecutable->isBuiltinFunction(); }
+ bool isClassConstructorFunction() const { return m_unlinkedExecutable->isClassConstructorFunction(); }
+ 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'!
+ SymbolTable* symbolTable(CodeSpecializationKind);
+
+ void clearUnlinkedCodeForRecompilation();
+ static void visitChildren(JSCell*, SlotVisitor&);
+ static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto)
+ {
+ return Structure::create(vm, globalObject, proto, TypeInfo(FunctionExecutableType, StructureFlags), info());
+ }
+
+ unsigned parametersStartOffset() const { return m_parametersStartOffset; }
+
+ void overrideParameterAndTypeProfilingStartEndOffsets(unsigned parametersStartOffset, unsigned typeProfilingStartOffset, unsigned typeProfilingEndOffset)
+ {
+ m_parametersStartOffset = parametersStartOffset;
+ m_typeProfilingStartOffset = typeProfilingStartOffset;
+ m_typeProfilingEndOffset = typeProfilingEndOffset;
+ }
+
+ DECLARE_INFO;
+
+ void unlinkCalls();
+
+ void clearCode();
+
+ InferredValue* singletonFunction() { return m_singletonFunction.get(); }
+
+private:
+ FunctionExecutable(
+ VM&, const SourceCode&, UnlinkedFunctionExecutable*, unsigned firstLine,
+ unsigned lastLine, unsigned startColumn, unsigned endColumn);
+
+ void finishCreation(VM&);
+
+ friend class ScriptExecutable;
+
+ WriteBarrier<UnlinkedFunctionExecutable> m_unlinkedExecutable;
+ RefPtr<FunctionCodeBlock> m_codeBlockForCall;
+ RefPtr<FunctionCodeBlock> m_codeBlockForConstruct;
+ RefPtr<TypeSet> m_returnStatementTypeSet;
+ unsigned m_parametersStartOffset;
+ WriteBarrier<InferredValue> m_singletonFunction;
+};
+
+inline void ExecutableBase::clearCodeVirtual(ExecutableBase* executable)
+{
+ switch (executable->type()) {
+ case EvalExecutableType:
+ return jsCast<EvalExecutable*>(executable)->clearCode();
+ case ProgramExecutableType:
+ return jsCast<ProgramExecutable*>(executable)->clearCode();
+ case FunctionExecutableType:
+ return jsCast<FunctionExecutable*>(executable)->clearCode();
+ default:
+ return jsCast<NativeExecutable*>(executable)->clearCode();
+ }
+}
+
+inline void ScriptExecutable::unlinkCalls()
+{
+ switch (type()) {
+ case EvalExecutableType:
+ return jsCast<EvalExecutable*>(this)->unlinkCalls();
+ case ProgramExecutableType:
+ return jsCast<ProgramExecutable*>(this)->unlinkCalls();
+ case FunctionExecutableType:
+ return jsCast<FunctionExecutable*>(this)->unlinkCalls();
+ default:
+ RELEASE_ASSERT_NOT_REACHED();
+ }
+}
+