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

Side by Side Diff: src/arm64/instrument-arm64.cc

Issue 437813004: ARM64: Use ARRAY_SIZE where possible. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 | « src/arm64/assembler-arm64.cc ('k') | src/arm64/simulator-arm64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #include "src/arm64/instrument-arm64.h" 5 #include "src/arm64/instrument-arm64.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 9
10 Counter::Counter(const char* name, CounterType type) 10 Counter::Counter(const char* name, CounterType type)
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 // Set up the output stream. If datafile is non-NULL, use that file. If it 100 // Set up the output stream. If datafile is non-NULL, use that file. If it
101 // can't be opened, or datafile is NULL, use stderr. 101 // can't be opened, or datafile is NULL, use stderr.
102 if (datafile != NULL) { 102 if (datafile != NULL) {
103 output_stream_ = fopen(datafile, "w"); 103 output_stream_ = fopen(datafile, "w");
104 if (output_stream_ == NULL) { 104 if (output_stream_ == NULL) {
105 fprintf(stderr, "Can't open output file %s. Using stderr.\n", datafile); 105 fprintf(stderr, "Can't open output file %s. Using stderr.\n", datafile);
106 output_stream_ = stderr; 106 output_stream_ = stderr;
107 } 107 }
108 } 108 }
109 109
110 static const int num_counters = 110 static const int num_counters = ARRAY_SIZE(kCounterList);
111 sizeof(kCounterList) / sizeof(CounterDescriptor);
112 111
113 // Dump an instrumentation description comment at the top of the file. 112 // Dump an instrumentation description comment at the top of the file.
114 fprintf(output_stream_, "# counters=%d\n", num_counters); 113 fprintf(output_stream_, "# counters=%d\n", num_counters);
115 fprintf(output_stream_, "# sample_period=%" PRIu64 "\n", sample_period_); 114 fprintf(output_stream_, "# sample_period=%" PRIu64 "\n", sample_period_);
116 115
117 // Construct Counter objects from counter description array. 116 // Construct Counter objects from counter description array.
118 for (int i = 0; i < num_counters; i++) { 117 for (int i = 0; i < num_counters; i++) {
119 Counter* counter = new Counter(kCounterList[i].name, kCounterList[i].type); 118 Counter* counter = new Counter(kCounterList[i].name, kCounterList[i].type);
120 counters_.push_back(counter); 119 counters_.push_back(counter);
121 } 120 }
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 585
587 586
588 void Instrument::VisitUnimplemented(Instruction* instr) { 587 void Instrument::VisitUnimplemented(Instruction* instr) {
589 Update(); 588 Update();
590 static Counter* counter = GetCounter("Other"); 589 static Counter* counter = GetCounter("Other");
591 counter->Increment(); 590 counter->Increment();
592 } 591 }
593 592
594 593
595 } } // namespace v8::internal 594 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm64/assembler-arm64.cc ('k') | src/arm64/simulator-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698