Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: src/full-codegen.cc

Issue 9373023: Extend AST with basic module constructs (yet unused). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addresses Jakob's comments. Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ast.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 void BreakableStatementChecker::Check(Expression* expr) { 49 void BreakableStatementChecker::Check(Expression* expr) {
50 Visit(expr); 50 Visit(expr);
51 } 51 }
52 52
53 53
54 void BreakableStatementChecker::VisitVariableDeclaration( 54 void BreakableStatementChecker::VisitVariableDeclaration(
55 VariableDeclaration* decl) { 55 VariableDeclaration* decl) {
56 } 56 }
57 57
58 void BreakableStatementChecker::VisitModuleDeclaration(
59 ModuleDeclaration* decl) {
60 }
61
62
63 void BreakableStatementChecker::VisitModuleLiteral(ModuleLiteral* module) {
64 }
65
66 void BreakableStatementChecker::VisitModuleVariable(ModuleVariable* module) {
67 }
68
69 void BreakableStatementChecker::VisitModulePath(ModulePath* module) {
70 }
71
72 void BreakableStatementChecker::VisitModuleUrl(ModuleUrl* module) {
73 }
74
58 75
59 void BreakableStatementChecker::VisitBlock(Block* stmt) { 76 void BreakableStatementChecker::VisitBlock(Block* stmt) {
60 } 77 }
61 78
62 79
63 void BreakableStatementChecker::VisitExpressionStatement( 80 void BreakableStatementChecker::VisitExpressionStatement(
64 ExpressionStatement* stmt) { 81 ExpressionStatement* stmt) {
65 // Check if expression is breakable. 82 // Check if expression is breakable.
66 Visit(stmt->expression()); 83 Visit(stmt->expression());
67 } 84 }
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 537
521 538
522 void FullCodeGenerator::DoTest(const TestContext* context) { 539 void FullCodeGenerator::DoTest(const TestContext* context) {
523 DoTest(context->condition(), 540 DoTest(context->condition(),
524 context->true_label(), 541 context->true_label(),
525 context->false_label(), 542 context->false_label(),
526 context->fall_through()); 543 context->fall_through());
527 } 544 }
528 545
529 546
530 void FullCodeGenerator::VisitVariableDeclaration(VariableDeclaration* decl) {
531 EmitDeclaration(decl->proxy(), decl->mode(), decl->fun());
532 }
533
534
535 void FullCodeGenerator::VisitDeclarations( 547 void FullCodeGenerator::VisitDeclarations(
536 ZoneList<Declaration*>* declarations) { 548 ZoneList<Declaration*>* declarations) {
537 int save_global_count = global_count_; 549 int save_global_count = global_count_;
538 global_count_ = 0; 550 global_count_ = 0;
539 551
540 AstVisitor::VisitDeclarations(declarations); 552 AstVisitor::VisitDeclarations(declarations);
541 553
542 // Batch declare global functions and variables. 554 // Batch declare global functions and variables.
543 if (global_count_ > 0) { 555 if (global_count_ > 0) {
544 Handle<FixedArray> array = 556 Handle<FixedArray> array =
(...skipping 28 matching lines...) Expand all
573 } 585 }
574 // Invoke the platform-dependent code generator to do the actual 586 // Invoke the platform-dependent code generator to do the actual
575 // declaration the global functions and variables. 587 // declaration the global functions and variables.
576 DeclareGlobals(array); 588 DeclareGlobals(array);
577 } 589 }
578 590
579 global_count_ = save_global_count; 591 global_count_ = save_global_count;
580 } 592 }
581 593
582 594
595 void FullCodeGenerator::VisitVariableDeclaration(VariableDeclaration* decl) {
596 EmitDeclaration(decl->proxy(), decl->mode(), decl->fun());
597 }
598
599
600 void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* decl) {
601 // TODO(rossberg)
602 }
603
604
605 void FullCodeGenerator::VisitModuleLiteral(ModuleLiteral* module) {
606 // TODO(rossberg)
607 }
608
609
610 void FullCodeGenerator::VisitModuleVariable(ModuleVariable* module) {
611 // TODO(rossberg)
612 }
613
614
615 void FullCodeGenerator::VisitModulePath(ModulePath* module) {
616 // TODO(rossberg)
617 }
618
619
620 void FullCodeGenerator::VisitModuleUrl(ModuleUrl* decl) {
621 // TODO(rossberg)
622 }
623
624
583 int FullCodeGenerator::DeclareGlobalsFlags() { 625 int FullCodeGenerator::DeclareGlobalsFlags() {
584 ASSERT(DeclareGlobalsLanguageMode::is_valid(language_mode())); 626 ASSERT(DeclareGlobalsLanguageMode::is_valid(language_mode()));
585 return DeclareGlobalsEvalFlag::encode(is_eval()) | 627 return DeclareGlobalsEvalFlag::encode(is_eval()) |
586 DeclareGlobalsNativeFlag::encode(is_native()) | 628 DeclareGlobalsNativeFlag::encode(is_native()) |
587 DeclareGlobalsLanguageMode::encode(language_mode()); 629 DeclareGlobalsLanguageMode::encode(language_mode());
588 } 630 }
589 631
590 632
591 void FullCodeGenerator::SetFunctionPosition(FunctionLiteral* fun) { 633 void FullCodeGenerator::SetFunctionPosition(FunctionLiteral* fun) {
592 CodeGenerator::RecordPositions(masm_, fun->start_position()); 634 CodeGenerator::RecordPositions(masm_, fun->start_position());
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 } 1380 }
1339 1381
1340 return false; 1382 return false;
1341 } 1383 }
1342 1384
1343 1385
1344 #undef __ 1386 #undef __
1345 1387
1346 1388
1347 } } // namespace v8::internal 1389 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698