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

Side by Side Diff: src/factory.cc

Issue 1034163002: Use atomic operation to read the length of a fixed array. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 | « src/elements.cc ('k') | src/heap/heap.h » ('j') | src/heap/heap.h » ('J')
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/conversions.h" 9 #include "src/conversions.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 1902 matching lines...) Expand 10 before | Expand all | Expand 10 after
1913 } 1913 }
1914 1914
1915 // In order to keep heap in consistent state there must be no allocations 1915 // In order to keep heap in consistent state there must be no allocations
1916 // before object re-initialization is finished and filler object is installed. 1916 // before object re-initialization is finished and filler object is installed.
1917 DisallowHeapAllocation no_allocation; 1917 DisallowHeapAllocation no_allocation;
1918 1918
1919 // Put in filler if the new object is smaller than the old. 1919 // Put in filler if the new object is smaller than the old.
1920 if (size_difference > 0) { 1920 if (size_difference > 0) {
1921 Address address = proxy->address(); 1921 Address address = proxy->address();
1922 heap->CreateFillerObjectAt(address + map->instance_size(), size_difference); 1922 heap->CreateFillerObjectAt(address + map->instance_size(), size_difference);
1923 heap->AdjustLiveBytes(address, -size_difference, Heap::FROM_MUTATOR); 1923 heap->AdjustLiveBytes(address, -size_difference, Heap::SWEEPING_STARTED);
1924 } 1924 }
1925 1925
1926 // Reset the map for the object. 1926 // Reset the map for the object.
1927 proxy->synchronized_set_map(*map); 1927 proxy->synchronized_set_map(*map);
1928 Handle<JSObject> jsobj = Handle<JSObject>::cast(proxy); 1928 Handle<JSObject> jsobj = Handle<JSObject>::cast(proxy);
1929 1929
1930 // Reinitialize the object from the constructor map. 1930 // Reinitialize the object from the constructor map.
1931 heap->InitializeJSObjectFromMap(*jsobj, *properties, *map); 1931 heap->InitializeJSObjectFromMap(*jsobj, *properties, *map);
1932 1932
1933 // The current native context is used to set up certain bits. 1933 // The current native context is used to set up certain bits.
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
2316 return Handle<Object>::null(); 2316 return Handle<Object>::null();
2317 } 2317 }
2318 2318
2319 2319
2320 Handle<Object> Factory::ToBoolean(bool value) { 2320 Handle<Object> Factory::ToBoolean(bool value) {
2321 return value ? true_value() : false_value(); 2321 return value ? true_value() : false_value();
2322 } 2322 }
2323 2323
2324 2324
2325 } } // namespace v8::internal 2325 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/elements.cc ('k') | src/heap/heap.h » ('j') | src/heap/heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698