OLD | NEW |
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/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 11323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11334 return false; | 11334 return false; |
11335 } | 11335 } |
11336 #endif // DEBUG | 11336 #endif // DEBUG |
11337 | 11337 |
11338 | 11338 |
11339 // Used for unoptimized static calls when no class-ids are checked. | 11339 // Used for unoptimized static calls when no class-ids are checked. |
11340 void ICData::AddTarget(const Function& target) const { | 11340 void ICData::AddTarget(const Function& target) const { |
11341 ASSERT(!target.IsNull()); | 11341 ASSERT(!target.IsNull()); |
11342 if (NumArgsTested() > 0) { | 11342 if (NumArgsTested() > 0) { |
11343 // Create a fake cid entry, so that we can store the target. | 11343 // Create a fake cid entry, so that we can store the target. |
11344 GrowableArray<intptr_t> class_ids(NumArgsTested()); | 11344 if (NumArgsTested() == 1) { |
11345 for (intptr_t i = 0; i < NumArgsTested(); i++) { | 11345 AddReceiverCheck(kObjectCid, target, 1); |
11346 class_ids.Add(kObjectCid); | 11346 } else { |
| 11347 GrowableArray<intptr_t> class_ids(NumArgsTested()); |
| 11348 for (intptr_t i = 0; i < NumArgsTested(); i++) { |
| 11349 class_ids.Add(kObjectCid); |
| 11350 } |
| 11351 AddCheck(class_ids, target); |
11347 } | 11352 } |
11348 AddCheck(class_ids, target); | |
11349 return; | 11353 return; |
11350 } | 11354 } |
11351 ASSERT(NumArgsTested() >= 0); | 11355 ASSERT(NumArgsTested() >= 0); |
11352 // Can add only once. | 11356 // Can add only once. |
11353 const intptr_t old_num = NumberOfChecks(); | 11357 const intptr_t old_num = NumberOfChecks(); |
11354 ASSERT(old_num == 0); | 11358 ASSERT(old_num == 0); |
11355 Array& data = Array::Handle(ic_data()); | 11359 Array& data = Array::Handle(ic_data()); |
11356 const intptr_t new_len = data.Length() + TestEntryLength(); | 11360 const intptr_t new_len = data.Length() + TestEntryLength(); |
11357 data = Array::Grow(data, new_len, Heap::kOld); | 11361 data = Array::Grow(data, new_len, Heap::kOld); |
11358 set_ic_data(data); | 11362 set_ic_data(data); |
(...skipping 8124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19483 return tag_label.ToCString(); | 19487 return tag_label.ToCString(); |
19484 } | 19488 } |
19485 | 19489 |
19486 | 19490 |
19487 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 19491 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
19488 Instance::PrintJSONImpl(stream, ref); | 19492 Instance::PrintJSONImpl(stream, ref); |
19489 } | 19493 } |
19490 | 19494 |
19491 | 19495 |
19492 } // namespace dart | 19496 } // namespace dart |
OLD | NEW |