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

Side by Side Diff: runtime/vm/object.h

Issue 11567012: Store optimized flow graph statistics on the function itself. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address Srdjan's comments Created 8 years 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 | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/object.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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 raw_ptr()->usage_counter_ = value; 1281 raw_ptr()->usage_counter_ = value;
1282 } 1282 }
1283 1283
1284 int16_t deoptimization_counter() const { 1284 int16_t deoptimization_counter() const {
1285 return raw_ptr()->deoptimization_counter_; 1285 return raw_ptr()->deoptimization_counter_;
1286 } 1286 }
1287 void set_deoptimization_counter(int16_t value) const { 1287 void set_deoptimization_counter(int16_t value) const {
1288 raw_ptr()->deoptimization_counter_ = value; 1288 raw_ptr()->deoptimization_counter_ = value;
1289 } 1289 }
1290 1290
1291 static const intptr_t kMaxInstructionCount = (1 << 16) - 1;
1292 intptr_t optimized_instruction_count() const {
1293 return raw_ptr()->optimized_instruction_count_;
1294 }
1295 void set_optimized_instruction_count(intptr_t value) const {
1296 ASSERT(value >= 0);
1297 if (value > kMaxInstructionCount) {
1298 value = kMaxInstructionCount;
1299 }
1300 raw_ptr()->optimized_instruction_count_ = static_cast<uint16_t>(value);
1301 }
1302
1303 intptr_t optimized_call_site_count() const {
1304 return raw_ptr()->optimized_call_site_count_;
1305 }
1306 void set_optimized_call_site_count(intptr_t value) const {
1307 ASSERT(value >= 0);
1308 if (value > kMaxInstructionCount) {
1309 value = kMaxInstructionCount;
1310 }
1311 raw_ptr()->optimized_call_site_count_ = static_cast<uint16_t>(value);
1312 }
1313
1291 bool is_optimizable() const; 1314 bool is_optimizable() const;
1292 void set_is_optimizable(bool value) const; 1315 void set_is_optimizable(bool value) const;
1293 1316
1294 bool has_finally() const { 1317 bool has_finally() const {
1295 return HasFinallyBit::decode(raw_ptr()->kind_tag_); 1318 return HasFinallyBit::decode(raw_ptr()->kind_tag_);
1296 } 1319 }
1297 void set_has_finally(bool value) const; 1320 void set_has_finally(bool value) const;
1298 1321
1299 bool is_native() const { return NativeBit::decode(raw_ptr()->kind_tag_); } 1322 bool is_native() const { return NativeBit::decode(raw_ptr()->kind_tag_); }
1300 void set_is_native(bool value) const; 1323 void set_is_native(bool value) const;
(...skipping 4867 matching lines...) Expand 10 before | Expand all | Expand 10 after
6168 6191
6169 6192
6170 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 6193 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
6171 intptr_t index) { 6194 intptr_t index) {
6172 return array.At((index * kEntryLength) + kTargetFunctionIndex); 6195 return array.At((index * kEntryLength) + kTargetFunctionIndex);
6173 } 6196 }
6174 6197
6175 } // namespace dart 6198 } // namespace dart
6176 6199
6177 #endif // VM_OBJECT_H_ 6200 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698