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

Unified Diff: src/parser.cc

Issue 389573006: Change ScriptCompiler::CompileOptions and add d8 --cache. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: even more rebase Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parser.h ('k') | test/cctest/cctest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 2489b816e15ab3125aead79628a715321a49134c..27ecc57597e71d1c0d3fbdfdfe76e17121af91e3 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -254,11 +254,11 @@ int ParseData::FunctionsSize() {
void Parser::SetCachedData() {
- if (cached_data_mode() == NO_CACHED_DATA) {
+ if (compile_options() == ScriptCompiler::kNoCompileOptions) {
cached_parse_data_ = NULL;
} else {
ASSERT(info_->cached_data() != NULL);
- if (cached_data_mode() == CONSUME_CACHED_DATA) {
+ if (compile_options() == ScriptCompiler::kConsumeParserCache) {
cached_parse_data_ = new ParseData(*info_->cached_data());
}
}
@@ -741,9 +741,10 @@ FunctionLiteral* Parser::ParseProgram() {
// Initialize parser state.
CompleteParserRecorder recorder;
- if (cached_data_mode() == PRODUCE_CACHED_DATA) {
+
+ if (compile_options() == ScriptCompiler::kProduceParserCache) {
log_ = &recorder;
- } else if (cached_data_mode() == CONSUME_CACHED_DATA) {
+ } else if (compile_options() == ScriptCompiler::kConsumeParserCache) {
cached_parse_data_->Initialize();
}
@@ -776,7 +777,7 @@ FunctionLiteral* Parser::ParseProgram() {
}
PrintF(" - took %0.3f ms]\n", ms);
}
- if (cached_data_mode() == PRODUCE_CACHED_DATA) {
+ if (compile_options() == ScriptCompiler::kProduceParserCache) {
if (result != NULL) *info_->cached_data() = recorder.GetScriptData();
log_ = NULL;
}
@@ -3608,7 +3609,7 @@ void Parser::SkipLazyFunctionBody(const AstRawString* function_name,
int* expected_property_count,
bool* ok) {
int function_block_pos = position();
- if (cached_data_mode() == CONSUME_CACHED_DATA) {
+ if (compile_options() == ScriptCompiler::kConsumeParserCache) {
// If we have cached data, we use it to skip parsing the function body. The
// data contains the information we need to construct the lazy function.
FunctionEntry entry =
@@ -3658,7 +3659,7 @@ void Parser::SkipLazyFunctionBody(const AstRawString* function_name,
*materialized_literal_count = logger.literals();
*expected_property_count = logger.properties();
scope_->SetStrictMode(logger.strict_mode());
- if (cached_data_mode() == PRODUCE_CACHED_DATA) {
+ if (compile_options() == ScriptCompiler::kProduceParserCache) {
ASSERT(log_);
// Position right after terminal '}'.
int body_end = scanner()->location().end_pos;
« no previous file with comments | « src/parser.h ('k') | test/cctest/cctest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698