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

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

Issue 11541002: Use call counts to prevent cold calls from being inlined. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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
« runtime/vm/flow_graph_inliner.cc ('K') | « runtime/vm/object.h ('k') | no next file » | 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 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 7778 matching lines...) Expand 10 before | Expand all | Expand 10 after
7789 intptr_t ICData::GetCountAt(intptr_t index) const { 7789 intptr_t ICData::GetCountAt(intptr_t index) const {
7790 const Array& data = Array::Handle(ic_data()); 7790 const Array& data = Array::Handle(ic_data());
7791 const intptr_t data_pos = index * TestEntryLength() + 7791 const intptr_t data_pos = index * TestEntryLength() +
7792 CountIndexFor(num_args_tested()); 7792 CountIndexFor(num_args_tested());
7793 Smi& smi = Smi::Handle(); 7793 Smi& smi = Smi::Handle();
7794 smi ^= data.At(data_pos); 7794 smi ^= data.At(data_pos);
7795 return smi.Value(); 7795 return smi.Value();
7796 } 7796 }
7797 7797
7798 7798
7799 intptr_t ICData::AggregateCount() const {
7800 const intptr_t len = NumberOfChecks();
7801 intptr_t count = 0;
7802 for (intptr_t i = 0; i < len; i++) {
7803 count += GetCountAt(i);
7804 }
7805 return count;
7806 }
7807
7808
7799 RawFunction* ICData::GetTargetForReceiverClassId(intptr_t class_id) const { 7809 RawFunction* ICData::GetTargetForReceiverClassId(intptr_t class_id) const {
7800 const intptr_t len = NumberOfChecks(); 7810 const intptr_t len = NumberOfChecks();
7801 for (intptr_t i = 0; i < len; i++) { 7811 for (intptr_t i = 0; i < len; i++) {
7802 if (GetReceiverClassIdAt(i) == class_id) { 7812 if (GetReceiverClassIdAt(i) == class_id) {
7803 return GetTargetAt(i); 7813 return GetTargetAt(i);
7804 } 7814 }
7805 } 7815 }
7806 return Function::null(); 7816 return Function::null();
7807 } 7817 }
7808 7818
(...skipping 4674 matching lines...) Expand 10 before | Expand all | Expand 10 after
12483 } 12493 }
12484 return result.raw(); 12494 return result.raw();
12485 } 12495 }
12486 12496
12487 12497
12488 const char* WeakProperty::ToCString() const { 12498 const char* WeakProperty::ToCString() const {
12489 return "_WeakProperty"; 12499 return "_WeakProperty";
12490 } 12500 }
12491 12501
12492 } // namespace dart 12502 } // namespace dart
OLDNEW
« runtime/vm/flow_graph_inliner.cc ('K') | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698