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

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

Issue 8351019: Code patching support and tests for new inline caches. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 2 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
« no previous file with comments | « runtime/vm/code_patcher_ia32_test.cc ('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) 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.
11 ICData::ICData(const Array& data) : data_(&data) { 11 ICData::ICData(const Array& data) : data_(&data) {
12 // Check consistency.
13 ASSERT(!String::Handle(FunctionName()).IsNull());
14 ASSERT(NumberOfArgumentsChecked() > 0);
12 } 15 }
13 16
14 17
15 ICData::ICData(const String& function_name, intptr_t num_args_checked) 18 ICData::ICData(const String& function_name, intptr_t num_args_checked)
16 : data_(NULL) { 19 : data_(NULL) {
17 // Array contains: function-name, num_checked, NULL check sentinel (classes, 20 // Array contains: function-name, num_checked, NULL check sentinel (classes,
18 // target). 21 // target).
19 const intptr_t len = kChecksStartIndex + (num_args_checked + 1); 22 const intptr_t len = kChecksStartIndex + (num_args_checked + 1);
20 data_ = &Array::ZoneHandle(Array::New(len, Heap::kOld)); 23 data_ = &Array::ZoneHandle(Array::New(len, Heap::kOld));
21 data_->SetAt(kNameIndex, function_name); 24 data_->SetAt(kNameIndex, function_name);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 intptr_t pos = 1 + 1 + ArrayElementsPerCheck() * index; 97 intptr_t pos = 1 + 1 + ArrayElementsPerCheck() * index;
95 for (intptr_t i = 0; i < NumberOfArgumentsChecked(); i++) { 98 for (intptr_t i = 0; i < NumberOfArgumentsChecked(); i++) {
96 Class& cls = Class::ZoneHandle(); 99 Class& cls = Class::ZoneHandle();
97 cls ^= data_->At(pos++); 100 cls ^= data_->At(pos++);
98 classes->Add(&cls); 101 classes->Add(&cls);
99 } 102 }
100 (*target) ^= data_->At(pos); 103 (*target) ^= data_->At(pos);
101 } 104 }
102 105
103 } // namespace dart 106 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_patcher_ia32_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698