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

Side by Side Diff: vm/ic_data.cc

Issue 8404009: Restructure instance calls in optimizing compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years, 1 month 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 | « vm/ic_data.h ('k') | vm/ic_data_test.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/ic_data.h" 5 #include "vm/ic_data.h"
6 #include "vm/object.h" 6 #include "vm/object.h"
7 7
8 namespace dart { 8 namespace dart {
9 9
10 // ICData is a ValueObject, therefore 'data' need not be a ZoneObject. 10 // ICData is a ValueObject, therefore 'data' need not be a ZoneObject.
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 ASSERT(!classes[i]->IsNull()); 93 ASSERT(!classes[i]->IsNull());
94 // Contract says that the class of null (NullClass) cannot be added. 94 // Contract says that the class of null (NullClass) cannot be added.
95 ASSERT(!classes[i]->IsNullClass()); 95 ASSERT(!classes[i]->IsNullClass());
96 data_->SetAt(pos++, *(classes[i])); 96 data_->SetAt(pos++, *(classes[i]));
97 } 97 }
98 ASSERT(!target.IsNull()); 98 ASSERT(!target.IsNull());
99 data_->SetAt(pos, target); 99 data_->SetAt(pos, target);
100 } 100 }
101 101
102 102
103 void ICData::GetOneClassCheckAt(intptr_t index,
104 Class* cls,
105 Function* target) const {
106 ASSERT(cls != NULL);
107 ASSERT(target != NULL);
108 ASSERT((0 <= index) && (index < NumberOfChecks()));
109 ASSERT(NumberOfArgumentsChecked() == 1);
110 intptr_t pos = 1 + 1 + ArrayElementsPerCheck() * index;
111 *cls ^= data_->At(pos);
112 (*target) ^= data_->At(pos + 1);
113 }
114
115
103 void ICData::GetCheckAt(intptr_t index, 116 void ICData::GetCheckAt(intptr_t index,
104 GrowableArray<const Class*>* classes, 117 GrowableArray<const Class*>* classes,
105 Function* target) const { 118 Function* target) const {
106 ASSERT(classes != NULL); 119 ASSERT(classes != NULL);
107 ASSERT(target != NULL); 120 ASSERT(target != NULL);
108 ASSERT((0 <= index) && (index < NumberOfChecks())); 121 ASSERT((0 <= index) && (index < NumberOfChecks()));
109 classes->Clear(); 122 classes->Clear();
110 intptr_t pos = 1 + 1 + ArrayElementsPerCheck() * index; 123 intptr_t pos = 1 + 1 + ArrayElementsPerCheck() * index;
111 for (intptr_t i = 0; i < NumberOfArgumentsChecked(); i++) { 124 for (intptr_t i = 0; i < NumberOfArgumentsChecked(); i++) {
112 Class& cls = Class::ZoneHandle(); 125 Class& cls = Class::ZoneHandle();
113 cls ^= data_->At(pos++); 126 cls ^= data_->At(pos++);
114 classes->Add(&cls); 127 classes->Add(&cls);
115 } 128 }
116 (*target) ^= data_->At(pos); 129 (*target) ^= data_->At(pos);
117 } 130 }
118 131
119 } // namespace dart 132 } // namespace dart
OLDNEW
« no previous file with comments | « vm/ic_data.h ('k') | vm/ic_data_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698