OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |