| 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/compiler.h" | 5 #include "src/compiler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "src/ast/ast-numbering.h" | 9 #include "src/ast/ast-numbering.h" |
| 10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
| (...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 } | 1005 } |
| 1006 | 1006 |
| 1007 DCHECK(!info->is_debug() || !parse_info->allow_lazy_parsing()); | 1007 DCHECK(!info->is_debug() || !parse_info->allow_lazy_parsing()); |
| 1008 | 1008 |
| 1009 FunctionLiteral* lit = parse_info->literal(); | 1009 FunctionLiteral* lit = parse_info->literal(); |
| 1010 LiveEditFunctionTracker live_edit_tracker(isolate, lit); | 1010 LiveEditFunctionTracker live_edit_tracker(isolate, lit); |
| 1011 | 1011 |
| 1012 // Measure how long it takes to do the compilation; only take the | 1012 // Measure how long it takes to do the compilation; only take the |
| 1013 // rest of the function into account to avoid overlap with the | 1013 // rest of the function into account to avoid overlap with the |
| 1014 // parsing statistics. | 1014 // parsing statistics. |
| 1015 RuntimeCallTimerScope runtimeTimer( |
| 1016 isolate, parse_info->is_eval() ? &RuntimeCallStats::CompileEval |
| 1017 : &RuntimeCallStats::Compile); |
| 1015 HistogramTimer* rate = parse_info->is_eval() | 1018 HistogramTimer* rate = parse_info->is_eval() |
| 1016 ? info->isolate()->counters()->compile_eval() | 1019 ? info->isolate()->counters()->compile_eval() |
| 1017 : info->isolate()->counters()->compile(); | 1020 : info->isolate()->counters()->compile(); |
| 1018 HistogramTimerScope timer(rate); | 1021 HistogramTimerScope timer(rate); |
| 1019 TRACE_EVENT0("v8", parse_info->is_eval() ? "V8.CompileEval" : "V8.Compile"); | 1022 TRACE_EVENT0("v8", parse_info->is_eval() ? "V8.CompileEval" : "V8.Compile"); |
| 1020 | 1023 |
| 1021 // Allocate a shared function info object. | 1024 // Allocate a shared function info object. |
| 1022 DCHECK_EQ(RelocInfo::kNoPosition, lit->function_token_position()); | 1025 DCHECK_EQ(RelocInfo::kNoPosition, lit->function_token_position()); |
| 1023 result = NewSharedFunctionInfoForLiteral(isolate, lit, script); | 1026 result = NewSharedFunctionInfoForLiteral(isolate, lit, script); |
| 1024 result->set_is_toplevel(true); | 1027 result->set_is_toplevel(true); |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1736 MaybeHandle<Code> code; | 1739 MaybeHandle<Code> code; |
| 1737 if (cached.code != nullptr) code = handle(cached.code); | 1740 if (cached.code != nullptr) code = handle(cached.code); |
| 1738 Handle<Context> native_context(function->context()->native_context()); | 1741 Handle<Context> native_context(function->context()->native_context()); |
| 1739 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, | 1742 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, |
| 1740 literals, BailoutId::None()); | 1743 literals, BailoutId::None()); |
| 1741 } | 1744 } |
| 1742 } | 1745 } |
| 1743 | 1746 |
| 1744 } // namespace internal | 1747 } // namespace internal |
| 1745 } // namespace v8 | 1748 } // namespace v8 |
| OLD | NEW |