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

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: addressed comment 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 | « src/assembler.cc ('k') | src/crankshaft/arm/lithium-codegen-arm.cc » ('j') | 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 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 CompilationInfo* info = this->info(); 403 CompilationInfo* info = this->info();
405 if (!info->parse_info()) return; 404 if (!info->parse_info()) return;
406 Vector<char> buffer = Vector<char>::New(256); 405 Vector<char> buffer = Vector<char>::New(256);
407 int ln = Script::GetLineNumber(info->script(), code_pos); 406 int ln = Script::GetLineNumber(info->script(), code_pos);
408 int cn = Script::GetColumnNumber(info->script(), code_pos); 407 int cn = Script::GetColumnNumber(info->script(), code_pos);
409 if (info->script()->name()->IsString()) { 408 if (info->script()->name()->IsString()) {
410 Handle<String> file(String::cast(info->script()->name())); 409 Handle<String> file(String::cast(info->script()->name()));
411 base::OS::SNPrintF(buffer.start(), buffer.length(), "-- %s:%d:%d --", 410 base::OS::SNPrintF(buffer.start(), buffer.length(), "-- %s:%d:%d --",
412 file->ToCString().get(), ln, cn); 411 file->ToCString().get(), ln, cn);
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { 815 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) {
817 gen->ools_ = this; 816 gen->ools_ = this;
818 } 817 }
819 818
820 819
821 OutOfLineCode::~OutOfLineCode() {} 820 OutOfLineCode::~OutOfLineCode() {}
822 821
823 } // namespace compiler 822 } // namespace compiler
824 } // namespace internal 823 } // namespace internal
825 } // namespace v8 824 } // namespace v8
OLDNEW
« no previous file with comments | « src/assembler.cc ('k') | src/crankshaft/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698