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/ast-numbering.h" | 9 #include "src/ast-numbering.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 // aggressive about lazy compilation, because it might trigger compilation | 1287 // aggressive about lazy compilation, because it might trigger compilation |
1288 // of functions without an outer context when setting a breakpoint through | 1288 // of functions without an outer context when setting a breakpoint through |
1289 // Debug::FindSharedFunctionInfoInScript. | 1289 // Debug::FindSharedFunctionInfoInScript. |
1290 bool allow_lazy_without_ctx = literal->AllowsLazyCompilationWithoutContext(); | 1290 bool allow_lazy_without_ctx = literal->AllowsLazyCompilationWithoutContext(); |
1291 bool allow_lazy = literal->AllowsLazyCompilation() && | 1291 bool allow_lazy = literal->AllowsLazyCompilation() && |
1292 !DebuggerWantsEagerCompilation(&info, allow_lazy_without_ctx); | 1292 !DebuggerWantsEagerCompilation(&info, allow_lazy_without_ctx); |
1293 | 1293 |
1294 | 1294 |
1295 if (outer_info->is_toplevel() && outer_info->will_serialize()) { | 1295 if (outer_info->is_toplevel() && outer_info->will_serialize()) { |
1296 // Make sure that if the toplevel code (possibly to be serialized), | 1296 // Make sure that if the toplevel code (possibly to be serialized), |
1297 // the inner function must be allowed to be compiled lazily. | 1297 // the inner unction must be allowed to be compiled lazily. |
1298 DCHECK(allow_lazy); | 1298 DCHECK(allow_lazy); |
1299 } | 1299 } |
1300 | 1300 |
1301 // Generate code | 1301 // Generate code |
1302 Handle<ScopeInfo> scope_info; | 1302 Handle<ScopeInfo> scope_info; |
1303 if (FLAG_lazy && allow_lazy && !literal->is_parenthesized()) { | 1303 if (FLAG_lazy && allow_lazy && !literal->is_parenthesized()) { |
1304 Handle<Code> code = isolate->builtins()->CompileLazy(); | 1304 Handle<Code> code = isolate->builtins()->CompileLazy(); |
1305 info.SetCode(code); | 1305 info.SetCode(code); |
1306 scope_info = Handle<ScopeInfo>(ScopeInfo::Empty(isolate)); | 1306 scope_info = Handle<ScopeInfo>(ScopeInfo::Empty(isolate)); |
1307 } else if (FullCodeGenerator::MakeCode(&info)) { | 1307 } else if (FullCodeGenerator::MakeCode(&info)) { |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1457 AllowHandleDereference allow_deref; | 1457 AllowHandleDereference allow_deref; |
1458 bool tracing_on = info()->IsStub() | 1458 bool tracing_on = info()->IsStub() |
1459 ? FLAG_trace_hydrogen_stubs | 1459 ? FLAG_trace_hydrogen_stubs |
1460 : (FLAG_trace_hydrogen && | 1460 : (FLAG_trace_hydrogen && |
1461 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1461 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1462 return (tracing_on && | 1462 return (tracing_on && |
1463 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1463 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1464 } | 1464 } |
1465 | 1465 |
1466 } } // namespace v8::internal | 1466 } } // namespace v8::internal |
OLD | NEW |