OLD | NEW |
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/compiler.h" | 7 #include "src/compiler.h" |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 | 1003 |
1004 info->MarkAsToplevel(); | 1004 info->MarkAsToplevel(); |
1005 | 1005 |
1006 Handle<SharedFunctionInfo> result; | 1006 Handle<SharedFunctionInfo> result; |
1007 | 1007 |
1008 { VMState<COMPILER> state(info->isolate()); | 1008 { VMState<COMPILER> state(info->isolate()); |
1009 if (info->function() == NULL) { | 1009 if (info->function() == NULL) { |
1010 // Parse the script if needed (if it's already parsed, function() is | 1010 // Parse the script if needed (if it's already parsed, function() is |
1011 // non-NULL). | 1011 // non-NULL). |
1012 bool parse_allow_lazy = | 1012 bool parse_allow_lazy = |
1013 (info->compile_options() == ScriptCompiler::kConsumeParserCache || | 1013 (FLAG_lazy && |
1014 String::cast(script->source())->length() > | 1014 (info->compile_options() == ScriptCompiler::kConsumeParserCache || |
1015 FLAG_min_preparse_length) && | 1015 String::cast(script->source())->length() > |
1016 !Compiler::DebuggerWantsEagerCompilation(info); | 1016 FLAG_min_preparse_length) && |
| 1017 !Compiler::DebuggerWantsEagerCompilation(info)); |
1017 | 1018 |
1018 if (!parse_allow_lazy && | 1019 if (!parse_allow_lazy && |
1019 (info->compile_options() == ScriptCompiler::kProduceParserCache || | 1020 (info->compile_options() == ScriptCompiler::kProduceParserCache || |
1020 info->compile_options() == ScriptCompiler::kConsumeParserCache)) { | 1021 info->compile_options() == ScriptCompiler::kConsumeParserCache)) { |
1021 // We are going to parse eagerly, but we either 1) have cached data | 1022 // We are going to parse eagerly, but we either 1) have cached data |
1022 // produced by lazy parsing or 2) are asked to generate cached data. | 1023 // produced by lazy parsing or 2) are asked to generate cached data. |
1023 // Eager parsing cannot benefit from cached data, and producing cached | 1024 // Eager parsing cannot benefit from cached data, and producing cached |
1024 // data while parsing eagerly is not implemented. | 1025 // data while parsing eagerly is not implemented. |
1025 info->SetCachedData(NULL, ScriptCompiler::kNoCompileOptions); | 1026 info->SetCachedData(NULL, ScriptCompiler::kNoCompileOptions); |
1026 } | 1027 } |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1438 AllowHandleDereference allow_deref; | 1439 AllowHandleDereference allow_deref; |
1439 bool tracing_on = info()->IsStub() | 1440 bool tracing_on = info()->IsStub() |
1440 ? FLAG_trace_hydrogen_stubs | 1441 ? FLAG_trace_hydrogen_stubs |
1441 : (FLAG_trace_hydrogen && | 1442 : (FLAG_trace_hydrogen && |
1442 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1443 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1443 return (tracing_on && | 1444 return (tracing_on && |
1444 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1445 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1445 } | 1446 } |
1446 | 1447 |
1447 } } // namespace v8::internal | 1448 } } // namespace v8::internal |
OLD | NEW |