Index: src/codegen.cc |
diff --git a/src/codegen.cc b/src/codegen.cc |
index f0eec3f176642008ba5934c779c8b7b2c4095b2d..c9de2b1af16c666177617a5600ae30f5298a1a34 100644 |
--- a/src/codegen.cc |
+++ b/src/codegen.cc |
@@ -128,7 +128,7 @@ void CodeGenerator::MakeCodePrologue(CompilationInfo* info, const char* kind) { |
PrintF("%s", name == NULL ? "<unknown>" : name); |
} else { |
AllowDeferredHandleDereference allow_deference_for_trace; |
- PrintF("%s", info->function()->debug_name()->ToCString().get()); |
+ PrintF("%s", info->literal()->debug_name()->ToCString().get()); |
} |
PrintF("]\n"); |
} |
@@ -137,12 +137,12 @@ void CodeGenerator::MakeCodePrologue(CompilationInfo* info, const char* kind) { |
if (info->parse_info() && print_source) { |
PrintF("--- Source from AST ---\n%s\n", |
PrettyPrinter(info->isolate(), info->zone()) |
- .PrintProgram(info->function())); |
+ .PrintProgram(info->literal())); |
} |
if (info->parse_info() && print_ast) { |
PrintF("--- AST ---\n%s\n", AstPrinter(info->isolate(), info->zone()) |
- .PrintProgram(info->function())); |
+ .PrintProgram(info->literal())); |
} |
#endif // DEBUG |
} |
@@ -187,8 +187,7 @@ void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) { |
CodeStub::Major major_key = info->code_stub()->MajorKey(); |
debug_name = CodeStub::MajorName(major_key, false); |
} else { |
- debug_name_holder = |
- info->parse_info()->function()->debug_name()->ToCString(); |
+ debug_name_holder = info->literal()->debug_name()->ToCString(); |
debug_name = debug_name_holder.get(); |
} |
@@ -196,21 +195,20 @@ void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) { |
OFStream os(tracing_scope.file()); |
// Print the source code if available. |
- FunctionLiteral* function = nullptr; |
bool print_source = |
info->parse_info() && (code->kind() == Code::OPTIMIZED_FUNCTION || |
code->kind() == Code::FUNCTION); |
if (print_source) { |
- function = info->function(); |
+ FunctionLiteral* literal = info->literal(); |
Handle<Script> script = info->script(); |
if (!script->IsUndefined() && !script->source()->IsUndefined()) { |
os << "--- Raw source ---\n"; |
StringCharacterStream stream(String::cast(script->source()), |
- function->start_position()); |
+ literal->start_position()); |
// fun->end_position() points to the last character in the stream. We |
// need to compensate by adding one to calculate the length. |
int source_len = |
- function->end_position() - function->start_position() + 1; |
+ literal->end_position() - literal->start_position() + 1; |
for (int i = 0; i < source_len; i++) { |
if (stream.HasMore()) { |
os << AsReversiblyEscapedUC16(stream.GetNext()); |
@@ -230,7 +228,8 @@ void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) { |
os << "--- Code ---\n"; |
} |
if (print_source) { |
- os << "source_position = " << function->start_position() << "\n"; |
+ FunctionLiteral* literal = info->literal(); |
+ os << "source_position = " << literal->start_position() << "\n"; |
} |
code->Disassemble(debug_name, os); |
os << "--- End code ---\n"; |