| 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 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1371 LogMessageBuilder msg; | 1371 LogMessageBuilder msg; |
| 1372 msg.Append("code-info,%s,%d\n", arch, Code::kHeaderSize); | 1372 msg.Append("code-info,%s,%d\n", arch, Code::kHeaderSize); |
| 1373 msg.WriteToLogFile(); | 1373 msg.WriteToLogFile(); |
| 1374 #endif // ENABLE_LOGGING_AND_PROFILING | 1374 #endif // ENABLE_LOGGING_AND_PROFILING |
| 1375 } | 1375 } |
| 1376 | 1376 |
| 1377 | 1377 |
| 1378 void Logger::LowLevelCodeCreateEvent(Code* code, LogMessageBuilder* msg) { | 1378 void Logger::LowLevelCodeCreateEvent(Code* code, LogMessageBuilder* msg) { |
| 1379 if (!FLAG_ll_prof || Log::output_code_handle_ == NULL) return; | 1379 if (!FLAG_ll_prof || Log::output_code_handle_ == NULL) return; |
| 1380 int pos = static_cast<int>(ftell(Log::output_code_handle_)); | 1380 int pos = static_cast<int>(ftell(Log::output_code_handle_)); |
| 1381 fwrite(code->instruction_start(), 1, code->instruction_size(), | 1381 int rv = fwrite(code->instruction_start(), 1, code->instruction_size(), |
| 1382 Log::output_code_handle_); | 1382 Log::output_code_handle_); |
| 1383 ASSERT(static_cast<size_t>(code->instruction_size()) == rv); |
| 1384 USE(rv); |
| 1383 msg->Append(",%d", pos); | 1385 msg->Append(",%d", pos); |
| 1384 } | 1386 } |
| 1385 | 1387 |
| 1386 | 1388 |
| 1387 void Logger::LogCodeObjects() { | 1389 void Logger::LogCodeObjects() { |
| 1388 AssertNoAllocation no_alloc; | 1390 AssertNoAllocation no_alloc; |
| 1389 HeapIterator iterator; | 1391 HeapIterator iterator; |
| 1390 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { | 1392 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { |
| 1391 if (obj->IsCode()) LogCodeObject(obj); | 1393 if (obj->IsCode()) LogCodeObject(obj); |
| 1392 } | 1394 } |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1639 } | 1641 } |
| 1640 // Otherwise, if the sliding state window computation has not been | 1642 // Otherwise, if the sliding state window computation has not been |
| 1641 // started we do it now. | 1643 // started we do it now. |
| 1642 if (sliding_state_window_ == NULL) { | 1644 if (sliding_state_window_ == NULL) { |
| 1643 sliding_state_window_ = new SlidingStateWindow(); | 1645 sliding_state_window_ = new SlidingStateWindow(); |
| 1644 } | 1646 } |
| 1645 #endif | 1647 #endif |
| 1646 } | 1648 } |
| 1647 | 1649 |
| 1648 } } // namespace v8::internal | 1650 } } // namespace v8::internal |
| OLD | NEW |