Index: src/parser.cc |
diff --git a/src/parser.cc b/src/parser.cc |
index b8f89a1f460793102d31e607863e03ca584666f7..a9ca9bca9883c8cb38f44feeb672ed4562359052 100644 |
--- a/src/parser.cc |
+++ b/src/parser.cc |
@@ -202,7 +202,6 @@ |
bool ParseData::IsSane() { |
- if (!IsAligned(script_data_->length(), sizeof(unsigned))) return false; |
// Check that the header data is valid and doesn't specify |
// point to positions outside the store. |
int data_length = Length(); |
@@ -257,7 +256,7 @@ |
} else { |
DCHECK(info_->cached_data() != NULL); |
if (compile_options() == ScriptCompiler::kConsumeParserCache) { |
- cached_parse_data_ = ParseData::FromCachedData(*info_->cached_data()); |
+ cached_parse_data_ = new ParseData(*info_->cached_data()); |
} |
} |
} |
@@ -845,9 +844,9 @@ |
CompleteParserRecorder recorder; |
debug_saved_compile_options_ = compile_options(); |
- if (produce_cached_parse_data()) { |
+ if (compile_options() == ScriptCompiler::kProduceParserCache) { |
log_ = &recorder; |
- } else if (consume_cached_parse_data()) { |
+ } else if (compile_options() == ScriptCompiler::kConsumeParserCache) { |
cached_parse_data_->Initialize(); |
} |
@@ -888,7 +887,7 @@ |
} |
PrintF(" - took %0.3f ms]\n", ms); |
} |
- if (produce_cached_parse_data()) { |
+ if (compile_options() == ScriptCompiler::kProduceParserCache) { |
if (result != NULL) *info_->cached_data() = recorder.GetScriptData(); |
log_ = NULL; |
} |
@@ -3762,10 +3761,12 @@ |
CHECK(materialized_literal_count); |
CHECK(expected_property_count); |
CHECK(debug_saved_compile_options_ == compile_options()); |
- if (produce_cached_parse_data()) CHECK(log_); |
+ if (compile_options() == ScriptCompiler::kProduceParserCache) { |
+ CHECK(log_); |
+ } |
int function_block_pos = position(); |
- if (consume_cached_parse_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 = |
@@ -3813,7 +3814,7 @@ |
*materialized_literal_count = logger.literals(); |
*expected_property_count = logger.properties(); |
scope_->SetStrictMode(logger.strict_mode()); |
- if (produce_cached_parse_data()) { |
+ if (compile_options() == ScriptCompiler::kProduceParserCache) { |
DCHECK(log_); |
// Position right after terminal '}'. |
int body_end = scanner()->location().end_pos; |
@@ -4989,7 +4990,9 @@ |
CompleteParserRecorder recorder; |
debug_saved_compile_options_ = compile_options(); |
- if (produce_cached_parse_data()) log_ = &recorder; |
+ if (compile_options() == ScriptCompiler::kProduceParserCache) { |
+ log_ = &recorder; |
+ } |
DCHECK(info()->source_stream() != NULL); |
ExternalStreamingStream stream(info()->source_stream(), |
@@ -5017,7 +5020,7 @@ |
// We cannot internalize on a background thread; a foreground task will take |
// care of calling Parser::Internalize just before compilation. |
- if (produce_cached_parse_data()) { |
+ if (compile_options() == ScriptCompiler::kProduceParserCache) { |
if (result != NULL) *info_->cached_data() = recorder.GetScriptData(); |
log_ = NULL; |
} |