| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 void LogMessageBuilder::Append(String* str) { | 331 void LogMessageBuilder::Append(String* str) { |
| 332 AssertNoAllocation no_heap_allocation; // Ensure string stay valid. | 332 AssertNoAllocation no_heap_allocation; // Ensure string stay valid. |
| 333 int length = str->length(); | 333 int length = str->length(); |
| 334 for (int i = 0; i < length; i++) { | 334 for (int i = 0; i < length; i++) { |
| 335 Append(static_cast<char>(str->Get(i))); | 335 Append(static_cast<char>(str->Get(i))); |
| 336 } | 336 } |
| 337 } | 337 } |
| 338 | 338 |
| 339 | 339 |
| 340 void LogMessageBuilder::AppendAddress(Address addr) { | 340 void LogMessageBuilder::AppendAddress(Address addr) { |
| 341 static Address last_address_ = NULL; | 341 AppendAddress(addr, log_->logger_->last_address_); |
| 342 AppendAddress(addr, last_address_); | 342 log_->logger_->last_address_ = addr; |
| 343 last_address_ = addr; | |
| 344 } | 343 } |
| 345 | 344 |
| 346 | 345 |
| 347 void LogMessageBuilder::AppendAddress(Address addr, Address bias) { | 346 void LogMessageBuilder::AppendAddress(Address addr, Address bias) { |
| 348 if (!FLAG_compress_log) { | 347 if (!FLAG_compress_log) { |
| 349 Append("0x%" V8PRIxPTR, addr); | 348 Append("0x%" V8PRIxPTR, addr); |
| 350 } else if (bias == NULL) { | 349 } else if (bias == NULL) { |
| 351 Append("%" V8PRIxPTR, addr); | 350 Append("%" V8PRIxPTR, addr); |
| 352 } else { | 351 } else { |
| 353 uintptr_t delta; | 352 uintptr_t delta; |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 PrintBackwardReference(backref, best.distance, best.copy_from_pos); | 571 PrintBackwardReference(backref, best.distance, best.copy_from_pos); |
| 573 ASSERT(strlen(backref.start()) - best.backref_size == 0); | 572 ASSERT(strlen(backref.start()) - best.backref_size == 0); |
| 574 prev_record->Truncate(static_cast<int>(unchanged_len + best.backref_size)); | 573 prev_record->Truncate(static_cast<int>(unchanged_len + best.backref_size)); |
| 575 } | 574 } |
| 576 return true; | 575 return true; |
| 577 } | 576 } |
| 578 | 577 |
| 579 #endif // ENABLE_LOGGING_AND_PROFILING | 578 #endif // ENABLE_LOGGING_AND_PROFILING |
| 580 | 579 |
| 581 } } // namespace v8::internal | 580 } } // namespace v8::internal |
| OLD | NEW |