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 7437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7448 return true; | 7448 return true; |
7449 } | 7449 } |
7450 | 7450 |
7451 | 7451 |
7452 static void TrimEnumCache(Heap* heap, Map* map, DescriptorArray* descriptors) { | 7452 static void TrimEnumCache(Heap* heap, Map* map, DescriptorArray* descriptors) { |
7453 int live_enum = map->EnumLength(); | 7453 int live_enum = map->EnumLength(); |
7454 if (live_enum == Map::kInvalidEnumCache) { | 7454 if (live_enum == Map::kInvalidEnumCache) { |
7455 live_enum = map->NumberOfDescribedProperties(OWN_DESCRIPTORS, DONT_ENUM); | 7455 live_enum = map->NumberOfDescribedProperties(OWN_DESCRIPTORS, DONT_ENUM); |
7456 } | 7456 } |
7457 if (live_enum == 0) return descriptors->ClearEnumCache(); | 7457 if (live_enum == 0) return descriptors->ClearEnumCache(); |
7458 | 7458 |
7459 FixedArray* enum_cache = descriptors->GetEnumCache(); | 7459 FixedArray* enum_cache = descriptors->GetEnumCache(); |
7460 | 7460 |
7461 int to_trim = enum_cache->length() - live_enum; | 7461 int to_trim = enum_cache->length() - live_enum; |
7462 if (to_trim <= 0) return; | 7462 if (to_trim <= 0) return; |
7463 RightTrimFixedArray<FROM_GC>(heap, descriptors->GetEnumCache(), to_trim); | 7463 RightTrimFixedArray<FROM_GC>(heap, descriptors->GetEnumCache(), to_trim); |
7464 | 7464 |
7465 if (!descriptors->HasEnumIndicesCache()) return; | 7465 if (!descriptors->HasEnumIndicesCache()) return; |
7466 FixedArray* enum_indices_cache = descriptors->GetEnumIndicesCache(); | 7466 FixedArray* enum_indices_cache = descriptors->GetEnumIndicesCache(); |
7467 RightTrimFixedArray<FROM_GC>(heap, enum_indices_cache, to_trim); | 7467 RightTrimFixedArray<FROM_GC>(heap, enum_indices_cache, to_trim); |
7468 } | 7468 } |
(...skipping 6077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13546 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 13546 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
13547 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 13547 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
13548 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 13548 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
13549 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 13549 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
13550 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 13550 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
13551 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 13551 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
13552 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 13552 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
13553 } | 13553 } |
13554 | 13554 |
13555 } } // namespace v8::internal | 13555 } } // namespace v8::internal |
OLD | NEW |