Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Side by Side Diff: src/compiler/pipeline.cc

Issue 916873002: Fix nasty off-by-one in the TurboFan JSON tracer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698