| OLD | NEW | 
|---|
| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 54 CounterType Counter::type() { | 54 CounterType Counter::type() { | 
| 55   return type_; | 55   return type_; | 
| 56 } | 56 } | 
| 57 | 57 | 
| 58 | 58 | 
| 59 typedef struct { | 59 typedef struct { | 
| 60   const char* name; | 60   const char* name; | 
| 61   CounterType type; | 61   CounterType type; | 
| 62 } CounterDescriptor; | 62 } CounterDescriptor; | 
| 63 | 63 | 
|  | 64 static const CounterDescriptor kCounterList[] = { | 
|  | 65     {"Instruction", Cumulative}, | 
| 64 | 66 | 
| 65 static const CounterDescriptor kCounterList[] = { | 67     {"Move Immediate", Gauge}, | 
| 66   {"Instruction", Cumulative}, | 68     {"Add/Sub DP", Gauge}, | 
|  | 69     {"Logical DP", Gauge}, | 
|  | 70     {"Other Int DP", Gauge}, | 
|  | 71     {"FP DP", Gauge}, | 
| 67 | 72 | 
| 68   {"Move Immediate", Gauge}, | 73     {"Conditional Select", Gauge}, | 
| 69   {"Add/Sub DP", Gauge}, | 74     {"Conditional Compare", Gauge}, | 
| 70   {"Logical DP", Gauge}, |  | 
| 71   {"Other Int DP", Gauge}, |  | 
| 72   {"FP DP", Gauge}, |  | 
| 73 | 75 | 
| 74   {"Conditional Select", Gauge}, | 76     {"Unconditional Branch", Gauge}, | 
| 75   {"Conditional Compare", Gauge}, | 77     {"Compare and Branch", Gauge}, | 
|  | 78     {"Test and Branch", Gauge}, | 
|  | 79     {"Conditional Branch", Gauge}, | 
| 76 | 80 | 
| 77   {"Unconditional Branch", Gauge}, | 81     {"Load Integer", Gauge}, | 
| 78   {"Compare and Branch", Gauge}, | 82     {"Load FP", Gauge}, | 
| 79   {"Test and Branch", Gauge}, | 83     {"Load Pair", Gauge}, | 
| 80   {"Conditional Branch", Gauge}, | 84     {"Load Literal", Gauge}, | 
|  | 85     {"Load Acquire", Gauge}, | 
| 81 | 86 | 
| 82   {"Load Integer", Gauge}, | 87     {"Store Integer", Gauge}, | 
| 83   {"Load FP", Gauge}, | 88     {"Store FP", Gauge}, | 
| 84   {"Load Pair", Gauge}, | 89     {"Store Pair", Gauge}, | 
| 85   {"Load Literal", Gauge}, | 90     {"Store Release", Gauge}, | 
| 86 | 91 | 
| 87   {"Store Integer", Gauge}, | 92     {"PC Addressing", Gauge}, | 
| 88   {"Store FP", Gauge}, | 93     {"Other", Gauge}, | 
| 89   {"Store Pair", Gauge}, | 94     {"SP Adjust", Gauge}, | 
| 90 |  | 
| 91   {"PC Addressing", Gauge}, |  | 
| 92   {"Other", Gauge}, |  | 
| 93   {"SP Adjust", Gauge}, |  | 
| 94 }; | 95 }; | 
| 95 | 96 | 
| 96 |  | 
| 97 Instrument::Instrument(const char* datafile, uint64_t sample_period) | 97 Instrument::Instrument(const char* datafile, uint64_t sample_period) | 
| 98     : output_stream_(stderr), sample_period_(sample_period) { | 98     : output_stream_(stderr), sample_period_(sample_period) { | 
| 99 | 99 | 
| 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; | 
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 605 | 605 | 
| 606 void Instrument::VisitUnimplemented(Instruction* instr) { | 606 void Instrument::VisitUnimplemented(Instruction* instr) { | 
| 607   Update(); | 607   Update(); | 
| 608   static Counter* counter = GetCounter("Other"); | 608   static Counter* counter = GetCounter("Other"); | 
| 609   counter->Increment(); | 609   counter->Increment(); | 
| 610 } | 610 } | 
| 611 | 611 | 
| 612 | 612 | 
| 613 }  // namespace internal | 613 }  // namespace internal | 
| 614 }  // namespace v8 | 614 }  // namespace v8 | 
| OLD | NEW | 
|---|