v8  3.11.10(node0.8.26)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FunctionLiteral Class Reference

#include <ast.h>

Inheritance diagram for FunctionLiteral:
Collaboration diagram for FunctionLiteral:

Public Types

enum  Type { ANONYMOUS_EXPRESSION, NAMED_EXPRESSION, DECLARATION }
 
enum  ParameterFlag { kNoDuplicateParameters = 0, kHasDuplicateParameters = 1 }
 
enum  IsFunctionFlag { kGlobalOrEval, kIsFunction }
 
- Public Types inherited from Expression
enum  Context { kUninitialized, kEffect, kValue, kTest }
 
- Public Types inherited from AstNode
enum  Type { kInvalid = -1 }
 

Public Member Functions

Handle< Stringname () const
 
Scopescope () const
 
ZoneList< Statement * > * body () const
 
void set_function_token_position (int pos)
 
int function_token_position () const
 
int start_position () const
 
int end_position () const
 
int SourceSize () const
 
bool is_expression () const
 
bool is_anonymous () const
 
bool is_classic_mode () const
 
LanguageMode language_mode () const
 
int materialized_literal_count ()
 
int expected_property_count ()
 
int handler_count ()
 
bool has_only_simple_this_property_assignments ()
 
Handle< FixedArraythis_property_assignments ()
 
int parameter_count ()
 
bool AllowsLazyCompilation ()
 
Handle< Stringdebug_name () const
 
Handle< Stringinferred_name () const
 
void set_inferred_name (Handle< String > inferred_name)
 
bool pretenure ()
 
void set_pretenure ()
 
bool has_duplicate_parameters ()
 
bool is_function ()
 
int ast_node_count ()
 
AstProperties::Flags * flags ()
 
void set_ast_properties (AstProperties *ast_properties)
 
- Public Member Functions inherited from Expression
virtual int position () const
 
virtual ExpressionAsExpression ()
 
virtual bool IsValidLeftHandSide ()
 
virtual bool ToBooleanIsTrue ()
 
virtual bool ToBooleanIsFalse ()
 
virtual bool IsPropertyName ()
 
virtual bool ResultOverwriteAllowed ()
 
bool IsSmiLiteral ()
 
bool IsStringLiteral ()
 
bool IsNullLiteral ()
 
virtual bool IsMonomorphic ()
 
virtual SmallMapListGetReceiverTypes ()
 
Handle< MapGetMonomorphicReceiverType ()
 
unsigned id () const
 
unsigned test_id () const
 
- Public Member Functions inherited from AstNode
void * operator new (size_t size, Zone *zone)
 
 AstNode ()
 
virtual ~AstNode ()
 
virtual void Accept (AstVisitor *v)=0
 
virtual Type node_type () const
 
virtual DeclarationAsDeclaration ()
 
virtual StatementAsStatement ()
 
virtual TargetCollectorAsTargetCollector ()
 
virtual BreakableStatementAsBreakableStatement ()
 
virtual IterationStatementAsIterationStatement ()
 
virtual MaterializedLiteralAsMaterializedLiteral ()
 
- Public Member Functions inherited from ZoneObject
 INLINE (void *operator new(size_t size, Zone *zone))
 
void operator delete (void *, size_t)
 
void operator delete (void *pointer, Zone *zone)
 

Protected Member Functions

 FunctionLiteral (Isolate *isolate, Handle< String > name, Scope *scope, ZoneList< Statement * > *body, int materialized_literal_count, int expected_property_count, int handler_count, bool has_only_simple_this_property_assignments, Handle< FixedArray > this_property_assignments, int parameter_count, Type type, ParameterFlag has_duplicate_parameters, IsFunctionFlag is_function)
 
- Protected Member Functions inherited from Expression
 Expression (Isolate *isolate)
 

Friends

template<class >
class AstNodeFactory
 

Additional Inherited Members

- Static Public Attributes inherited from AstNode
static const int kNoNumber = -1
 
static const int kFunctionEntryId = 2
 
static const int kDeclarationsId = 3
 
- Static Protected Member Functions inherited from AstNode
static int GetNextId (Isolate *isolate)
 
static int ReserveIdRange (Isolate *isolate, int n)
 

Detailed Description

Definition at line 2023 of file ast.h.

Member Enumeration Documentation

Enumerator
kGlobalOrEval 
kIsFunction 

Definition at line 2036 of file ast.h.

Enumerator
kNoDuplicateParameters 
kHasDuplicateParameters 

