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

Side by Side Diff: src/compiler.cc

Issue 1801203002: Parser: Make skipping HTML comments optional. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | src/parsing/parser.h » ('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/compiler.h" 5 #include "src/compiler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "src/ast/ast-numbering.h" 9 #include "src/ast/ast-numbering.h"
10 #include "src/ast/prettyprinter.h" 10 #include "src/ast/prettyprinter.h"
(...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after
1659 parse_info.set_cached_data(cached_data); 1659 parse_info.set_cached_data(cached_data);
1660 } 1660 }
1661 parse_info.set_compile_options(compile_options); 1661 parse_info.set_compile_options(compile_options);
1662 parse_info.set_extension(extension); 1662 parse_info.set_extension(extension);
1663 parse_info.set_context(context); 1663 parse_info.set_context(context);
1664 if (FLAG_serialize_toplevel && 1664 if (FLAG_serialize_toplevel &&
1665 compile_options == ScriptCompiler::kProduceCodeCache) { 1665 compile_options == ScriptCompiler::kProduceCodeCache) {
1666 info.PrepareForSerializing(); 1666 info.PrepareForSerializing();
1667 } 1667 }
1668 1668
1669 bool ignore = script_name.is_null() ||
vogelheim 2016/03/15 18:22:59 This is... strange. Should this alternatively go
jochen (gone - plz use gerrit) 2016/03/15 18:36:08 the embedder should tell us whether or not to igno
1670 (script_name->IsString() &&
1671 Handle<String>::cast(script_name)->length() == 0);
1672 parse_info.set_ignore_html_comments(ignore);
1673
1669 parse_info.set_language_mode( 1674 parse_info.set_language_mode(
1670 static_cast<LanguageMode>(info.language_mode() | language_mode)); 1675 static_cast<LanguageMode>(info.language_mode() | language_mode));
1671 result = CompileToplevel(&info); 1676 result = CompileToplevel(&info);
1672 if (extension == NULL && !result.is_null()) { 1677 if (extension == NULL && !result.is_null()) {
1673 compilation_cache->PutScript(source, context, language_mode, result); 1678 compilation_cache->PutScript(source, context, language_mode, result);
1674 if (FLAG_serialize_toplevel && 1679 if (FLAG_serialize_toplevel &&
1675 compile_options == ScriptCompiler::kProduceCodeCache) { 1680 compile_options == ScriptCompiler::kProduceCodeCache) {
1676 HistogramTimerScope histogram_timer( 1681 HistogramTimerScope histogram_timer(
1677 isolate->counters()->compile_serialize()); 1682 isolate->counters()->compile_serialize());
1678 TRACE_EVENT0("v8", "V8.CompileSerialize"); 1683 TRACE_EVENT0("v8", "V8.CompileSerialize");
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1972 1977
1973 #if DEBUG 1978 #if DEBUG
1974 void CompilationInfo::PrintAstForTesting() { 1979 void CompilationInfo::PrintAstForTesting() {
1975 PrintF("--- Source from AST ---\n%s\n", 1980 PrintF("--- Source from AST ---\n%s\n",
1976 PrettyPrinter(isolate()).PrintProgram(literal())); 1981 PrettyPrinter(isolate()).PrintProgram(literal()));
1977 } 1982 }
1978 #endif 1983 #endif
1979 1984
1980 } // namespace internal 1985 } // namespace internal
1981 } // namespace v8 1986 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/parsing/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698