Chromium Code Reviews| Index: src/codegen.cc |
| diff --git a/src/codegen.cc b/src/codegen.cc |
| index b15324c8cf0ba6f98a7a8fa481f58bc2de0606bb..46ad56591701813280ee200ac914d446eef0df15 100644 |
| --- a/src/codegen.cc |
| +++ b/src/codegen.cc |
| @@ -134,7 +134,9 @@ void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) { |
| if (print_code) { |
| // Print the source code if available. |
| FunctionLiteral* function = info->function(); |
| - if (code->kind() == Code::OPTIMIZED_FUNCTION) { |
| + bool print_source = code->kind() == Code::OPTIMIZED_FUNCTION || |
| + code->kind() == Code::FUNCTION; |
|
Michael Starzinger
2013/10/18 13:04:21
nit: Indentation is off.
danno
2013/10/19 17:11:40
Done.
|
| + if (print_source) { |
| Handle<Script> script = info->script(); |
| if (!script->IsUndefined() && !script->source()->IsUndefined()) { |
| PrintF("--- Raw source ---\n"); |
| @@ -162,12 +164,16 @@ void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) { |
| } else { |
| PrintF("--- Code ---\n"); |
| } |
| + if (print_source) { |
| + PrintF("source_position = %d\n", function->start_position()); |
| + } |
| if (info->IsStub()) { |
| CodeStub::Major major_key = info->code_stub()->MajorKey(); |
| code->Disassemble(CodeStub::MajorName(major_key, false)); |
| } else { |
| code->Disassemble(*function->debug_name()->ToCString()); |
| } |
| + PrintF("--- End code ---\n"); |
| } |
| #endif // ENABLE_DISASSEMBLER |
| } |