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

Unified Diff: src/d8.cc

Issue 1010233002: Make counter and histogram related callbacks part of the Isolate::CreateParams. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.cc
diff --git a/src/d8.cc b/src/d8.cc
index 7fa6f8c42e68a2cfd9de7f955da93229b94d1283..f28ff39ef354eb8a9436d9f3b4b31a48e7c467c3 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -963,15 +963,9 @@ Handle<ObjectTemplate> Shell::CreateGlobalTemplate(Isolate* isolate) {
void Shell::Initialize(Isolate* isolate) {
#ifndef V8_SHARED
- Shell::counter_map_ = new CounterMap();
// Set up counters
if (i::StrLength(i::FLAG_map_counters) != 0)
MapCounters(isolate, i::FLAG_map_counters);
- if (i::FLAG_dump_counters || i::FLAG_track_gc_object_stats) {
- isolate->SetCounterFunction(LookupCounter);
- isolate->SetCreateHistogramFunction(CreateHistogram);
- isolate->SetAddHistogramSampleFunction(AddHistogramSample);
- }
#endif // !V8_SHARED
}
@@ -1639,6 +1633,13 @@ int Shell::Main(int argc, char* argv[]) {
base::SysInfo::AmountOfPhysicalMemory(),
base::SysInfo::AmountOfVirtualMemory(),
base::SysInfo::NumberOfProcessors());
+
+ Shell::counter_map_ = new CounterMap();
+ if (i::FLAG_dump_counters || i::FLAG_track_gc_object_stats) {
+ create_params.counter_lookup_callback = LookupCounter;
+ create_params.create_histogram_callback = CreateHistogram;
+ create_params.add_histogram_sample_callback = AddHistogramSample;
+ }
#endif
Isolate* isolate = Isolate::New(create_params);
DumbLineEditor dumb_line_editor(isolate);
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698