OLD | NEW |
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 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2683 header->SetInitialEnvironment(entry_env); | 2683 header->SetInitialEnvironment(entry_env); |
2684 header->AttachLoopInformation(); | 2684 header->AttachLoopInformation(); |
2685 return header; | 2685 return header; |
2686 } | 2686 } |
2687 | 2687 |
2688 | 2688 |
2689 void HGraphBuilder::VisitBlock(Block* stmt) { | 2689 void HGraphBuilder::VisitBlock(Block* stmt) { |
2690 ASSERT(!HasStackOverflow()); | 2690 ASSERT(!HasStackOverflow()); |
2691 ASSERT(current_block() != NULL); | 2691 ASSERT(current_block() != NULL); |
2692 ASSERT(current_block()->HasPredecessor()); | 2692 ASSERT(current_block()->HasPredecessor()); |
2693 if (stmt->block_scope() != NULL) { | 2693 if (stmt->scope() != NULL) { |
2694 return Bailout("ScopedBlock"); | 2694 return Bailout("ScopedBlock"); |
2695 } | 2695 } |
2696 BreakAndContinueInfo break_info(stmt); | 2696 BreakAndContinueInfo break_info(stmt); |
2697 { BreakAndContinueScope push(&break_info, this); | 2697 { BreakAndContinueScope push(&break_info, this); |
2698 CHECK_BAILOUT(VisitStatements(stmt->statements())); | 2698 CHECK_BAILOUT(VisitStatements(stmt->statements())); |
2699 } | 2699 } |
2700 HBasicBlock* break_block = break_info.break_block(); | 2700 HBasicBlock* break_block = break_info.break_block(); |
2701 if (break_block != NULL) { | 2701 if (break_block != NULL) { |
2702 if (current_block() != NULL) current_block()->Goto(break_block); | 2702 if (current_block() != NULL) current_block()->Goto(break_block); |
2703 break_block->SetJoinId(stmt->ExitId()); | 2703 break_block->SetJoinId(stmt->ExitId()); |
(...skipping 4288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6992 if (store->HasObservableSideEffects()) AddSimulate(proxy->id()); | 6992 if (store->HasObservableSideEffects()) AddSimulate(proxy->id()); |
6993 break; | 6993 break; |
6994 } | 6994 } |
6995 case Variable::LOOKUP: | 6995 case Variable::LOOKUP: |
6996 return Bailout("unsupported lookup slot in declaration"); | 6996 return Bailout("unsupported lookup slot in declaration"); |
6997 } | 6997 } |
6998 } | 6998 } |
6999 | 6999 |
7000 | 7000 |
7001 void HGraphBuilder::VisitModuleDeclaration(ModuleDeclaration* declaration) { | 7001 void HGraphBuilder::VisitModuleDeclaration(ModuleDeclaration* declaration) { |
7002 VariableProxy* proxy = declaration->proxy(); | 7002 UNREACHABLE(); |
7003 Variable* var = proxy->var(); | |
7004 switch (var->location()) { | |
7005 case Variable::UNALLOCATED: { | |
7006 // TODO(rossberg) | |
7007 return; | |
7008 } | |
7009 case Variable::CONTEXT: { | |
7010 // TODO(rossberg) | |
7011 break; | |
7012 } | |
7013 case Variable::PARAMETER: | |
7014 case Variable::LOCAL: | |
7015 case Variable::LOOKUP: | |
7016 UNREACHABLE(); | |
7017 } | |
7018 } | 7003 } |
7019 | 7004 |
7020 | 7005 |
7021 void HGraphBuilder::VisitImportDeclaration(ImportDeclaration* declaration) { | 7006 void HGraphBuilder::VisitImportDeclaration(ImportDeclaration* declaration) { |
7022 VariableProxy* proxy = declaration->proxy(); | 7007 UNREACHABLE(); |
7023 Variable* var = proxy->var(); | |
7024 switch (var->location()) { | |
7025 case Variable::UNALLOCATED: { | |
7026 // TODO(rossberg) | |
7027 return; | |
7028 } | |
7029 case Variable::CONTEXT: { | |
7030 // TODO(rossberg) | |
7031 break; | |
7032 } | |
7033 case Variable::PARAMETER: | |
7034 case Variable::LOCAL: | |
7035 case Variable::LOOKUP: | |
7036 UNREACHABLE(); | |
7037 } | |
7038 } | 7008 } |
7039 | 7009 |
7040 | 7010 |
7041 void HGraphBuilder::VisitExportDeclaration(ExportDeclaration* declaration) { | 7011 void HGraphBuilder::VisitExportDeclaration(ExportDeclaration* declaration) { |
7042 // TODO(rossberg) | 7012 UNREACHABLE(); |
7043 } | 7013 } |
7044 | 7014 |
7045 | 7015 |
7046 void HGraphBuilder::VisitModuleLiteral(ModuleLiteral* module) { | 7016 void HGraphBuilder::VisitModuleLiteral(ModuleLiteral* module) { |
7047 // TODO(rossberg) | 7017 UNREACHABLE(); |
7048 } | 7018 } |
7049 | 7019 |
7050 | 7020 |
7051 void HGraphBuilder::VisitModuleVariable(ModuleVariable* module) { | 7021 void HGraphBuilder::VisitModuleVariable(ModuleVariable* module) { |
7052 // TODO(rossberg) | 7022 UNREACHABLE(); |
7053 } | 7023 } |
7054 | 7024 |
7055 | 7025 |
7056 void HGraphBuilder::VisitModulePath(ModulePath* module) { | 7026 void HGraphBuilder::VisitModulePath(ModulePath* module) { |
7057 // TODO(rossberg) | 7027 UNREACHABLE(); |
7058 } | 7028 } |
7059 | 7029 |
7060 | 7030 |
7061 void HGraphBuilder::VisitModuleUrl(ModuleUrl* module) { | 7031 void HGraphBuilder::VisitModuleUrl(ModuleUrl* module) { |
7062 // TODO(rossberg) | 7032 UNREACHABLE(); |
7063 } | 7033 } |
7064 | 7034 |
7065 | 7035 |
7066 // Generators for inline runtime functions. | 7036 // Generators for inline runtime functions. |
7067 // Support for types. | 7037 // Support for types. |
7068 void HGraphBuilder::GenerateIsSmi(CallRuntime* call) { | 7038 void HGraphBuilder::GenerateIsSmi(CallRuntime* call) { |
7069 ASSERT(call->arguments()->length() == 1); | 7039 ASSERT(call->arguments()->length() == 1); |
7070 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 7040 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
7071 HValue* value = Pop(); | 7041 HValue* value = Pop(); |
7072 HIsSmiAndBranch* result = new(zone()) HIsSmiAndBranch(value); | 7042 HIsSmiAndBranch* result = new(zone()) HIsSmiAndBranch(value); |
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8142 } | 8112 } |
8143 } | 8113 } |
8144 | 8114 |
8145 #ifdef DEBUG | 8115 #ifdef DEBUG |
8146 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 8116 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
8147 if (allocator_ != NULL) allocator_->Verify(); | 8117 if (allocator_ != NULL) allocator_->Verify(); |
8148 #endif | 8118 #endif |
8149 } | 8119 } |
8150 | 8120 |
8151 } } // namespace v8::internal | 8121 } } // namespace v8::internal |
OLD | NEW |