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

Unified Diff: src/codegen.cc

Issue 1901753002: [compiler] Switch code printing to not use literal. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen.cc
diff --git a/src/codegen.cc b/src/codegen.cc
index 68b71e31b24c7aa725a45e030e11dc2e352d346d..93ae30796296dcc0b8774c1ceeb5ee049b28a852 100644
--- a/src/codegen.cc
+++ b/src/codegen.cc
@@ -161,20 +161,16 @@ void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) {
bool print_source =
info->parse_info() && (code->kind() == Code::OPTIMIZED_FUNCTION ||
code->kind() == Code::FUNCTION);
- // TODO(mstarzinger): Switch this over to use SharedFunctionInfo instead of
- // the FunctionLiteral, once we have a SharedFunctionInfo for live edit.
- print_source = print_source && info->literal() != nullptr;
if (print_source) {
- FunctionLiteral* literal = info->literal();
+ Handle<SharedFunctionInfo> shared = info->shared_info();
Handle<Script> script = info->script();
if (!script->IsUndefined() && !script->source()->IsUndefined()) {
os << "--- Raw source ---\n";
StringCharacterStream stream(String::cast(script->source()),
- literal->start_position());
+ shared->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 =
- literal->end_position() - literal->start_position() + 1;
+ int source_len = shared->end_position() - shared->start_position() + 1;
for (int i = 0; i < source_len; i++) {
if (stream.HasMore()) {
os << AsReversiblyEscapedUC16(stream.GetNext());
@@ -194,8 +190,8 @@ void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) {
os << "--- Code ---\n";
}
if (print_source) {
- FunctionLiteral* literal = info->literal();
- os << "source_position = " << literal->start_position() << "\n";
+ Handle<SharedFunctionInfo> shared = info->shared_info();
+ os << "source_position = " << shared->start_position() << "\n";
}
code->Disassemble(debug_name.get(), os);
os << "--- End code ---\n";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698