| 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 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 } | 1017 } |
| 1018 | 1018 |
| 1019 DCHECK(!info->is_debug() || !parse_info->allow_lazy_parsing()); | 1019 DCHECK(!info->is_debug() || !parse_info->allow_lazy_parsing()); |
| 1020 | 1020 |
| 1021 FunctionLiteral* lit = parse_info->literal(); | 1021 FunctionLiteral* lit = parse_info->literal(); |
| 1022 LiveEditFunctionTracker live_edit_tracker(isolate, lit); | 1022 LiveEditFunctionTracker live_edit_tracker(isolate, lit); |
| 1023 | 1023 |
| 1024 // Measure how long it takes to do the compilation; only take the | 1024 // Measure how long it takes to do the compilation; only take the |
| 1025 // rest of the function into account to avoid overlap with the | 1025 // rest of the function into account to avoid overlap with the |
| 1026 // parsing statistics. | 1026 // parsing statistics. |
| 1027 RuntimeCallTimerScope runtimeTimer( |
| 1028 isolate, parse_info->is_eval() ? &RuntimeCallStats::CompileEval |
| 1029 : &RuntimeCallStats::Compile); |
| 1027 HistogramTimer* rate = parse_info->is_eval() | 1030 HistogramTimer* rate = parse_info->is_eval() |
| 1028 ? info->isolate()->counters()->compile_eval() | 1031 ? info->isolate()->counters()->compile_eval() |
| 1029 : info->isolate()->counters()->compile(); | 1032 : info->isolate()->counters()->compile(); |
| 1030 HistogramTimerScope timer(rate); | 1033 HistogramTimerScope timer(rate); |
| 1031 TRACE_EVENT0("v8", parse_info->is_eval() ? "V8.CompileEval" : "V8.Compile"); | 1034 TRACE_EVENT0("v8", parse_info->is_eval() ? "V8.CompileEval" : "V8.Compile"); |
| 1032 | 1035 |
| 1033 // Allocate a shared function info object. | 1036 // Allocate a shared function info object. |
| 1034 DCHECK_EQ(RelocInfo::kNoPosition, lit->function_token_position()); | 1037 DCHECK_EQ(RelocInfo::kNoPosition, lit->function_token_position()); |
| 1035 result = NewSharedFunctionInfoForLiteral(isolate, lit, script); | 1038 result = NewSharedFunctionInfoForLiteral(isolate, lit, script); |
| 1036 result->set_is_toplevel(true); | 1039 result->set_is_toplevel(true); |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1757 MaybeHandle<Code> code; | 1760 MaybeHandle<Code> code; |
| 1758 if (cached.code != nullptr) code = handle(cached.code); | 1761 if (cached.code != nullptr) code = handle(cached.code); |
| 1759 Handle<Context> native_context(function->context()->native_context()); | 1762 Handle<Context> native_context(function->context()->native_context()); |
| 1760 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, | 1763 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, |
| 1761 literals, BailoutId::None()); | 1764 literals, BailoutId::None()); |
| 1762 } | 1765 } |
| 1763 } | 1766 } |
| 1764 | 1767 |
| 1765 } // namespace internal | 1768 } // namespace internal |
| 1766 } // namespace v8 | 1769 } // namespace v8 |
| OLD | NEW |