| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 } | 45 } |
| 46 | 46 |
| 47 | 47 |
| 48 #define CHECK_ALIVE(call) \ | 48 #define CHECK_ALIVE(call) \ |
| 49 do { \ | 49 do { \ |
| 50 call; \ | 50 call; \ |
| 51 if (visitor->HasStackOverflow()) return; \ | 51 if (visitor->HasStackOverflow()) return; \ |
| 52 } while (false) | 52 } while (false) |
| 53 | 53 |
| 54 | 54 |
| 55 void AstTyper::Type(CompilationInfo* info) { | 55 void AstTyper::Run(CompilationInfo* info) { |
| 56 AstTyper* visitor = new(info->zone()) AstTyper(info); | 56 AstTyper* visitor = new(info->zone()) AstTyper(info); |
| 57 Scope* scope = info->scope(); | 57 Scope* scope = info->scope(); |
| 58 | 58 |
| 59 // Handle implicit declaration of the function name in named function | 59 // Handle implicit declaration of the function name in named function |
| 60 // expressions before other declarations. | 60 // expressions before other declarations. |
| 61 if (scope->is_function_scope() && scope->function() != NULL) { | 61 if (scope->is_function_scope() && scope->function() != NULL) { |
| 62 CHECK_ALIVE(visitor->VisitVariableDeclaration(scope->function())); | 62 CHECK_ALIVE(visitor->VisitVariableDeclaration(scope->function())); |
| 63 } | 63 } |
| 64 CHECK_ALIVE(visitor->VisitDeclarations(scope->declarations())); | 64 CHECK_ALIVE(visitor->VisitDeclarations(scope->declarations())); |
| 65 CHECK_ALIVE(visitor->VisitStatements(info->function()->body())); | 65 CHECK_ALIVE(visitor->VisitStatements(info->function()->body())); |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 } | 509 } |
| 510 | 510 |
| 511 | 511 |
| 512 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { | 512 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { |
| 513 ASSERT(!HasStackOverflow()); | 513 ASSERT(!HasStackOverflow()); |
| 514 CHECK_ALIVE(Visit(stmt->body())); | 514 CHECK_ALIVE(Visit(stmt->body())); |
| 515 } | 515 } |
| 516 | 516 |
| 517 | 517 |
| 518 } } // namespace v8::internal | 518 } } // namespace v8::internal |
| OLD | NEW |