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

Side by Side Diff: src/d8.cc

Issue 1817033002: [Interpreter] Add dispatch counters for each bytecode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@fix-abort
Patch Set: Created 4 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
« no previous file with comments | « src/bailout-reason.h ('k') | src/external-reference-table.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 // Defined when linking against shared lib on Windows. 6 // Defined when linking against shared lib on Windows.
7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED)
8 #define V8_SHARED 8 #define V8_SHARED
9 #endif 9 #endif
10 10
11 #include <errno.h> 11 #include <errno.h>
12 #include <inttypes.h>
12 #include <stdlib.h> 13 #include <stdlib.h>
13 #include <string.h> 14 #include <string.h>
14 #include <sys/stat.h> 15 #include <sys/stat.h>
15 16
16 #ifdef V8_SHARED 17 #ifdef V8_SHARED
17 #include <assert.h> 18 #include <assert.h>
18 #endif // V8_SHARED 19 #endif // V8_SHARED
19 20
20 #ifndef V8_SHARED 21 #ifndef V8_SHARED
21 #include <algorithm> 22 #include <algorithm>
(...skipping 12 matching lines...) Expand all
34 #include "src/ostreams.h" 35 #include "src/ostreams.h"
35 36
36 #include "include/libplatform/libplatform.h" 37 #include "include/libplatform/libplatform.h"
37 #ifndef V8_SHARED 38 #ifndef V8_SHARED
38 #include "src/api.h" 39 #include "src/api.h"
39 #include "src/base/cpu.h" 40 #include "src/base/cpu.h"
40 #include "src/base/logging.h" 41 #include "src/base/logging.h"
41 #include "src/base/platform/platform.h" 42 #include "src/base/platform/platform.h"
42 #include "src/base/sys-info.h" 43 #include "src/base/sys-info.h"
43 #include "src/basic-block-profiler.h" 44 #include "src/basic-block-profiler.h"
45 #include "src/interpreter/interpreter.h"
44 #include "src/snapshot/natives.h" 46 #include "src/snapshot/natives.h"
45 #include "src/utils.h" 47 #include "src/utils.h"
46 #include "src/v8.h" 48 #include "src/v8.h"
47 #endif // !V8_SHARED 49 #endif // !V8_SHARED
48 50
49 #if !defined(_WIN32) && !defined(_WIN64) 51 #if !defined(_WIN32) && !defined(_WIN64)
50 #include <unistd.h> // NOLINT 52 #include <unistd.h> // NOLINT
51 #else 53 #else
52 #include <windows.h> // NOLINT 54 #include <windows.h> // NOLINT
53 #if defined(_MSC_VER) 55 #if defined(_MSC_VER)
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1328 for (j = 0; j < number_of_counters; j++) { 1330 for (j = 0; j < number_of_counters; j++) {
1329 Counter* counter = counters[j].counter; 1331 Counter* counter = counters[j].counter;
1330 const char* key = counters[j].key; 1332 const char* key = counters[j].key;
1331 if (counter->is_histogram()) { 1333 if (counter->is_histogram()) {
1332 printf("| c:%-60s | %11i |\n", key, counter->count()); 1334 printf("| c:%-60s | %11i |\n", key, counter->count());
1333 printf("| t:%-60s | %11i |\n", key, counter->sample_total()); 1335 printf("| t:%-60s | %11i |\n", key, counter->sample_total());
1334 } else { 1336 } else {
1335 printf("| %-62s | %11i |\n", key, counter->count()); 1337 printf("| %-62s | %11i |\n", key, counter->count());
1336 } 1338 }
1337 } 1339 }
1340 if (i::FLAG_ignition_count_handler_dispatches) {
1341 uint32_t* handler_dispatch_counters =
1342 reinterpret_cast<i::Isolate*>(isolate)
1343 ->interpreter()
1344 ->handlers_dispatch_counters();
1345 for (int i = 0; i <= static_cast<int>(i::interpreter::Bytecode::kLast);
1346 ++i) {
1347 i::interpreter::Bytecode bytecode =
1348 i::interpreter::Bytecodes::FromByte(i);
1349 printf("| c:V8.Ignition_DispatchCounter_%-32s | %11" PRIu32 " |\n",
1350 i::interpreter::Bytecodes::ToString(bytecode),
1351 handler_dispatch_counters[i]);
1352 }
1353 }
rmcilroy 2016/03/23 11:04:26 As discussed, maybe we could output json for this
Stefano Sanfilippo 2016/03/23 16:26:26 Done JSON. As of where to move this, I'll start by
1338 printf("+----------------------------------------------------------------+" 1354 printf("+----------------------------------------------------------------+"
1339 "-------------+\n"); 1355 "-------------+\n");
1340 delete [] counters; 1356 delete [] counters;
1341 } 1357 }
1342 delete counters_file_; 1358 delete counters_file_;
1343 delete counter_map_; 1359 delete counter_map_;
1344 #endif // !V8_SHARED 1360 #endif // !V8_SHARED
1345 } 1361 }
1346 1362
1347 1363
(...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after
2533 } 2549 }
2534 2550
2535 } // namespace v8 2551 } // namespace v8
2536 2552
2537 2553
2538 #ifndef GOOGLE3 2554 #ifndef GOOGLE3
2539 int main(int argc, char* argv[]) { 2555 int main(int argc, char* argv[]) {
2540 return v8::Shell::Main(argc, argv); 2556 return v8::Shell::Main(argc, argv);
2541 } 2557 }
2542 #endif 2558 #endif
OLDNEW
« no previous file with comments | « src/bailout-reason.h ('k') | src/external-reference-table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698