OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 4129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4140 } else { | 4140 } else { |
4141 DescriptorArray* descriptors; | 4141 DescriptorArray* descriptors; |
4142 MaybeObject* maybe_descriptors = DescriptorArray::Allocate(count); | 4142 MaybeObject* maybe_descriptors = DescriptorArray::Allocate(count); |
4143 if (!maybe_descriptors->To(&descriptors)) return maybe_descriptors; | 4143 if (!maybe_descriptors->To(&descriptors)) return maybe_descriptors; |
4144 | 4144 |
4145 DescriptorArray::WhitenessWitness witness(descriptors); | 4145 DescriptorArray::WhitenessWitness witness(descriptors); |
4146 for (int i = 0; i < count; i++) { | 4146 for (int i = 0; i < count; i++) { |
4147 String* name = fun->shared()->GetThisPropertyAssignmentName(i); | 4147 String* name = fun->shared()->GetThisPropertyAssignmentName(i); |
4148 ASSERT(name->IsInternalizedString()); | 4148 ASSERT(name->IsInternalizedString()); |
4149 FieldDescriptor field(name, i, NONE, i + 1); | 4149 FieldDescriptor field(name, i, NONE, i + 1); |
| 4150 // TODO(verwaest): Since we cannot update the boilerplate's map yet, |
| 4151 // initialize to the worst case. |
| 4152 field.SetStorageType(TAGGED); |
4150 descriptors->Set(i, &field, witness); | 4153 descriptors->Set(i, &field, witness); |
4151 } | 4154 } |
4152 descriptors->Sort(); | 4155 descriptors->Sort(); |
4153 | 4156 |
4154 // The descriptors may contain duplicates because the compiler does not | 4157 // The descriptors may contain duplicates because the compiler does not |
4155 // guarantee the uniqueness of property names (it would have required | 4158 // guarantee the uniqueness of property names (it would have required |
4156 // quadratic time). Once the descriptors are sorted we can check for | 4159 // quadratic time). Once the descriptors are sorted we can check for |
4157 // duplicates in linear time. | 4160 // duplicates in linear time. |
4158 if (HasDuplicates(descriptors)) { | 4161 if (HasDuplicates(descriptors)) { |
4159 fun->shared()->ForbidInlineConstructor(); | 4162 fun->shared()->ForbidInlineConstructor(); |
(...skipping 3693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7853 static_cast<int>(object_sizes_last_time_[index])); | 7856 static_cast<int>(object_sizes_last_time_[index])); |
7854 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) | 7857 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) |
7855 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7858 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7856 | 7859 |
7857 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7860 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7858 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7861 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7859 ClearObjectStats(); | 7862 ClearObjectStats(); |
7860 } | 7863 } |
7861 | 7864 |
7862 } } // namespace v8::internal | 7865 } } // namespace v8::internal |
OLD | NEW |