26 InitializeAstVisitor(zone);
58 VariableProxy* result_proxy =
factory()->NewVariableProxy(
result_);
59 return factory()->NewAssignment(
64 #define DEF_VISIT(type) \
65 virtual void Visit##type(type* node);
76 for (
int i = statements->length() - 1;
i >= 0; --
i) {
77 Visit(statements->
at(
i));
82 void Processor::VisitBlock(Block* node) {
91 if (!node->is_initializer_block())
Process(node->statements());
95 void Processor::VisitModuleStatement(ModuleStatement* node) {
102 void Processor::VisitExpressionStatement(ExpressionStatement* node) {
104 if (!
is_set_ && !node->expression()->IsThrow()) {
105 node->set_expression(
SetResult(node->expression()));
111 void Processor::VisitIfStatement(IfStatement* node) {
114 Visit(node->else_statement());
117 Visit(node->then_statement());
130 void Processor::VisitDoWhileStatement(DoWhileStatement* node) {
135 void Processor::VisitWhileStatement(WhileStatement* node) {
140 void Processor::VisitForStatement(ForStatement* node) {
145 void Processor::VisitForInStatement(ForInStatement* node) {
150 void Processor::VisitForOfStatement(ForOfStatement* node) {
155 void Processor::VisitTryCatchStatement(TryCatchStatement* node) {
157 bool set_after_catch =
is_set_;
158 Visit(node->catch_block());
162 Visit(node->try_block());
167 void Processor::VisitTryFinallyStatement(TryFinallyStatement* node) {
169 Visit(node->finally_block());
172 Visit(node->try_block());
177 void Processor::VisitSwitchStatement(SwitchStatement* node) {
179 ZoneList<CaseClause*>* clauses = node->cases();
180 bool set_after_switch =
is_set_;
181 for (
int i = clauses->length() - 1;
i >= 0; --
i) {
182 CaseClause* clause = clauses->at(
i);
189 void Processor::VisitContinueStatement(ContinueStatement* node) {
194 void Processor::VisitBreakStatement(BreakStatement* node) {
199 void Processor::VisitWithStatement(WithStatement* node) {
201 Visit(node->statement());
207 void Processor::VisitVariableDeclaration(VariableDeclaration* node) {}
208 void Processor::VisitFunctionDeclaration(FunctionDeclaration* node) {}
209 void Processor::VisitModuleDeclaration(ModuleDeclaration* node) {}
210 void Processor::VisitImportDeclaration(ImportDeclaration* node) {}
211 void Processor::VisitExportDeclaration(ExportDeclaration* node) {}
212 void Processor::VisitModuleLiteral(ModuleLiteral* node) {}
213 void Processor::VisitModuleVariable(ModuleVariable* node) {}
214 void Processor::VisitModulePath(ModulePath* node) {}
215 void Processor::VisitModuleUrl(ModuleUrl* node) {}
216 void Processor::VisitEmptyStatement(EmptyStatement* node) {}
217 void Processor::VisitReturnStatement(ReturnStatement* node) {}
218 void Processor::VisitDebuggerStatement(DebuggerStatement* node) {}
222 #define DEF_VISIT(type) \
223 void Processor::Visit##type(type* expr) { UNREACHABLE(); }
231 FunctionLiteral*
function = info->
function();
233 Scope* scope =
function->scope();
238 if (!body->is_empty()) {
245 if (processor.HasStackOverflow())
return false;
255 int pos =
function->end_position();
256 VariableProxy* result_proxy = processor.
factory()->NewVariableProxy(
258 result_proxy->BindTo(result);
260 processor.
factory()->NewReturnStatement(result_proxy, pos);
261 body->
Add(result_statement, info->
zone());
#define EXPRESSION_NODE_LIST(V)
AstNode::IdGen * ast_node_id_gen()
AstValueFactory * ast_value_factory() const
FunctionLiteral * function() const
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
DEFINE_AST_VISITOR_SUBCLASS_MEMBERS()
Expression * SetResult(Expression *value)
Processor(Variable *result, Zone *zone, AstNode::IdGen *ast_node_id_gen)
void Process(ZoneList< Statement * > *statements)
void VisitIterationStatement(IterationStatement *stmt)
AstNodeFactory< AstNullVisitor > * factory()
bool result_assigned() const
AstNodeFactory< AstNullVisitor > factory_
static const int kNoPosition
static bool Rewrite(CompilationInfo *info)
bool is_global_scope() const
bool is_eval_scope() const
Variable * NewTemporary(const AstRawString *name)
Handle< String > name() const
Interface * interface() const
const AstRawString * raw_name() const
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DCHECK(condition)
Debugger support for the V8 JavaScript engine.