OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 "src/factory.h" | 5 #include "src/factory.h" |
6 | 6 |
7 #include "src/allocation-site-scopes.h" | 7 #include "src/allocation-site-scopes.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 2007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2018 } | 2018 } |
2019 | 2019 |
2020 // In order to keep heap in consistent state there must be no allocations | 2020 // In order to keep heap in consistent state there must be no allocations |
2021 // before object re-initialization is finished and filler object is installed. | 2021 // before object re-initialization is finished and filler object is installed. |
2022 DisallowHeapAllocation no_allocation; | 2022 DisallowHeapAllocation no_allocation; |
2023 | 2023 |
2024 // Put in filler if the new object is smaller than the old. | 2024 // Put in filler if the new object is smaller than the old. |
2025 if (size_difference > 0) { | 2025 if (size_difference > 0) { |
2026 Address address = proxy->address(); | 2026 Address address = proxy->address(); |
2027 heap->CreateFillerObjectAt(address + map->instance_size(), size_difference); | 2027 heap->CreateFillerObjectAt(address + map->instance_size(), size_difference); |
2028 heap->AdjustLiveBytes(address, -size_difference, | 2028 heap->AdjustLiveBytes(*proxy, -size_difference, |
2029 Heap::CONCURRENT_TO_SWEEPER); | 2029 Heap::CONCURRENT_TO_SWEEPER); |
2030 } | 2030 } |
2031 | 2031 |
2032 // Reset the map for the object. | 2032 // Reset the map for the object. |
2033 proxy->synchronized_set_map(*map); | 2033 proxy->synchronized_set_map(*map); |
2034 Handle<JSObject> jsobj = Handle<JSObject>::cast(proxy); | 2034 Handle<JSObject> jsobj = Handle<JSObject>::cast(proxy); |
2035 | 2035 |
2036 // Reinitialize the object from the constructor map. | 2036 // Reinitialize the object from the constructor map. |
2037 heap->InitializeJSObjectFromMap(*jsobj, *properties, *map); | 2037 heap->InitializeJSObjectFromMap(*jsobj, *properties, *map); |
2038 | 2038 |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2425 } | 2425 } |
2426 | 2426 |
2427 | 2427 |
2428 Handle<Object> Factory::ToBoolean(bool value) { | 2428 Handle<Object> Factory::ToBoolean(bool value) { |
2429 return value ? true_value() : false_value(); | 2429 return value ? true_value() : false_value(); |
2430 } | 2430 } |
2431 | 2431 |
2432 | 2432 |
2433 } // namespace internal | 2433 } // namespace internal |
2434 } // namespace v8 | 2434 } // namespace v8 |
OLD | NEW |