OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
(...skipping 2143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2154 address + new_instance_size, instance_size_delta); | 2154 address + new_instance_size, instance_size_delta); |
2155 heap->AdjustLiveBytes(address, -instance_size_delta, Heap::FROM_MUTATOR); | 2155 heap->AdjustLiveBytes(address, -instance_size_delta, Heap::FROM_MUTATOR); |
2156 } | 2156 } |
2157 | 2157 |
2158 // We are storing the new map using release store after creating a filler for | 2158 // We are storing the new map using release store after creating a filler for |
2159 // the left-over space to avoid races with the sweeper thread. | 2159 // the left-over space to avoid races with the sweeper thread. |
2160 object->synchronized_set_map(*new_map); | 2160 object->synchronized_set_map(*new_map); |
2161 } | 2161 } |
2162 | 2162 |
2163 | 2163 |
2164 void JSObject::GeneralizeFieldRepresentation(Handle<JSObject> object, | |
2165 int modify_index, | |
2166 Representation new_representation, | |
2167 Handle<HeapType> new_field_type) { | |
2168 Handle<Map> new_map = Map::GeneralizeRepresentation( | |
2169 handle(object->map()), modify_index, new_representation, new_field_type, | |
2170 FORCE_FIELD); | |
2171 MigrateToMap(object, new_map); | |
2172 } | |
2173 | |
2174 | |
2175 int Map::NumberOfFields() { | 2164 int Map::NumberOfFields() { |
2176 DescriptorArray* descriptors = instance_descriptors(); | 2165 DescriptorArray* descriptors = instance_descriptors(); |
2177 int result = 0; | 2166 int result = 0; |
2178 for (int i = 0; i < NumberOfOwnDescriptors(); i++) { | 2167 for (int i = 0; i < NumberOfOwnDescriptors(); i++) { |
2179 if (descriptors->GetDetails(i).type() == FIELD) result++; | 2168 if (descriptors->GetDetails(i).type() == FIELD) result++; |
2180 } | 2169 } |
2181 return result; | 2170 return result; |
2182 } | 2171 } |
2183 | 2172 |
2184 | 2173 |
(...skipping 14310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16495 Handle<DependentCode> codes = | 16484 Handle<DependentCode> codes = |
16496 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16485 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), |
16497 DependentCode::kPropertyCellChangedGroup, | 16486 DependentCode::kPropertyCellChangedGroup, |
16498 info->object_wrapper()); | 16487 info->object_wrapper()); |
16499 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16488 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
16500 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16489 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
16501 cell, info->zone()); | 16490 cell, info->zone()); |
16502 } | 16491 } |
16503 | 16492 |
16504 } } // namespace v8::internal | 16493 } } // namespace v8::internal |
OLD | NEW |