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

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

Issue 2072963003: Simplify AssemblerPositionsRecorder. (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
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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 392
393 393
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();
403 if (FLAG_code_comments) { 402 if (FLAG_code_comments) {
404 Vector<char> buffer = Vector<char>::New(256); 403 Vector<char> buffer = Vector<char>::New(256);
405 CompilationInfo* info = this->info(); 404 CompilationInfo* info = this->info();
406 int ln = Script::GetLineNumber(info->script(), code_pos); 405 int ln = Script::GetLineNumber(info->script(), code_pos);
407 int cn = Script::GetColumnNumber(info->script(), code_pos); 406 int cn = Script::GetColumnNumber(info->script(), code_pos);
408 if (info->script()->name()->IsString()) { 407 if (info->script()->name()->IsString()) {
409 Handle<String> file(String::cast(info->script()->name())); 408 Handle<String> file(String::cast(info->script()->name()));
410 base::OS::SNPrintF(buffer.start(), buffer.length(), "-- %s:%d:%d --", 409 base::OS::SNPrintF(buffer.start(), buffer.length(), "-- %s:%d:%d --",
411 file->ToCString().get(), ln, cn); 410 file->ToCString().get(), ln, cn);
412 } else { 411 } else {
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { 814 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) {
816 gen->ools_ = this; 815 gen->ools_ = this;
817 } 816 }
818 817
819 818
820 OutOfLineCode::~OutOfLineCode() {} 819 OutOfLineCode::~OutOfLineCode() {}
821 820
822 } // namespace compiler 821 } // namespace compiler
823 } // namespace internal 822 } // namespace internal
824 } // namespace v8 823 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698