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

Side by Side Diff: src/codegen.cc

Issue 5959003: Extend code printing: (Closed)
Patch Set: Created 10 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 stream.Seek(function->start_position()); 208 stream.Seek(function->start_position());
209 // fun->end_position() points to the last character in the stream. We 209 // fun->end_position() points to the last character in the stream. We
210 // need to compensate by adding one to calculate the length. 210 // need to compensate by adding one to calculate the length.
211 int source_len = 211 int source_len =
212 function->end_position() - function->start_position() + 1; 212 function->end_position() - function->start_position() + 1;
213 for (int i = 0; i < source_len; i++) { 213 for (int i = 0; i < source_len; i++) {
214 if (stream.has_more()) PrintF("%c", stream.GetNext()); 214 if (stream.has_more()) PrintF("%c", stream.GetNext());
215 } 215 }
216 PrintF("\n\n"); 216 PrintF("\n\n");
217 } 217 }
218 PrintF("--- Code ---\n"); 218 if (info->IsOptimizing()) {
219 code->Disassemble(*function->name()->ToCString()); 219 if (FLAG_print_unopt_code) {
220 PrintF("--- Unoptimized code ---\n");
221 info->closure()->shared()->code()->Disassemble(
222 *function->debug_name()->ToCString());
223 }
224 PrintF("--- Optimized code ---\n");
225 } else {
226 PrintF("--- Code ---\n");
227 }
228 code->Disassemble(*function->debug_name()->ToCString());
220 } 229 }
221 #endif // ENABLE_DISASSEMBLER 230 #endif // ENABLE_DISASSEMBLER
222 } 231 }
223 232
224 233
225 // Generate the code. Compile the AST and assemble all the pieces into a 234 // Generate the code. Compile the AST and assemble all the pieces into a
226 // Code object. 235 // Code object.
227 bool CodeGenerator::MakeCode(CompilationInfo* info) { 236 bool CodeGenerator::MakeCode(CompilationInfo* info) {
228 // When using Crankshaft the classic backend should never be used. 237 // When using Crankshaft the classic backend should never be used.
229 ASSERT(!V8::UseCrankshaft()); 238 ASSERT(!V8::UseCrankshaft());
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 int result = save_doubles_ ? 1 : 0; 476 int result = save_doubles_ ? 1 : 0;
468 #ifdef _WIN64 477 #ifdef _WIN64
469 return result | ((result_size_ == 1) ? 0 : 2); 478 return result | ((result_size_ == 1) ? 0 : 2);
470 #else 479 #else
471 return result; 480 return result;
472 #endif 481 #endif
473 } 482 }
474 483
475 484
476 } } // namespace v8::internal 485 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698