Definition at line 2031 of file ast.h.

enum Type
Enumerator
ANONYMOUS_EXPRESSION 
NAMED_EXPRESSION 
DECLARATION 

Definition at line 2025 of file ast.h.

Constructor & Destructor Documentation

FunctionLiteral ( Isolate isolate,
Handle< String name,
Scope scope,
ZoneList< Statement * > *  body,
int  materialized_literal_count,
int  expected_property_count,
int  handler_count,
bool  has_only_simple_this_property_assignments,
Handle< FixedArray this_property_assignments,
int  parameter_count,
Type  type,
ParameterFlag  has_duplicate_parameters,
IsFunctionFlag  is_function 
)
inlineprotected

Definition at line 2097 of file ast.h.

Member Function Documentation

bool AllowsLazyCompilation ( )
int ast_node_count ( )
inline

Definition at line 2088 of file ast.h.

Referenced by Compiler::CompileLazy(), and Compiler::SetFunctionInfo().

ZoneList<Statement*>* body ( ) const
inline

Definition at line 2045 of file ast.h.

Handle<String> debug_name ( ) const
inline

Definition at line 2069 of file ast.h.

References v8::internal::name_.

int end_position ( ) const

Definition at line 164 of file ast.cc.

References Scope::end_position(), and FunctionLiteral::scope().

Referenced by Compiler::SetFunctionInfo().

int expected_property_count ( )
inline

Definition at line 2057 of file ast.h.

Referenced by Compiler::BuildFunctionInfo(), and Compiler::CompileLazy().

AstProperties::Flags* flags ( )
inline

Definition at line 2089 of file ast.h.

Referenced by Compiler::CompileLazy(), and Compiler::SetFunctionInfo().

int function_token_position ( ) const
inline

Definition at line 2047 of file ast.h.

Referenced by Compiler::SetFunctionInfo().

int handler_count ( )
inline

Definition at line 2058 of file ast.h.

bool has_duplicate_parameters ( )
inline

Definition at line 2082 of file ast.h.

Referenced by Compiler::SetFunctionInfo().

bool has_only_simple_this_property_assignments ( )
inline

Definition at line 2059 of file ast.h.

Referenced by Compiler::CompileLazy(), and Compiler::SetFunctionInfo().

Handle<String> inferred_name ( ) const
inline

Definition at line 2074 of file ast.h.

Referenced by Compiler::SetFunctionInfo().

bool is_anonymous ( ) const
inline

Definition at line 2052 of file ast.h.

Referenced by Compiler::SetFunctionInfo().

bool is_classic_mode ( ) const
inline

Definition at line 2053 of file ast.h.

References v8::internal::CLASSIC_MODE.

bool is_expression ( ) const
inline

Definition at line 2051 of file ast.h.

Referenced by Compiler::SetFunctionInfo().

bool is_function ( )
inline

Definition at line 2086 of file ast.h.

Referenced by Compiler::SetFunctionInfo().

LanguageMode language_mode ( ) const

Definition at line 169 of file ast.cc.

References Scope::language_mode(), and FunctionLiteral::scope().

Referenced by Compiler::SetFunctionInfo().

int materialized_literal_count ( )
inline

Definition at line 2056 of file ast.h.

Referenced by Compiler::BuildFunctionInfo().

Handle<String> name ( ) const
inline
int parameter_count ( )
inline

Definition at line 2065 of file ast.h.

Referenced by Compiler::SetFunctionInfo().

bool pretenure ( )
inline

Definition at line 2079 of file ast.h.

void set_ast_properties ( AstProperties *  ast_properties)
inline

Definition at line 2090 of file ast.h.

void set_function_token_position ( int  pos)
inline

Definition at line 2046 of file ast.h.

void set_inferred_name ( Handle< String inferred_name)
inline

Definition at line 2075 of file ast.h.

void set_pretenure ( )
inline

Definition at line 2080 of file ast.h.

int SourceSize ( ) const
inline

Definition at line 2050 of file ast.h.

int start_position ( ) const

Definition at line 159 of file ast.cc.

References FunctionLiteral::scope(), and Scope::start_position().

Referenced by Compiler::SetFunctionInfo().

Handle<FixedArray> this_property_assignments ( )
inline

Definition at line 2062 of file ast.h.

Referenced by Compiler::CompileLazy(), and Compiler::SetFunctionInfo().

Friends And Related Function Documentation

friend class AstNodeFactory
friend

Definition at line 2095 of file ast.h.


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