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

Side by Side Diff: src/assembler.cc

Issue 5998001: 1. Added support for object printing for release mode using the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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 | Annotate | Revision Log
« no previous file with comments | « src/assembler.h ('k') | src/deoptimizer.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 (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 #endif 460 #endif
461 return "debug break slot"; 461 return "debug break slot";
462 case RelocInfo::NUMBER_OF_MODES: 462 case RelocInfo::NUMBER_OF_MODES:
463 UNREACHABLE(); 463 UNREACHABLE();
464 return "number_of_modes"; 464 return "number_of_modes";
465 } 465 }
466 return "unknown relocation type"; 466 return "unknown relocation type";
467 } 467 }
468 468
469 469
470 void RelocInfo::Print() { 470 void RelocInfo::Print(FILE* out) {
471 PrintF("%p %s", pc_, RelocModeName(rmode_)); 471 PrintF(out, "%p %s", pc_, RelocModeName(rmode_));
472 if (IsComment(rmode_)) { 472 if (IsComment(rmode_)) {
473 PrintF(" (%s)", reinterpret_cast<char*>(data_)); 473 PrintF(out, " (%s)", reinterpret_cast<char*>(data_));
474 } else if (rmode_ == EMBEDDED_OBJECT) { 474 } else if (rmode_ == EMBEDDED_OBJECT) {
475 PrintF(" ("); 475 PrintF(out, " (");
476 target_object()->ShortPrint(); 476 target_object()->ShortPrint(out);
477 PrintF(")"); 477 PrintF(out, ")");
478 } else if (rmode_ == EXTERNAL_REFERENCE) { 478 } else if (rmode_ == EXTERNAL_REFERENCE) {
479 ExternalReferenceEncoder ref_encoder; 479 ExternalReferenceEncoder ref_encoder;
480 PrintF(" (%s) (%p)", 480 PrintF(out, " (%s) (%p)",
481 ref_encoder.NameOfAddress(*target_reference_address()), 481 ref_encoder.NameOfAddress(*target_reference_address()),
482 *target_reference_address()); 482 *target_reference_address());
483 } else if (IsCodeTarget(rmode_)) { 483 } else if (IsCodeTarget(rmode_)) {
484 Code* code = Code::GetCodeFromTargetAddress(target_address()); 484 Code* code = Code::GetCodeFromTargetAddress(target_address());
485 PrintF(" (%s) (%p)", Code::Kind2String(code->kind()), target_address()); 485 PrintF(out, " (%s) (%p)", Code::Kind2String(code->kind()),
486 target_address());
486 } else if (IsPosition(rmode_)) { 487 } else if (IsPosition(rmode_)) {
487 PrintF(" (%" V8_PTR_PREFIX "d)", data()); 488 PrintF(out, " (%" V8_PTR_PREFIX "d)", data());
488 } else if (rmode_ == RelocInfo::RUNTIME_ENTRY) { 489 } else if (rmode_ == RelocInfo::RUNTIME_ENTRY) {
489 // Depotimization bailouts are stored as runtime entries. 490 // Depotimization bailouts are stored as runtime entries.
490 int id = Deoptimizer::GetDeoptimizationId( 491 int id = Deoptimizer::GetDeoptimizationId(
491 target_address(), Deoptimizer::EAGER); 492 target_address(), Deoptimizer::EAGER);
492 if (id != Deoptimizer::kNotDeoptimizationEntry) { 493 if (id != Deoptimizer::kNotDeoptimizationEntry) {
493 PrintF(" (deoptimization bailout %d)", id); 494 PrintF(out, " (deoptimization bailout %d)", id);
494 } 495 }
495 } 496 }
496 497
497 PrintF("\n"); 498 PrintF(out, "\n");
498 } 499 }
499 #endif // ENABLE_DISASSEMBLER 500 #endif // ENABLE_DISASSEMBLER
500 501
501 502
502 #ifdef DEBUG 503 #ifdef DEBUG
503 void RelocInfo::Verify() { 504 void RelocInfo::Verify() {
504 switch (rmode_) { 505 switch (rmode_) {
505 case EMBEDDED_OBJECT: 506 case EMBEDDED_OBJECT:
506 Object::VerifyPointer(target_object()); 507 Object::VerifyPointer(target_object());
507 break; 508 break;
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); 936 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position);
936 state_.written_position = state_.current_position; 937 state_.written_position = state_.current_position;
937 written = true; 938 written = true;
938 } 939 }
939 940
940 // Return whether something was written. 941 // Return whether something was written.
941 return written; 942 return written;
942 } 943 }
943 944
944 } } // namespace v8::internal 945 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/assembler.h ('k') | src/deoptimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698