Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(693)

Side by Side Diff: src/factory.cc

Issue 1256203004: AdjustLiveBytes and friends takes a heap object pointer instead of an address. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698