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

Side by Side Diff: src/parsing/parser.cc

Issue 1847543002: Expose a lower bound of malloc'd memory via heap statistics (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 4 years, 8 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
« no previous file with comments | « src/objects.cc ('k') | src/regexp/jsregexp.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 // 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 4200 matching lines...) Expand 10 before | Expand all | Expand 10 after
4211 function_type == FunctionLiteral::kDeclaration && 4211 function_type == FunctionLiteral::kDeclaration &&
4212 eager_compile_hint != FunctionLiteral::kShouldEagerCompile; 4212 eager_compile_hint != FunctionLiteral::kShouldEagerCompile;
4213 // Open a new BodyScope, which sets our AstNodeFactory to allocate in the 4213 // Open a new BodyScope, which sets our AstNodeFactory to allocate in the
4214 // new temporary zone if the preconditions are satisfied, and ensures that 4214 // new temporary zone if the preconditions are satisfied, and ensures that
4215 // the previous zone is always restored after parsing the body. 4215 // the previous zone is always restored after parsing the body.
4216 // For the purpose of scope analysis, some ZoneObjects allocated by the 4216 // For the purpose of scope analysis, some ZoneObjects allocated by the
4217 // factory must persist after the function body is thrown away and 4217 // factory must persist after the function body is thrown away and
4218 // temp_zone is deallocated. These objects are instead allocated in a 4218 // temp_zone is deallocated. These objects are instead allocated in a
4219 // parser-persistent zone (see parser_zone_ in AstNodeFactory). 4219 // parser-persistent zone (see parser_zone_ in AstNodeFactory).
4220 { 4220 {
4221 Zone temp_zone; 4221 Zone temp_zone(zone()->allocator());
4222 AstNodeFactory::BodyScope inner(factory(), &temp_zone, use_temp_zone); 4222 AstNodeFactory::BodyScope inner(factory(), &temp_zone, use_temp_zone);
4223 4223
4224 body = ParseEagerFunctionBody(function_name, pos, formals, kind, 4224 body = ParseEagerFunctionBody(function_name, pos, formals, kind,
4225 function_type, CHECK_OK); 4225 function_type, CHECK_OK);
4226 } 4226 }
4227 materialized_literal_count = function_state.materialized_literal_count(); 4227 materialized_literal_count = function_state.materialized_literal_count();
4228 expected_property_count = function_state.expected_property_count(); 4228 expected_property_count = function_state.expected_property_count();
4229 if (use_temp_zone) { 4229 if (use_temp_zone) {
4230 // If the preconditions are correct the function body should never be 4230 // If the preconditions are correct the function body should never be
4231 // accessed, but do this anyway for better behaviour if they're wrong. 4231 // accessed, but do this anyway for better behaviour if they're wrong.
(...skipping 2628 matching lines...) Expand 10 before | Expand all | Expand 10 after
6860 try_block, target); 6860 try_block, target);
6861 final_loop = target; 6861 final_loop = target;
6862 } 6862 }
6863 6863
6864 return final_loop; 6864 return final_loop;
6865 } 6865 }
6866 6866
6867 6867
6868 } // namespace internal 6868 } // namespace internal
6869 } // namespace v8 6869 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/regexp/jsregexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698