| 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 12192 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 12203   StoreNonPointer(&raw_ptr()->deopt_id_, value); | 12203   StoreNonPointer(&raw_ptr()->deopt_id_, value); | 
| 12204 } | 12204 } | 
| 12205 | 12205 | 
| 12206 | 12206 | 
| 12207 void ICData::set_ic_data_array(const Array& value) const { | 12207 void ICData::set_ic_data_array(const Array& value) const { | 
| 12208   ASSERT(!value.IsNull()); | 12208   ASSERT(!value.IsNull()); | 
| 12209   StorePointer(&raw_ptr()->ic_data_, value.raw()); | 12209   StorePointer(&raw_ptr()->ic_data_, value.raw()); | 
| 12210 } | 12210 } | 
| 12211 | 12211 | 
| 12212 | 12212 | 
|  | 12213 #if defined(TAG_IC_DATA) | 
|  | 12214 void ICData::set_tag(intptr_t value) const { | 
|  | 12215   StoreNonPointer(&raw_ptr()->tag_, value); | 
|  | 12216 } | 
|  | 12217 #endif | 
|  | 12218 | 
| 12213 intptr_t ICData::NumArgsTested() const { | 12219 intptr_t ICData::NumArgsTested() const { | 
| 12214   return NumArgsTestedBits::decode(raw_ptr()->state_bits_); | 12220   return NumArgsTestedBits::decode(raw_ptr()->state_bits_); | 
| 12215 } | 12221 } | 
| 12216 | 12222 | 
| 12217 | 12223 | 
| 12218 void ICData::SetNumArgsTested(intptr_t value) const { | 12224 void ICData::SetNumArgsTested(intptr_t value) const { | 
| 12219   ASSERT(Utils::IsUint(2, value)); | 12225   ASSERT(Utils::IsUint(2, value)); | 
| 12220   StoreNonPointer(&raw_ptr()->state_bits_, | 12226   StoreNonPointer(&raw_ptr()->state_bits_, | 
| 12221                   NumArgsTestedBits::update(value, raw_ptr()->state_bits_)); | 12227                   NumArgsTestedBits::update(value, raw_ptr()->state_bits_)); | 
| 12222 } | 12228 } | 
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 12783                                       ICData::InstanceSize(), | 12789                                       ICData::InstanceSize(), | 
| 12784                                       Heap::kOld); | 12790                                       Heap::kOld); | 
| 12785     NoSafepointScope no_safepoint; | 12791     NoSafepointScope no_safepoint; | 
| 12786     result ^= raw; | 12792     result ^= raw; | 
| 12787   } | 12793   } | 
| 12788   result.set_owner(owner); | 12794   result.set_owner(owner); | 
| 12789   result.set_target_name(target_name); | 12795   result.set_target_name(target_name); | 
| 12790   result.set_arguments_descriptor(arguments_descriptor); | 12796   result.set_arguments_descriptor(arguments_descriptor); | 
| 12791   result.set_deopt_id(deopt_id); | 12797   result.set_deopt_id(deopt_id); | 
| 12792   result.set_state_bits(0); | 12798   result.set_state_bits(0); | 
|  | 12799 #if defined(TAG_IC_DATA) | 
|  | 12800   result.set_tag(-1); | 
|  | 12801 #endif | 
| 12793   result.SetNumArgsTested(num_args_tested); | 12802   result.SetNumArgsTested(num_args_tested); | 
| 12794   return result.raw(); | 12803   return result.raw(); | 
| 12795 } | 12804 } | 
| 12796 | 12805 | 
| 12797 | 12806 | 
| 12798 RawICData* ICData::New() { | 12807 RawICData* ICData::New() { | 
| 12799   ICData& result = ICData::Handle(); | 12808   ICData& result = ICData::Handle(); | 
| 12800   { | 12809   { | 
| 12801     // IC data objects are long living objects, allocate them in old generation. | 12810     // IC data objects are long living objects, allocate them in old generation. | 
| 12802     RawObject* raw = Object::Allocate(ICData::kClassId, | 12811     RawObject* raw = Object::Allocate(ICData::kClassId, | 
| 12803                                       ICData::InstanceSize(), | 12812                                       ICData::InstanceSize(), | 
| 12804                                       Heap::kOld); | 12813                                       Heap::kOld); | 
| 12805     NoSafepointScope no_safepoint; | 12814     NoSafepointScope no_safepoint; | 
| 12806     result ^= raw; | 12815     result ^= raw; | 
| 12807   } | 12816   } | 
| 12808   result.set_deopt_id(Thread::kNoDeoptId); | 12817   result.set_deopt_id(Thread::kNoDeoptId); | 
| 12809   result.set_state_bits(0); | 12818   result.set_state_bits(0); | 
|  | 12819 #if defined(TAG_IC_DATA) | 
|  | 12820   result.set_tag(-1); | 
|  | 12821 #endif | 
| 12810   return result.raw(); | 12822   return result.raw(); | 
| 12811 } | 12823 } | 
| 12812 | 12824 | 
| 12813 | 12825 | 
| 12814 RawICData* ICData::New(const Function& owner, | 12826 RawICData* ICData::New(const Function& owner, | 
| 12815                        const String& target_name, | 12827                        const String& target_name, | 
| 12816                        const Array& arguments_descriptor, | 12828                        const Array& arguments_descriptor, | 
| 12817                        intptr_t deopt_id, | 12829                        intptr_t deopt_id, | 
| 12818                        intptr_t num_args_tested) { | 12830                        intptr_t num_args_tested) { | 
| 12819   Zone* zone = Thread::Current()->zone(); | 12831   Zone* zone = Thread::Current()->zone(); | 
| (...skipping 9042 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 21862   return UserTag::null(); | 21874   return UserTag::null(); | 
| 21863 } | 21875 } | 
| 21864 | 21876 | 
| 21865 | 21877 | 
| 21866 const char* UserTag::ToCString() const { | 21878 const char* UserTag::ToCString() const { | 
| 21867   const String& tag_label = String::Handle(label()); | 21879   const String& tag_label = String::Handle(label()); | 
| 21868   return tag_label.ToCString(); | 21880   return tag_label.ToCString(); | 
| 21869 } | 21881 } | 
| 21870 | 21882 | 
| 21871 }  // namespace dart | 21883 }  // namespace dart | 
| OLD | NEW | 
|---|