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

Side by Side Diff: src/api.cc

Issue 186163002: Add support for allowing an embedder to get the V8 profile timer event logs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove check for an existing event_logger, as at this point, none might have already been set Created 6 years, 9 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 | « include/v8.h ('k') | src/counters.cc » ('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 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 6403 matching lines...) Expand 10 before | Expand all | Expand 10 after
6414 i::Heap* heap = isolate->heap(); 6414 i::Heap* heap = isolate->heap();
6415 heap_statistics->total_heap_size_ = heap->CommittedMemory(); 6415 heap_statistics->total_heap_size_ = heap->CommittedMemory();
6416 heap_statistics->total_heap_size_executable_ = 6416 heap_statistics->total_heap_size_executable_ =
6417 heap->CommittedMemoryExecutable(); 6417 heap->CommittedMemoryExecutable();
6418 heap_statistics->total_physical_size_ = heap->CommittedPhysicalMemory(); 6418 heap_statistics->total_physical_size_ = heap->CommittedPhysicalMemory();
6419 heap_statistics->used_heap_size_ = heap->SizeOfObjects(); 6419 heap_statistics->used_heap_size_ = heap->SizeOfObjects();
6420 heap_statistics->heap_size_limit_ = heap->MaxReserved(); 6420 heap_statistics->heap_size_limit_ = heap->MaxReserved();
6421 } 6421 }
6422 6422
6423 6423
6424 void Isolate::SetEventLogger(LogEventCallback that) {
6425 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
6426 isolate->set_event_logger(that);
6427 }
6428
6424 String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj) 6429 String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj)
6425 : str_(NULL), length_(0) { 6430 : str_(NULL), length_(0) {
6426 i::Isolate* isolate = i::Isolate::Current(); 6431 i::Isolate* isolate = i::Isolate::Current();
6427 if (obj.IsEmpty()) return; 6432 if (obj.IsEmpty()) return;
6428 ENTER_V8(isolate); 6433 ENTER_V8(isolate);
6429 i::HandleScope scope(isolate); 6434 i::HandleScope scope(isolate);
6430 TryCatch try_catch; 6435 TryCatch try_catch;
6431 Handle<String> str = obj->ToString(); 6436 Handle<String> str = obj->ToString();
6432 if (str.IsEmpty()) return; 6437 if (str.IsEmpty()) return;
6433 i::Handle<i::String> i_str = Utils::OpenHandle(*str); 6438 i::Handle<i::String> i_str = Utils::OpenHandle(*str);
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
7377 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7382 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7378 Address callback_address = 7383 Address callback_address =
7379 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7384 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7380 VMState<EXTERNAL> state(isolate); 7385 VMState<EXTERNAL> state(isolate);
7381 ExternalCallbackScope call_scope(isolate, callback_address); 7386 ExternalCallbackScope call_scope(isolate, callback_address);
7382 callback(info); 7387 callback(info);
7383 } 7388 }
7384 7389
7385 7390
7386 } } // namespace v8::internal 7391 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/counters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698