| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/pipeline.h" | 5 #include "src/compiler/pipeline.h" |
| 6 | 6 |
| 7 #include <fstream> // NOLINT(readability/streams) | 7 #include <fstream> // NOLINT(readability/streams) |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "src/base/platform/elapsed-timer.h" | 10 #include "src/base/platform/elapsed-timer.h" |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 Handle<Script> script = info()->script(); | 831 Handle<Script> script = info()->script(); |
| 832 FunctionLiteral* function = info()->function(); | 832 FunctionLiteral* function = info()->function(); |
| 833 SmartArrayPointer<char> function_name = | 833 SmartArrayPointer<char> function_name = |
| 834 info()->shared_info()->DebugName()->ToCString(); | 834 info()->shared_info()->DebugName()->ToCString(); |
| 835 int pos = info()->shared_info()->start_position(); | 835 int pos = info()->shared_info()->start_position(); |
| 836 json_of << "{\"function\":\"" << function_name.get() | 836 json_of << "{\"function\":\"" << function_name.get() |
| 837 << "\", \"sourcePosition\":" << pos << ", \"source\":\""; | 837 << "\", \"sourcePosition\":" << pos << ", \"source\":\""; |
| 838 if (!script->IsUndefined() && !script->source()->IsUndefined()) { | 838 if (!script->IsUndefined() && !script->source()->IsUndefined()) { |
| 839 DisallowHeapAllocation no_allocation; | 839 DisallowHeapAllocation no_allocation; |
| 840 int start = function->start_position(); | 840 int start = function->start_position(); |
| 841 int len = function->end_position() - start + 1; | 841 int len = function->end_position() - start; |
| 842 String::SubStringRange source(String::cast(script->source()), start, | 842 String::SubStringRange source(String::cast(script->source()), start, |
| 843 len); | 843 len); |
| 844 for (const auto& c : source) { | 844 for (const auto& c : source) { |
| 845 json_of << AsEscapedUC16ForJSON(c); | 845 json_of << AsEscapedUC16ForJSON(c); |
| 846 } | 846 } |
| 847 } | 847 } |
| 848 json_of << "\",\n\"phases\":["; | 848 json_of << "\",\n\"phases\":["; |
| 849 fclose(json_file); | 849 fclose(json_file); |
| 850 } | 850 } |
| 851 } | 851 } |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1176 | 1176 |
| 1177 if (FLAG_trace_turbo && !data->MayHaveUnverifiableGraph()) { | 1177 if (FLAG_trace_turbo && !data->MayHaveUnverifiableGraph()) { |
| 1178 TurboCfgFile tcf(data->isolate()); | 1178 TurboCfgFile tcf(data->isolate()); |
| 1179 tcf << AsC1VAllocator("CodeGen", data->register_allocator()); | 1179 tcf << AsC1VAllocator("CodeGen", data->register_allocator()); |
| 1180 } | 1180 } |
| 1181 } | 1181 } |
| 1182 | 1182 |
| 1183 } // namespace compiler | 1183 } // namespace compiler |
| 1184 } // namespace internal | 1184 } // namespace internal |
| 1185 } // namespace v8 | 1185 } // namespace v8 |
| OLD | NEW |