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 2750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2761 header->SetInitialEnvironment(entry_env); | 2761 header->SetInitialEnvironment(entry_env); |
2762 header->AttachLoopInformation(); | 2762 header->AttachLoopInformation(); |
2763 return header; | 2763 return header; |
2764 } | 2764 } |
2765 | 2765 |
2766 | 2766 |
2767 void HGraphBuilder::VisitBlock(Block* stmt) { | 2767 void HGraphBuilder::VisitBlock(Block* stmt) { |
2768 ASSERT(!HasStackOverflow()); | 2768 ASSERT(!HasStackOverflow()); |
2769 ASSERT(current_block() != NULL); | 2769 ASSERT(current_block() != NULL); |
2770 ASSERT(current_block()->HasPredecessor()); | 2770 ASSERT(current_block()->HasPredecessor()); |
2771 if (stmt->block_scope() != NULL) { | 2771 if (stmt->scope() != NULL) { |
2772 return Bailout("ScopedBlock"); | 2772 return Bailout("ScopedBlock"); |
2773 } | 2773 } |
2774 BreakAndContinueInfo break_info(stmt); | 2774 BreakAndContinueInfo break_info(stmt); |
2775 { BreakAndContinueScope push(&break_info, this); | 2775 { BreakAndContinueScope push(&break_info, this); |
2776 CHECK_BAILOUT(VisitStatements(stmt->statements())); | 2776 CHECK_BAILOUT(VisitStatements(stmt->statements())); |
2777 } | 2777 } |
2778 HBasicBlock* break_block = break_info.break_block(); | 2778 HBasicBlock* break_block = break_info.break_block(); |
2779 if (break_block != NULL) { | 2779 if (break_block != NULL) { |
2780 if (current_block() != NULL) current_block()->Goto(break_block); | 2780 if (current_block() != NULL) current_block()->Goto(break_block); |
2781 break_block->SetJoinId(stmt->ExitId()); | 2781 break_block->SetJoinId(stmt->ExitId()); |
(...skipping 4461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7243 if (store->HasObservableSideEffects()) AddSimulate(proxy->id()); | 7243 if (store->HasObservableSideEffects()) AddSimulate(proxy->id()); |
7244 break; | 7244 break; |
7245 } | 7245 } |
7246 case Variable::LOOKUP: | 7246 case Variable::LOOKUP: |
7247 return Bailout("unsupported lookup slot in declaration"); | 7247 return Bailout("unsupported lookup slot in declaration"); |
7248 } | 7248 } |
7249 } | 7249 } |
7250 | 7250 |
7251 | 7251 |
7252 void HGraphBuilder::VisitModuleDeclaration(ModuleDeclaration* declaration) { | 7252 void HGraphBuilder::VisitModuleDeclaration(ModuleDeclaration* declaration) { |
7253 VariableProxy* proxy = declaration->proxy(); | 7253 UNREACHABLE(); |
7254 Variable* var = proxy->var(); | |
7255 switch (var->location()) { | |
7256 case Variable::UNALLOCATED: { | |
7257 // TODO(rossberg) | |
7258 return; | |
7259 } | |
7260 case Variable::CONTEXT: { | |
7261 // TODO(rossberg) | |
7262 break; | |
7263 } | |
7264 case Variable::PARAMETER: | |
7265 case Variable::LOCAL: | |
7266 case Variable::LOOKUP: | |
7267 UNREACHABLE(); | |
7268 } | |
7269 } | 7254 } |
7270 | 7255 |
7271 | 7256 |
7272 void HGraphBuilder::VisitImportDeclaration(ImportDeclaration* declaration) { | 7257 void HGraphBuilder::VisitImportDeclaration(ImportDeclaration* declaration) { |
7273 VariableProxy* proxy = declaration->proxy(); | 7258 UNREACHABLE(); |
7274 Variable* var = proxy->var(); | |
7275 switch (var->location()) { | |
7276 case Variable::UNALLOCATED: { | |
7277 // TODO(rossberg) | |
7278 return; | |
7279 } | |
7280 case Variable::CONTEXT: { | |
7281 // TODO(rossberg) | |
7282 break; | |
7283 } | |
7284 case Variable::PARAMETER: | |
7285 case Variable::LOCAL: | |
7286 case Variable::LOOKUP: | |
7287 UNREACHABLE(); | |
7288 } | |
7289 } | 7259 } |
7290 | 7260 |
7291 | 7261 |
7292 void HGraphBuilder::VisitExportDeclaration(ExportDeclaration* declaration) { | 7262 void HGraphBuilder::VisitExportDeclaration(ExportDeclaration* declaration) { |
7293 // TODO(rossberg) | 7263 UNREACHABLE(); |
7294 } | 7264 } |
7295 | 7265 |
7296 | 7266 |
7297 void HGraphBuilder::VisitModuleLiteral(ModuleLiteral* module) { | 7267 void HGraphBuilder::VisitModuleLiteral(ModuleLiteral* module) { |
7298 // TODO(rossberg) | 7268 UNREACHABLE(); |
7299 } | 7269 } |
7300 | 7270 |
7301 | 7271 |
7302 void HGraphBuilder::VisitModuleVariable(ModuleVariable* module) { | 7272 void HGraphBuilder::VisitModuleVariable(ModuleVariable* module) { |
7303 // TODO(rossberg) | 7273 UNREACHABLE(); |
7304 } | 7274 } |
7305 | 7275 |
7306 | 7276 |
7307 void HGraphBuilder::VisitModulePath(ModulePath* module) { | 7277 void HGraphBuilder::VisitModulePath(ModulePath* module) { |
7308 // TODO(rossberg) | 7278 UNREACHABLE(); |
7309 } | 7279 } |
7310 | 7280 |
7311 | 7281 |
7312 void HGraphBuilder::VisitModuleUrl(ModuleUrl* module) { | 7282 void HGraphBuilder::VisitModuleUrl(ModuleUrl* module) { |
7313 // TODO(rossberg) | 7283 UNREACHABLE(); |
7314 } | 7284 } |
7315 | 7285 |
7316 | 7286 |
7317 // Generators for inline runtime functions. | 7287 // Generators for inline runtime functions. |
7318 // Support for types. | 7288 // Support for types. |
7319 void HGraphBuilder::GenerateIsSmi(CallRuntime* call) { | 7289 void HGraphBuilder::GenerateIsSmi(CallRuntime* call) { |
7320 ASSERT(call->arguments()->length() == 1); | 7290 ASSERT(call->arguments()->length() == 1); |
7321 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 7291 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
7322 HValue* value = Pop(); | 7292 HValue* value = Pop(); |
7323 HIsSmiAndBranch* result = new(zone()) HIsSmiAndBranch(value); | 7293 HIsSmiAndBranch* result = new(zone()) HIsSmiAndBranch(value); |
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8395 } | 8365 } |
8396 } | 8366 } |
8397 | 8367 |
8398 #ifdef DEBUG | 8368 #ifdef DEBUG |
8399 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 8369 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
8400 if (allocator_ != NULL) allocator_->Verify(); | 8370 if (allocator_ != NULL) allocator_->Verify(); |
8401 #endif | 8371 #endif |
8402 } | 8372 } |
8403 | 8373 |
8404 } } // namespace v8::internal | 8374 } } // namespace v8::internal |
OLD | NEW |