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

Side by Side Diff: src/compiler/code-generator.cc

Issue 2071753002: Fix FLAG_code_comments crash for WASM functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/address-map.h" 7 #include "src/address-map.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/linkage.h" 9 #include "src/compiler/linkage.h"
10 #include "src/compiler/pipeline.h" 10 #include "src/compiler/pipeline.h"
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 void CodeGenerator::AssembleSourcePosition(Instruction* instr) { 394 void CodeGenerator::AssembleSourcePosition(Instruction* instr) {
395 SourcePosition source_position; 395 SourcePosition source_position;
396 if (!code()->GetSourcePosition(instr, &source_position)) return; 396 if (!code()->GetSourcePosition(instr, &source_position)) return;
397 if (source_position == current_source_position_) return; 397 if (source_position == current_source_position_) return;
398 current_source_position_ = source_position; 398 current_source_position_ = source_position;
399 if (source_position.IsUnknown()) return; 399 if (source_position.IsUnknown()) return;
400 int code_pos = source_position.raw(); 400 int code_pos = source_position.raw();
401 masm()->positions_recorder()->RecordPosition(code_pos); 401 masm()->positions_recorder()->RecordPosition(code_pos);
402 masm()->positions_recorder()->WriteRecordedPositions(); 402 masm()->positions_recorder()->WriteRecordedPositions();
403 if (FLAG_code_comments) { 403 if (FLAG_code_comments) {
404 CompilationInfo* info = this->info();
405 if (!info->parse_info()) return;
404 Vector<char> buffer = Vector<char>::New(256); 406 Vector<char> buffer = Vector<char>::New(256);
405 CompilationInfo* info = this->info();
406 int ln = Script::GetLineNumber(info->script(), code_pos); 407 int ln = Script::GetLineNumber(info->script(), code_pos);
407 int cn = Script::GetColumnNumber(info->script(), code_pos); 408 int cn = Script::GetColumnNumber(info->script(), code_pos);
408 if (info->script()->name()->IsString()) { 409 if (info->script()->name()->IsString()) {
409 Handle<String> file(String::cast(info->script()->name())); 410 Handle<String> file(String::cast(info->script()->name()));
410 base::OS::SNPrintF(buffer.start(), buffer.length(), "-- %s:%d:%d --", 411 base::OS::SNPrintF(buffer.start(), buffer.length(), "-- %s:%d:%d --",
411 file->ToCString().get(), ln, cn); 412 file->ToCString().get(), ln, cn);
412 } else { 413 } else {
413 base::OS::SNPrintF(buffer.start(), buffer.length(), 414 base::OS::SNPrintF(buffer.start(), buffer.length(),
414 "-- <unknown>:%d:%d --", ln, cn); 415 "-- <unknown>:%d:%d --", ln, cn);
415 } 416 }
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { 816 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) {
816 gen->ools_ = this; 817 gen->ools_ = this;
817 } 818 }
818 819
819 820
820 OutOfLineCode::~OutOfLineCode() {} 821 OutOfLineCode::~OutOfLineCode() {}
821 822
822 } // namespace compiler 823 } // namespace compiler
823 } // namespace internal 824 } // namespace internal
824 } // namespace v8 825 } // 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