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

Side by Side Diff: src/api.cc

Issue 23295034: Add Chromium-style TimeDelta, Time and TimeTicks classes, and a new ElapsedTimer class. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 7 years, 3 months 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 | « no previous file | src/compiler.h » ('j') | src/time/time.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 7373 matching lines...) Expand 10 before | Expand all | Expand 10 after
7384 7384
7385 7385
7386 const CpuProfileNode* CpuProfile::GetSample(int index) const { 7386 const CpuProfileNode* CpuProfile::GetSample(int index) const {
7387 const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this); 7387 const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this);
7388 return reinterpret_cast<const CpuProfileNode*>(profile->sample(index)); 7388 return reinterpret_cast<const CpuProfileNode*>(profile->sample(index));
7389 } 7389 }
7390 7390
7391 7391
7392 int64_t CpuProfile::GetStartTime() const { 7392 int64_t CpuProfile::GetStartTime() const {
7393 const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this); 7393 const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this);
7394 return profile->start_time_us(); 7394 return (profile->start_time() - i::Time::UnixEpoch()).InMicroseconds();
7395 } 7395 }
7396 7396
7397 7397
7398 int64_t CpuProfile::GetEndTime() const { 7398 int64_t CpuProfile::GetEndTime() const {
7399 const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this); 7399 const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this);
7400 return profile->end_time_us(); 7400 return (profile->end_time() - i::Time::UnixEpoch()).InMicroseconds();
7401 } 7401 }
7402 7402
7403 7403
7404 int CpuProfile::GetSamplesCount() const { 7404 int CpuProfile::GetSamplesCount() const {
7405 return reinterpret_cast<const i::CpuProfile*>(this)->samples_count(); 7405 return reinterpret_cast<const i::CpuProfile*>(this)->samples_count();
7406 } 7406 }
7407 7407
7408 7408
7409 int CpuProfiler::GetProfileCount() { 7409 int CpuProfiler::GetProfileCount() {
7410 return reinterpret_cast<i::CpuProfiler*>(this)->GetProfilesCount(); 7410 return reinterpret_cast<i::CpuProfiler*>(this)->GetProfilesCount();
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
7945 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7945 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7946 Address callback_address = 7946 Address callback_address =
7947 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7947 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7948 VMState<EXTERNAL> state(isolate); 7948 VMState<EXTERNAL> state(isolate);
7949 ExternalCallbackScope call_scope(isolate, callback_address); 7949 ExternalCallbackScope call_scope(isolate, callback_address);
7950 return callback(info); 7950 return callback(info);
7951 } 7951 }
7952 7952
7953 7953
7954 } } // namespace v8::internal 7954 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/compiler.h » ('j') | src/time/time.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698