| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/ast/ast-expression-rewriter.h" | 9 #include "src/ast/ast-expression-rewriter.h" |
| 10 #include "src/ast/ast-expression-visitor.h" | 10 #include "src/ast/ast-expression-visitor.h" |
| (...skipping 4425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4436 !(FLAG_validate_asm && scope->asm_function()); | 4436 !(FLAG_validate_asm && scope->asm_function()); |
| 4437 // Open a new zone scope, which sets our AstNodeFactory to allocate in the | 4437 // Open a new zone scope, which sets our AstNodeFactory to allocate in the |
| 4438 // new temporary zone if the preconditions are satisfied, and ensures that | 4438 // new temporary zone if the preconditions are satisfied, and ensures that |
| 4439 // the previous zone is always restored after parsing the body. | 4439 // the previous zone is always restored after parsing the body. |
| 4440 // For the purpose of scope analysis, some ZoneObjects allocated by the | 4440 // For the purpose of scope analysis, some ZoneObjects allocated by the |
| 4441 // factory must persist after the function body is thrown away and | 4441 // factory must persist after the function body is thrown away and |
| 4442 // temp_zone is deallocated. These objects are instead allocated in a | 4442 // temp_zone is deallocated. These objects are instead allocated in a |
| 4443 // parser-persistent zone (see parser_zone_ in AstNodeFactory). | 4443 // parser-persistent zone (see parser_zone_ in AstNodeFactory). |
| 4444 { | 4444 { |
| 4445 Zone temp_zone(zone()->allocator()); | 4445 Zone temp_zone(zone()->allocator()); |
| 4446 DiscardableZoneScope(this, &temp_zone, use_temp_zone); | 4446 DiscardableZoneScope zone_scope(this, &temp_zone, use_temp_zone); |
| 4447 body = ParseEagerFunctionBody(function_name, pos, formals, kind, | 4447 body = ParseEagerFunctionBody(function_name, pos, formals, kind, |
| 4448 function_type, CHECK_OK); | 4448 function_type, CHECK_OK); |
| 4449 } | 4449 } |
| 4450 materialized_literal_count = function_state.materialized_literal_count(); | 4450 materialized_literal_count = function_state.materialized_literal_count(); |
| 4451 expected_property_count = function_state.expected_property_count(); | 4451 expected_property_count = function_state.expected_property_count(); |
| 4452 if (use_temp_zone) { | 4452 if (use_temp_zone) { |
| 4453 // If the preconditions are correct the function body should never be | 4453 // If the preconditions are correct the function body should never be |
| 4454 // accessed, but do this anyway for better behaviour if they're wrong. | 4454 // accessed, but do this anyway for better behaviour if they're wrong. |
| 4455 body = NULL; | 4455 body = NULL; |
| 4456 } | 4456 } |
| (...skipping 2617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7074 node->Print(Isolate::Current()); | 7074 node->Print(Isolate::Current()); |
| 7075 } | 7075 } |
| 7076 #endif // DEBUG | 7076 #endif // DEBUG |
| 7077 | 7077 |
| 7078 #undef CHECK_OK | 7078 #undef CHECK_OK |
| 7079 #undef CHECK_OK_VOID | 7079 #undef CHECK_OK_VOID |
| 7080 #undef CHECK_FAILED | 7080 #undef CHECK_FAILED |
| 7081 | 7081 |
| 7082 } // namespace internal | 7082 } // namespace internal |
| 7083 } // namespace v8 | 7083 } // namespace v8 |
| OLD | NEW |