Update V8 to r5447 as required by WebKit r67908
Change-Id: I5af6ccf18523cb7e28460e6bbc044444256cdb97
diff --git a/src/compiler.cc b/src/compiler.cc
index bf6d41d..f65f941 100755
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -269,10 +269,19 @@
}
if (result.is_null()) {
- // No cache entry found. Do pre-parsing and compile the script.
+ // No cache entry found. Do pre-parsing, if it makes sense, and compile
+ // the script.
+ // Building preparse data that is only used immediately after is only a
+ // saving if we might skip building the AST for lazily compiled functions.
+ // I.e., preparse data isn't relevant when the lazy flag is off, and
+ // for small sources, odds are that there aren't many functions
+ // that would be compiled lazily anyway, so we skip the preparse step
+ // in that case too.
ScriptDataImpl* pre_data = input_pre_data;
- if (pre_data == NULL && source_length >= FLAG_min_preparse_length) {
- pre_data = PreParse(source, NULL, extension);
+ if (pre_data == NULL
+ && FLAG_lazy
+ && source_length >= FLAG_min_preparse_length) {
+ pre_data = PartialPreParse(source, NULL, extension);
}
// Create a script object describing the script to be compiled.