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/become.h" | 10 #include "vm/become.h" |
(...skipping 7099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7110 ic_data = ICData::Clone(ic_data); | 7110 ic_data = ICData::Clone(ic_data); |
7111 ic_data.SetOriginal(original_ic_data); | 7111 ic_data.SetOriginal(original_ic_data); |
7112 } | 7112 } |
7113 (*deopt_id_to_ic_data)[ic_data.deopt_id()] = &ic_data; | 7113 (*deopt_id_to_ic_data)[ic_data.deopt_id()] = &ic_data; |
7114 } | 7114 } |
7115 } | 7115 } |
7116 } | 7116 } |
7117 | 7117 |
7118 | 7118 |
7119 void Function::set_ic_data_array(const Array& value) const { | 7119 void Function::set_ic_data_array(const Array& value) const { |
7120 AtomicStorePointer(&raw_ptr()->ic_data_array_, value.raw()); | 7120 StorePointer(&raw_ptr()->ic_data_array_, value.raw()); |
7121 } | 7121 } |
7122 | 7122 |
7123 | 7123 |
7124 RawArray* Function::ic_data_array() const { | 7124 RawArray* Function::ic_data_array() const { |
7125 return raw_ptr()->ic_data_array_; | 7125 return raw_ptr()->ic_data_array_; |
7126 } | 7126 } |
7127 | 7127 |
7128 | 7128 |
7129 void Function::ClearICDataArray() const { | 7129 void Function::ClearICDataArray() const { |
7130 set_ic_data_array(Array::null_array()); | 7130 set_ic_data_array(Array::null_array()); |
(...skipping 6320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13451 const Array& data = Array::Handle(ic_data()); | 13451 const Array& data = Array::Handle(ic_data()); |
13452 return data.IsImmutable(); | 13452 return data.IsImmutable(); |
13453 } | 13453 } |
13454 | 13454 |
13455 | 13455 |
13456 void ICData::ResetData() const { | 13456 void ICData::ResetData() const { |
13457 // Number of array elements in one test entry. | 13457 // Number of array elements in one test entry. |
13458 intptr_t len = TestEntryLength(); | 13458 intptr_t len = TestEntryLength(); |
13459 // IC data array must be null terminated (sentinel entry). | 13459 // IC data array must be null terminated (sentinel entry). |
13460 const Array& ic_data = Array::Handle(Array::New(len, Heap::kOld)); | 13460 const Array& ic_data = Array::Handle(Array::New(len, Heap::kOld)); |
| 13461 set_ic_data_array(ic_data); |
13461 WriteSentinel(ic_data, len); | 13462 WriteSentinel(ic_data, len); |
13462 set_ic_data_array(ic_data); | |
13463 } | 13463 } |
13464 | 13464 |
13465 | 13465 |
13466 RawICData* ICData::New() { | 13466 RawICData* ICData::New() { |
13467 ICData& result = ICData::Handle(); | 13467 ICData& result = ICData::Handle(); |
13468 { | 13468 { |
13469 // IC data objects are long living objects, allocate them in old generation. | 13469 // IC data objects are long living objects, allocate them in old generation. |
13470 RawObject* raw = Object::Allocate(ICData::kClassId, | 13470 RawObject* raw = Object::Allocate(ICData::kClassId, |
13471 ICData::InstanceSize(), | 13471 ICData::InstanceSize(), |
13472 Heap::kOld); | 13472 Heap::kOld); |
(...skipping 9133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22606 return UserTag::null(); | 22606 return UserTag::null(); |
22607 } | 22607 } |
22608 | 22608 |
22609 | 22609 |
22610 const char* UserTag::ToCString() const { | 22610 const char* UserTag::ToCString() const { |
22611 const String& tag_label = String::Handle(label()); | 22611 const String& tag_label = String::Handle(label()); |
22612 return tag_label.ToCString(); | 22612 return tag_label.ToCString(); |
22613 } | 22613 } |
22614 | 22614 |
22615 } // namespace dart | 22615 } // namespace dart |
OLD | NEW |