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

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

Issue 501323002: Replace our homegrown ARRAY_SIZE() with Chrome's arraysize(). (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
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 = ARRAY_SIZE(kCounterList); 110 static const int num_counters = arraysize(kCounterList);
111 111
112 // Dump an instrumentation description comment at the top of the file. 112 // Dump an instrumentation description comment at the top of the file.
113 fprintf(output_stream_, "# counters=%d\n", num_counters); 113 fprintf(output_stream_, "# counters=%d\n", num_counters);
114 fprintf(output_stream_, "# sample_period=%" PRIu64 "\n", sample_period_); 114 fprintf(output_stream_, "# sample_period=%" PRIu64 "\n", sample_period_);
115 115
116 // Construct Counter objects from counter description array. 116 // Construct Counter objects from counter description array.
117 for (int i = 0; i < num_counters; i++) { 117 for (int i = 0; i < num_counters; i++) {
118 Counter* counter = new Counter(kCounterList[i].name, kCounterList[i].type); 118 Counter* counter = new Counter(kCounterList[i].name, kCounterList[i].type);
119 counters_.push_back(counter); 119 counters_.push_back(counter);
120 } 120 }
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 585
586 586
587 void Instrument::VisitUnimplemented(Instruction* instr) { 587 void Instrument::VisitUnimplemented(Instruction* instr) {
588 Update(); 588 Update();
589 static Counter* counter = GetCounter("Other"); 589 static Counter* counter = GetCounter("Other");
590 counter->Increment(); 590 counter->Increment();
591 } 591 }
592 592
593 593
594 } } // namespace v8::internal 594 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm64/code-stubs-arm64.cc ('k') | src/arm64/simulator-arm64.cc » ('j') | src/base/macros.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698