1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "src/typing.h"
7 #include "src/frames.h"
8 #include "src/frames-inl.h"
9 #include "src/ostreams.h"
10 #include "src/parser.h" // for CompileTimeValue; TODO(rossberg): should move
11 #include "src/scopes.h"
17 AstTyper::AstTyper(CompilationInfo* info)
20 handle(info->closure()->shared()->code()),
21 handle(info->closure()->shared()->feedback_vector()),
22 handle(info->closure()->context()->native_context()),
24 store_(info->zone()) {
25 InitializeAstVisitor(info->zone());
29 #define RECURSE(call) \
31 DCHECK(!visitor->HasStackOverflow()); \
33 if (visitor->HasStackOverflow()) return; \
36 void AstTyper::Run(CompilationInfo* info) {
37 AstTyper* visitor = new(info->zone()) AstTyper(info);
38 Scope* scope = info->scope();
40 // Handle implicit declaration of the function name in named function
41 // expressions before other declarations.
42 if (scope->is_function_scope() && scope->function() != NULL) {
43 RECURSE(visitor->VisitVariableDeclaration(scope->function()));
45 RECURSE(visitor->VisitDeclarations(scope->declarations()));
46 RECURSE(visitor->VisitStatements(info->function()->body()));
53 static void PrintObserved(Variable* var, Object* value, Type* type) {
55 os << " observed " << (var->IsParameter() ? "param" : "local") << " ";
56 var->name()->Print(os);
57 os << " : " << Brief(value) << " -> ";
61 #endif // OBJECT_PRINT
64 Effect AstTyper::ObservedOnStack(Object* value) {
65 Type* lower = Type::NowOf(value, zone());
66 return Effect(Bounds(lower, Type::Any(zone())));
70 void AstTyper::ObserveTypesAtOsrEntry(IterationStatement* stmt) {
71 if (stmt->OsrEntryId() != info_->osr_ast_id()) return;
73 DisallowHeapAllocation no_gc;
74 JavaScriptFrameIterator it(isolate());
75 JavaScriptFrame* frame = it.frame();
76 Scope* scope = info_->scope();
78 // Assert that the frame on the stack belongs to the function we want to OSR.
79 DCHECK_EQ(*info_->closure(), frame->function());
81 int params = scope->num_parameters();
82 int locals = scope->StackLocalCount();
84 // Use sequential composition to achieve desired narrowing.
85 // The receiver is a parameter with index -1.
86 store_.Seq(parameter_index(-1), ObservedOnStack(frame->receiver()));
87 for (int i = 0; i < params; i++) {
88 store_.Seq(parameter_index(i), ObservedOnStack(frame->GetParameter(i)));
91 for (int i = 0; i < locals; i++) {
92 store_.Seq(stack_local_index(i), ObservedOnStack(frame->GetExpression(i)));
96 if (FLAG_trace_osr && FLAG_print_scopes) {
97 PrintObserved(scope->receiver(),
99 store_.LookupBounds(parameter_index(-1)).lower);
101 for (int i = 0; i < params; i++) {
102 PrintObserved(scope->parameter(i),
103 frame->GetParameter(i),
104 store_.LookupBounds(parameter_index(i)).lower);
107 ZoneList<Variable*> local_vars(locals, zone());
108 ZoneList<Variable*> context_vars(scope->ContextLocalCount(), zone());
109 scope->CollectStackAndContextLocals(&local_vars, &context_vars);
110 for (int i = 0; i < locals; i++) {
111 PrintObserved(local_vars.at(i),
112 frame->GetExpression(i),
113 store_.LookupBounds(stack_local_index(i)).lower);
116 #endif // OBJECT_PRINT
120 #define RECURSE(call) \
122 DCHECK(!HasStackOverflow()); \
124 if (HasStackOverflow()) return; \
128 void AstTyper::VisitStatements(ZoneList<Statement*>* stmts) {
129 for (int i = 0; i < stmts->length(); ++i) {
130 Statement* stmt = stmts->at(i);
131 RECURSE(Visit(stmt));
132 if (stmt->IsJump()) break;
137 void AstTyper::VisitBlock(Block* stmt) {
138 RECURSE(VisitStatements(stmt->statements()));
139 if (stmt->labels() != NULL) {
140 store_.Forget(); // Control may transfer here via 'break l'.
145 void AstTyper::VisitExpressionStatement(ExpressionStatement* stmt) {
146 RECURSE(Visit(stmt->expression()));
150 void AstTyper::VisitEmptyStatement(EmptyStatement* stmt) {
154 void AstTyper::VisitIfStatement(IfStatement* stmt) {
155 // Collect type feedback.
156 if (!stmt->condition()->ToBooleanIsTrue() &&
157 !stmt->condition()->ToBooleanIsFalse()) {
158 stmt->condition()->RecordToBooleanTypeFeedback(oracle());
161 RECURSE(Visit(stmt->condition()));
162 Effects then_effects = EnterEffects();
163 RECURSE(Visit(stmt->then_statement()));
165 Effects else_effects = EnterEffects();
166 RECURSE(Visit(stmt->else_statement()));
168 then_effects.Alt(else_effects);
169 store_.Seq(then_effects);
173 void AstTyper::VisitContinueStatement(ContinueStatement* stmt) {
174 // TODO(rossberg): is it worth having a non-termination effect?
178 void AstTyper::VisitBreakStatement(BreakStatement* stmt) {
179 // TODO(rossberg): is it worth having a non-termination effect?
183 void AstTyper::VisitReturnStatement(ReturnStatement* stmt) {
184 // Collect type feedback.
185 // TODO(rossberg): we only need this for inlining into test contexts...
186 stmt->expression()->RecordToBooleanTypeFeedback(oracle());
188 RECURSE(Visit(stmt->expression()));
189 // TODO(rossberg): is it worth having a non-termination effect?
193 void AstTyper::VisitWithStatement(WithStatement* stmt) {
194 RECURSE(stmt->expression());
195 RECURSE(stmt->statement());
199 void AstTyper::VisitSwitchStatement(SwitchStatement* stmt) {
200 RECURSE(Visit(stmt->tag()));
202 ZoneList<CaseClause*>* clauses = stmt->cases();
203 Effects local_effects(zone());
204 bool complex_effects = false; // True for label effects or fall-through.
206 for (int i = 0; i < clauses->length(); ++i) {
207 CaseClause* clause = clauses->at(i);
209 Effects clause_effects = EnterEffects();
211 if (!clause->is_default()) {
212 Expression* label = clause->label();
213 // Collect type feedback.
217 oracle()->CompareType(clause->CompareId(),
218 &tag_type, &label_type, &combined_type);
219 NarrowLowerType(stmt->tag(), tag_type);
220 NarrowLowerType(label, label_type);
221 clause->set_compare_type(combined_type);
223 RECURSE(Visit(label));
224 if (!clause_effects.IsEmpty()) complex_effects = true;
227 ZoneList<Statement*>* stmts = clause->statements();
228 RECURSE(VisitStatements(stmts));
230 if (stmts->is_empty() || stmts->last()->IsJump()) {
231 local_effects.Alt(clause_effects);
233 complex_effects = true;
237 if (complex_effects) {
238 store_.Forget(); // Reached this in unknown state.
240 store_.Seq(local_effects);
245 void AstTyper::VisitCaseClause(CaseClause* clause) {
250 void AstTyper::VisitDoWhileStatement(DoWhileStatement* stmt) {
251 // Collect type feedback.
252 if (!stmt->cond()->ToBooleanIsTrue()) {
253 stmt->cond()->RecordToBooleanTypeFeedback(oracle());
256 // TODO(rossberg): refine the unconditional Forget (here and elsewhere) by
257 // computing the set of variables assigned in only some of the origins of the
258 // control transfer (such as the loop body here).
259 store_.Forget(); // Control may transfer here via looping or 'continue'.
260 ObserveTypesAtOsrEntry(stmt);
261 RECURSE(Visit(stmt->body()));
262 RECURSE(Visit(stmt->cond()));
263 store_.Forget(); // Control may transfer here via 'break'.
267 void AstTyper::VisitWhileStatement(WhileStatement* stmt) {
268 // Collect type feedback.
269 if (!stmt->cond()->ToBooleanIsTrue()) {
270 stmt->cond()->RecordToBooleanTypeFeedback(oracle());
273 store_.Forget(); // Control may transfer here via looping or 'continue'.
274 RECURSE(Visit(stmt->cond()));
275 ObserveTypesAtOsrEntry(stmt);
276 RECURSE(Visit(stmt->body()));
277 store_.Forget(); // Control may transfer here via termination or 'break'.
281 void AstTyper::VisitForStatement(ForStatement* stmt) {
282 if (stmt->init() != NULL) {
283 RECURSE(Visit(stmt->init()));
285 store_.Forget(); // Control may transfer here via looping.
286 if (stmt->cond() != NULL) {
287 // Collect type feedback.
288 stmt->cond()->RecordToBooleanTypeFeedback(oracle());
290 RECURSE(Visit(stmt->cond()));
292 ObserveTypesAtOsrEntry(stmt);
293 RECURSE(Visit(stmt->body()));
294 if (stmt->next() != NULL) {
295 store_.Forget(); // Control may transfer here via 'continue'.
296 RECURSE(Visit(stmt->next()));
298 store_.Forget(); // Control may transfer here via termination or 'break'.
302 void AstTyper::VisitForInStatement(ForInStatement* stmt) {
303 // Collect type feedback.
304 stmt->set_for_in_type(static_cast<ForInStatement::ForInType>(
305 oracle()->ForInType(stmt->ForInFeedbackSlot())));
307 RECURSE(Visit(stmt->enumerable()));
308 store_.Forget(); // Control may transfer here via looping or 'continue'.
309 ObserveTypesAtOsrEntry(stmt);
310 RECURSE(Visit(stmt->body()));
311 store_.Forget(); // Control may transfer here via 'break'.
315 void AstTyper::VisitForOfStatement(ForOfStatement* stmt) {
316 RECURSE(Visit(stmt->iterable()));
317 store_.Forget(); // Control may transfer here via looping or 'continue'.
318 RECURSE(Visit(stmt->body()));
319 store_.Forget(); // Control may transfer here via 'break'.
323 void AstTyper::VisitTryCatchStatement(TryCatchStatement* stmt) {
324 Effects try_effects = EnterEffects();
325 RECURSE(Visit(stmt->try_block()));
327 Effects catch_effects = EnterEffects();
328 store_.Forget(); // Control may transfer here via 'throw'.
329 RECURSE(Visit(stmt->catch_block()));
331 try_effects.Alt(catch_effects);
332 store_.Seq(try_effects);
333 // At this point, only variables that were reassigned in the catch block are
338 void AstTyper::VisitTryFinallyStatement(TryFinallyStatement* stmt) {
339 RECURSE(Visit(stmt->try_block()));
340 store_.Forget(); // Control may transfer here via 'throw'.
341 RECURSE(Visit(stmt->finally_block()));
345 void AstTyper::VisitDebuggerStatement(DebuggerStatement* stmt) {
346 store_.Forget(); // May do whatever.
350 void AstTyper::VisitFunctionLiteral(FunctionLiteral* expr) {
351 expr->InitializeSharedInfo(Handle<Code>(info_->closure()->shared()->code()));
355 void AstTyper::VisitClassLiteral(ClassLiteral* expr) {}
358 void AstTyper::VisitNativeFunctionLiteral(NativeFunctionLiteral* expr) {
362 void AstTyper::VisitConditional(Conditional* expr) {
363 // Collect type feedback.
364 expr->condition()->RecordToBooleanTypeFeedback(oracle());
366 RECURSE(Visit(expr->condition()));
367 Effects then_effects = EnterEffects();
368 RECURSE(Visit(expr->then_expression()));
370 Effects else_effects = EnterEffects();
371 RECURSE(Visit(expr->else_expression()));
373 then_effects.Alt(else_effects);
374 store_.Seq(then_effects);
376 NarrowType(expr, Bounds::Either(
377 expr->then_expression()->bounds(),
378 expr->else_expression()->bounds(), zone()));
382 void AstTyper::VisitVariableProxy(VariableProxy* expr) {
383 Variable* var = expr->var();
384 if (var->IsStackAllocated()) {
385 NarrowType(expr, store_.LookupBounds(variable_index(var)));
390 void AstTyper::VisitLiteral(Literal* expr) {
391 Type* type = Type::Constant(expr->value(), zone());
392 NarrowType(expr, Bounds(type));
396 void AstTyper::VisitRegExpLiteral(RegExpLiteral* expr) {
397 NarrowType(expr, Bounds(Type::RegExp(zone())));
401 void AstTyper::VisitObjectLiteral(ObjectLiteral* expr) {
402 ZoneList<ObjectLiteral::Property*>* properties = expr->properties();
403 for (int i = 0; i < properties->length(); ++i) {
404 ObjectLiteral::Property* prop = properties->at(i);
406 // Collect type feedback.
407 if ((prop->kind() == ObjectLiteral::Property::MATERIALIZED_LITERAL &&
408 !CompileTimeValue::IsCompileTimeValue(prop->value())) ||
409 prop->kind() == ObjectLiteral::Property::COMPUTED) {
410 if (prop->key()->value()->IsInternalizedString() && prop->emit_store()) {
411 prop->RecordTypeFeedback(oracle());
415 RECURSE(Visit(prop->value()));
418 NarrowType(expr, Bounds(Type::Object(zone())));
422 void AstTyper::VisitArrayLiteral(ArrayLiteral* expr) {
423 ZoneList<Expression*>* values = expr->values();
424 for (int i = 0; i < values->length(); ++i) {
425 Expression* value = values->at(i);
426 RECURSE(Visit(value));
429 NarrowType(expr, Bounds(Type::Array(zone())));
433 void AstTyper::VisitAssignment(Assignment* expr) {
434 // Collect type feedback.
435 Property* prop = expr->target()->AsProperty();
437 TypeFeedbackId id = expr->AssignmentFeedbackId();
438 expr->set_is_uninitialized(oracle()->StoreIsUninitialized(id));
439 if (!expr->IsUninitialized()) {
440 if (prop->key()->IsPropertyName()) {
441 Literal* lit_key = prop->key()->AsLiteral();
442 DCHECK(lit_key != NULL && lit_key->value()->IsString());
443 Handle<String> name = Handle<String>::cast(lit_key->value());
444 oracle()->AssignmentReceiverTypes(id, name, expr->GetReceiverTypes());
446 KeyedAccessStoreMode store_mode;
447 IcCheckType key_type;
448 oracle()->KeyedAssignmentReceiverTypes(id, expr->GetReceiverTypes(),
449 &store_mode, &key_type);
450 expr->set_store_mode(store_mode);
451 expr->set_key_type(key_type);
457 expr->is_compound() ? expr->binary_operation() : expr->value();
458 RECURSE(Visit(expr->target()));
460 NarrowType(expr, rhs->bounds());
462 VariableProxy* proxy = expr->target()->AsVariableProxy();
463 if (proxy != NULL && proxy->var()->IsStackAllocated()) {
464 store_.Seq(variable_index(proxy->var()), Effect(expr->bounds()));
469 void AstTyper::VisitYield(Yield* expr) {
470 RECURSE(Visit(expr->generator_object()));
471 RECURSE(Visit(expr->expression()));
473 // We don't know anything about the result type.
477 void AstTyper::VisitThrow(Throw* expr) {
478 RECURSE(Visit(expr->exception()));
479 // TODO(rossberg): is it worth having a non-termination effect?
481 NarrowType(expr, Bounds(Type::None(zone())));
485 void AstTyper::VisitProperty(Property* expr) {
486 // Collect type feedback.
487 TypeFeedbackId id = expr->PropertyFeedbackId();
488 expr->set_is_uninitialized(oracle()->LoadIsUninitialized(id));
489 if (!expr->IsUninitialized()) {
490 if (expr->key()->IsPropertyName()) {
491 Literal* lit_key = expr->key()->AsLiteral();
492 DCHECK(lit_key != NULL && lit_key->value()->IsString());
493 Handle<String> name = Handle<String>::cast(lit_key->value());
494 oracle()->PropertyReceiverTypes(id, name, expr->GetReceiverTypes());
497 oracle()->KeyedPropertyReceiverTypes(
498 id, expr->GetReceiverTypes(), &is_string);
499 expr->set_is_string_access(is_string);
503 RECURSE(Visit(expr->obj()));
504 RECURSE(Visit(expr->key()));
506 // We don't know anything about the result type.
510 void AstTyper::VisitCall(Call* expr) {
511 // Collect type feedback.
512 RECURSE(Visit(expr->expression()));
513 if (!expr->expression()->IsProperty() &&
514 expr->IsUsingCallFeedbackSlot(isolate()) &&
515 oracle()->CallIsMonomorphic(expr->CallFeedbackSlot())) {
516 expr->set_target(oracle()->GetCallTarget(expr->CallFeedbackSlot()));
517 Handle<AllocationSite> site =
518 oracle()->GetCallAllocationSite(expr->CallFeedbackSlot());
519 expr->set_allocation_site(site);
522 ZoneList<Expression*>* args = expr->arguments();
523 for (int i = 0; i < args->length(); ++i) {
524 Expression* arg = args->at(i);
528 VariableProxy* proxy = expr->expression()->AsVariableProxy();
529 if (proxy != NULL && proxy->var()->is_possibly_eval(isolate())) {
530 store_.Forget(); // Eval could do whatever to local variables.
533 // We don't know anything about the result type.
537 void AstTyper::VisitCallNew(CallNew* expr) {
538 // Collect type feedback.
539 expr->RecordTypeFeedback(oracle());
541 RECURSE(Visit(expr->expression()));
542 ZoneList<Expression*>* args = expr->arguments();
543 for (int i = 0; i < args->length(); ++i) {
544 Expression* arg = args->at(i);
548 NarrowType(expr, Bounds(Type::None(zone()), Type::Receiver(zone())));
552 void AstTyper::VisitCallRuntime(CallRuntime* expr) {
553 ZoneList<Expression*>* args = expr->arguments();
554 for (int i = 0; i < args->length(); ++i) {
555 Expression* arg = args->at(i);
559 // We don't know anything about the result type.
563 void AstTyper::VisitUnaryOperation(UnaryOperation* expr) {
564 // Collect type feedback.
565 if (expr->op() == Token::NOT) {
566 // TODO(rossberg): only do in test or value context.
567 expr->expression()->RecordToBooleanTypeFeedback(oracle());
570 RECURSE(Visit(expr->expression()));
572 switch (expr->op()) {
575 NarrowType(expr, Bounds(Type::Boolean(zone())));
578 NarrowType(expr, Bounds(Type::Undefined(zone())));
581 NarrowType(expr, Bounds(Type::InternalizedString(zone())));
589 void AstTyper::VisitCountOperation(CountOperation* expr) {
590 // Collect type feedback.
591 TypeFeedbackId store_id = expr->CountStoreFeedbackId();
592 KeyedAccessStoreMode store_mode;
593 IcCheckType key_type;
594 oracle()->GetStoreModeAndKeyType(store_id, &store_mode, &key_type);
595 expr->set_store_mode(store_mode);
596 expr->set_key_type(key_type);
597 oracle()->CountReceiverTypes(store_id, expr->GetReceiverTypes());
598 expr->set_type(oracle()->CountType(expr->CountBinOpFeedbackId()));
599 // TODO(rossberg): merge the count type with the generic expression type.
601 RECURSE(Visit(expr->expression()));
603 NarrowType(expr, Bounds(Type::SignedSmall(zone()), Type::Number(zone())));
605 VariableProxy* proxy = expr->expression()->AsVariableProxy();
606 if (proxy != NULL && proxy->var()->IsStackAllocated()) {
607 store_.Seq(variable_index(proxy->var()), Effect(expr->bounds()));
612 void AstTyper::VisitBinaryOperation(BinaryOperation* expr) {
613 // Collect type feedback.
617 Maybe<int> fixed_right_arg;
618 Handle<AllocationSite> allocation_site;
619 oracle()->BinaryType(expr->BinaryOperationFeedbackId(),
620 &left_type, &right_type, &type, &fixed_right_arg,
621 &allocation_site, expr->op());
622 NarrowLowerType(expr, type);
623 NarrowLowerType(expr->left(), left_type);
624 NarrowLowerType(expr->right(), right_type);
625 expr->set_allocation_site(allocation_site);
626 expr->set_fixed_right_arg(fixed_right_arg);
627 if (expr->op() == Token::OR || expr->op() == Token::AND) {
628 expr->left()->RecordToBooleanTypeFeedback(oracle());
631 switch (expr->op()) {
633 RECURSE(Visit(expr->left()));
634 RECURSE(Visit(expr->right()));
635 NarrowType(expr, expr->right()->bounds());
639 Effects left_effects = EnterEffects();
640 RECURSE(Visit(expr->left()));
642 Effects right_effects = EnterEffects();
643 RECURSE(Visit(expr->right()));
645 left_effects.Alt(right_effects);
646 store_.Seq(left_effects);
648 NarrowType(expr, Bounds::Either(
649 expr->left()->bounds(), expr->right()->bounds(), zone()));
653 case Token::BIT_AND: {
654 RECURSE(Visit(expr->left()));
655 RECURSE(Visit(expr->right()));
656 Type* upper = Type::Union(
657 expr->left()->bounds().upper, expr->right()->bounds().upper, zone());
658 if (!upper->Is(Type::Signed32())) upper = Type::Signed32(zone());
659 Type* lower = Type::Intersect(Type::SignedSmall(zone()), upper, zone());
660 NarrowType(expr, Bounds(lower, upper));
666 RECURSE(Visit(expr->left()));
667 RECURSE(Visit(expr->right()));
669 Bounds(Type::SignedSmall(zone()), Type::Signed32(zone())));
672 RECURSE(Visit(expr->left()));
673 RECURSE(Visit(expr->right()));
674 // TODO(rossberg): The upper bound would be Unsigned32, but since there
675 // is no 'positive Smi' type for the lower bound, we use the smallest
676 // union of Smi and Unsigned32 as upper bound instead.
677 NarrowType(expr, Bounds(Type::SignedSmall(zone()), Type::Number(zone())));
680 RECURSE(Visit(expr->left()));
681 RECURSE(Visit(expr->right()));
682 Bounds l = expr->left()->bounds();
683 Bounds r = expr->right()->bounds();
685 !l.lower->IsInhabited() || !r.lower->IsInhabited() ?
687 l.lower->Is(Type::String()) || r.lower->Is(Type::String()) ?
688 Type::String(zone()) :
689 l.lower->Is(Type::Number()) && r.lower->Is(Type::Number()) ?
690 Type::SignedSmall(zone()) : Type::None(zone());
692 l.upper->Is(Type::String()) || r.upper->Is(Type::String()) ?
693 Type::String(zone()) :
694 l.upper->Is(Type::Number()) && r.upper->Is(Type::Number()) ?
695 Type::Number(zone()) : Type::NumberOrString(zone());
696 NarrowType(expr, Bounds(lower, upper));
703 RECURSE(Visit(expr->left()));
704 RECURSE(Visit(expr->right()));
705 NarrowType(expr, Bounds(Type::SignedSmall(zone()), Type::Number(zone())));
713 void AstTyper::VisitCompareOperation(CompareOperation* expr) {
714 // Collect type feedback.
718 oracle()->CompareType(expr->CompareOperationFeedbackId(),
719 &left_type, &right_type, &combined_type);
720 NarrowLowerType(expr->left(), left_type);
721 NarrowLowerType(expr->right(), right_type);
722 expr->set_combined_type(combined_type);
724 RECURSE(Visit(expr->left()));
725 RECURSE(Visit(expr->right()));
727 NarrowType(expr, Bounds(Type::Boolean(zone())));
731 void AstTyper::VisitThisFunction(ThisFunction* expr) {
735 void AstTyper::VisitSuperReference(SuperReference* expr) {}
738 void AstTyper::VisitDeclarations(ZoneList<Declaration*>* decls) {
739 for (int i = 0; i < decls->length(); ++i) {
740 Declaration* decl = decls->at(i);
741 RECURSE(Visit(decl));
746 void AstTyper::VisitVariableDeclaration(VariableDeclaration* declaration) {
750 void AstTyper::VisitFunctionDeclaration(FunctionDeclaration* declaration) {
751 RECURSE(Visit(declaration->fun()));
755 void AstTyper::VisitModuleDeclaration(ModuleDeclaration* declaration) {
756 RECURSE(Visit(declaration->module()));
760 void AstTyper::VisitImportDeclaration(ImportDeclaration* declaration) {
761 RECURSE(Visit(declaration->module()));
765 void AstTyper::VisitExportDeclaration(ExportDeclaration* declaration) {
769 void AstTyper::VisitModuleLiteral(ModuleLiteral* module) {
770 RECURSE(Visit(module->body()));
774 void AstTyper::VisitModuleVariable(ModuleVariable* module) {
778 void AstTyper::VisitModulePath(ModulePath* module) {
779 RECURSE(Visit(module->module()));
783 void AstTyper::VisitModuleUrl(ModuleUrl* module) {
787 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) {
788 RECURSE(Visit(stmt->body()));
792 } } // namespace v8::internal