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

Side by Side Diff: src/parser.cc

Issue 760863003: Parser: Removing debug code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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/parser.h ('k') | no next file » | 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 isolate()->counters()->total_parse_size()->Increment(source->length()); 828 isolate()->counters()->total_parse_size()->Increment(source->length());
829 base::ElapsedTimer timer; 829 base::ElapsedTimer timer;
830 if (FLAG_trace_parse) { 830 if (FLAG_trace_parse) {
831 timer.Start(); 831 timer.Start();
832 } 832 }
833 fni_ = new (zone()) FuncNameInferrer(ast_value_factory(), zone()); 833 fni_ = new (zone()) FuncNameInferrer(ast_value_factory(), zone());
834 834
835 // Initialize parser state. 835 // Initialize parser state.
836 CompleteParserRecorder recorder; 836 CompleteParserRecorder recorder;
837 837
838 debug_saved_compile_options_ = compile_options();
839 if (produce_cached_parse_data()) { 838 if (produce_cached_parse_data()) {
840 log_ = &recorder; 839 log_ = &recorder;
841 } else if (consume_cached_parse_data()) { 840 } else if (consume_cached_parse_data()) {
842 cached_parse_data_->Initialize(); 841 cached_parse_data_->Initialize();
843 } 842 }
844 843
845 source = String::Flatten(source); 844 source = String::Flatten(source);
846 FunctionLiteral* result; 845 FunctionLiteral* result;
847 846
848 Scope* top_scope = NULL; 847 Scope* top_scope = NULL;
(...skipping 2972 matching lines...) Expand 10 before | Expand all | Expand 10 after
3821 3820
3822 if (fni_ != NULL && should_infer_name) fni_->AddFunction(function_literal); 3821 if (fni_ != NULL && should_infer_name) fni_->AddFunction(function_literal);
3823 return function_literal; 3822 return function_literal;
3824 } 3823 }
3825 3824
3826 3825
3827 void Parser::SkipLazyFunctionBody(const AstRawString* function_name, 3826 void Parser::SkipLazyFunctionBody(const AstRawString* function_name,
3828 int* materialized_literal_count, 3827 int* materialized_literal_count,
3829 int* expected_property_count, 3828 int* expected_property_count,
3830 bool* ok) { 3829 bool* ok) {
3831 // Temporary debugging code for tracking down a mystery crash which should
3832 // never happen. The crash happens on the line where we log the function in
3833 // the preparse data: log_->LogFunction(...). TODO(marja): remove this once
3834 // done.
3835 CHECK(materialized_literal_count);
3836 CHECK(expected_property_count);
3837 CHECK(debug_saved_compile_options_ == compile_options());
3838 if (produce_cached_parse_data()) CHECK(log_); 3830 if (produce_cached_parse_data()) CHECK(log_);
3839 3831
3840 int function_block_pos = position(); 3832 int function_block_pos = position();
3841 if (consume_cached_parse_data()) { 3833 if (consume_cached_parse_data()) {
3842 // If we have cached data, we use it to skip parsing the function body. The 3834 // If we have cached data, we use it to skip parsing the function body. The
3843 // data contains the information we need to construct the lazy function. 3835 // data contains the information we need to construct the lazy function.
3844 FunctionEntry entry = 3836 FunctionEntry entry =
3845 cached_parse_data_->GetFunctionEntry(function_block_pos); 3837 cached_parse_data_->GetFunctionEntry(function_block_pos);
3846 // Check that cached data is valid. 3838 // Check that cached data is valid.
3847 CHECK(entry.is_valid()); 3839 CHECK(entry.is_valid());
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after
5141 return (result != NULL); 5133 return (result != NULL);
5142 } 5134 }
5143 5135
5144 5136
5145 void Parser::ParseOnBackground() { 5137 void Parser::ParseOnBackground() {
5146 DCHECK(info()->function() == NULL); 5138 DCHECK(info()->function() == NULL);
5147 FunctionLiteral* result = NULL; 5139 FunctionLiteral* result = NULL;
5148 fni_ = new (zone()) FuncNameInferrer(ast_value_factory(), zone()); 5140 fni_ = new (zone()) FuncNameInferrer(ast_value_factory(), zone());
5149 5141
5150 CompleteParserRecorder recorder; 5142 CompleteParserRecorder recorder;
5151 debug_saved_compile_options_ = compile_options();
5152 if (produce_cached_parse_data()) log_ = &recorder; 5143 if (produce_cached_parse_data()) log_ = &recorder;
5153 5144
5154 DCHECK(info()->source_stream() != NULL); 5145 DCHECK(info()->source_stream() != NULL);
5155 ExternalStreamingStream stream(info()->source_stream(), 5146 ExternalStreamingStream stream(info()->source_stream(),
5156 info()->source_stream_encoding()); 5147 info()->source_stream_encoding());
5157 scanner_.Initialize(&stream); 5148 scanner_.Initialize(&stream);
5158 DCHECK(info()->context().is_null() || info()->context()->IsNativeContext()); 5149 DCHECK(info()->context().is_null() || info()->context()->IsNativeContext());
5159 5150
5160 // When streaming, we don't know the length of the source until we have parsed 5151 // When streaming, we don't know the length of the source until we have parsed
5161 // it. The raw data can be UTF-8, so we wouldn't know the source length until 5152 // it. The raw data can be UTF-8, so we wouldn't know the source length until
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
5348 } 5339 }
5349 5340
5350 // Hash key is used exclusively by template call site caching. There are no 5341 // Hash key is used exclusively by template call site caching. There are no
5351 // real security implications for unseeded hashes, and no issues with changing 5342 // real security implications for unseeded hashes, and no issues with changing
5352 // the hashing algorithm to improve performance or entropy. 5343 // the hashing algorithm to improve performance or entropy.
5353 *hash = running_hash; 5344 *hash = running_hash;
5354 5345
5355 return raw_strings; 5346 return raw_strings;
5356 } 5347 }
5357 } } // namespace v8::internal 5348 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/parser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698