| Index: src/codegen.cc
|
| diff --git a/src/codegen.cc b/src/codegen.cc
|
| index b15324c8cf0ba6f98a7a8fa481f58bc2de0606bb..7b2f81ba8ab0e3ea85595fd18ec6d3664904e71e 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;
|
| + 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
|
| }
|
|
|