OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 double last_wall_time_; | 393 double last_wall_time_; |
394 | 394 |
395 DISALLOW_COPY_AND_ASSIGN(SampleRateCalculator); | 395 DISALLOW_COPY_AND_ASSIGN(SampleRateCalculator); |
396 }; | 396 }; |
397 | 397 |
398 | 398 |
399 class ProfileGenerator { | 399 class ProfileGenerator { |
400 public: | 400 public: |
401 explicit ProfileGenerator(CpuProfilesCollection* profiles); | 401 explicit ProfileGenerator(CpuProfilesCollection* profiles); |
402 | 402 |
403 INLINE(CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, | |
404 Name* name, | |
405 String* resource_name, | |
406 int line_number)) { | |
407 return profiles_->NewCodeEntry(tag, name, resource_name, line_number); | |
408 } | |
409 | |
410 INLINE(CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, | |
411 const char* name)) { | |
412 return profiles_->NewCodeEntry(tag, name); | |
413 } | |
414 | |
415 INLINE(CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, | |
416 const char* name_prefix, | |
417 Name* name)) { | |
418 return profiles_->NewCodeEntry(tag, name_prefix, name); | |
419 } | |
420 | |
421 INLINE(CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, | |
422 int args_count)) { | |
423 return profiles_->NewCodeEntry(tag, args_count); | |
424 } | |
425 | |
426 INLINE(CodeEntry* NewCodeEntry(int security_token_id)) { | |
427 return profiles_->NewCodeEntry(security_token_id); | |
428 } | |
429 | |
430 void RecordTickSample(const TickSample& sample); | 403 void RecordTickSample(const TickSample& sample); |
431 | 404 |
432 INLINE(CodeMap* code_map()) { return &code_map_; } | 405 INLINE(CodeMap* code_map()) { return &code_map_; } |
433 | 406 |
434 INLINE(void Tick()) { sample_rate_calc_.Tick(); } | 407 INLINE(void Tick()) { sample_rate_calc_.Tick(); } |
435 INLINE(double actual_sampling_rate()) { | 408 INLINE(double actual_sampling_rate()) { |
436 return sample_rate_calc_.ticks_per_ms(); | 409 return sample_rate_calc_.ticks_per_ms(); |
437 } | 410 } |
438 | 411 |
439 static const char* const kAnonymousFunctionName; | 412 static const char* const kAnonymousFunctionName; |
440 static const char* const kProgramEntryName; | 413 static const char* const kProgramEntryName; |
441 static const char* const kGarbageCollectorEntryName; | 414 static const char* const kGarbageCollectorEntryName; |
442 | 415 |
443 private: | 416 private: |
444 INLINE(CodeEntry* EntryForVMState(StateTag tag)); | 417 INLINE(CodeEntry* EntryForVMState(StateTag tag)); |
445 | 418 |
446 CpuProfilesCollection* profiles_; | 419 CpuProfilesCollection* profiles_; |
447 CodeMap code_map_; | 420 CodeMap code_map_; |
448 CodeEntry* program_entry_; | 421 CodeEntry* program_entry_; |
449 CodeEntry* gc_entry_; | 422 CodeEntry* gc_entry_; |
450 SampleRateCalculator sample_rate_calc_; | 423 SampleRateCalculator sample_rate_calc_; |
451 | 424 |
452 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); | 425 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); |
453 }; | 426 }; |
454 | 427 |
455 | 428 |
456 } } // namespace v8::internal | 429 } } // namespace v8::internal |
457 | 430 |
458 #endif // V8_PROFILE_GENERATOR_H_ | 431 #endif // V8_PROFILE_GENERATOR_H_ |
OLD | NEW |