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

Side by Side Diff: src/objects-inl.h

Issue 1203973002: Serializer: clear next link in weak cells. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix asan failure Created 5 years, 5 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/objects.h ('k') | src/snapshot/serialize.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 1907 matching lines...) Expand 10 before | Expand all | Expand 10 after
1918 1918
1919 1919
1920 void WeakCell::set_next(Object* val, WriteBarrierMode mode) { 1920 void WeakCell::set_next(Object* val, WriteBarrierMode mode) {
1921 WRITE_FIELD(this, kNextOffset, val); 1921 WRITE_FIELD(this, kNextOffset, val);
1922 if (mode == UPDATE_WRITE_BARRIER) { 1922 if (mode == UPDATE_WRITE_BARRIER) {
1923 WRITE_BARRIER(GetHeap(), this, kNextOffset, val); 1923 WRITE_BARRIER(GetHeap(), this, kNextOffset, val);
1924 } 1924 }
1925 } 1925 }
1926 1926
1927 1927
1928 void WeakCell::clear_next(Heap* heap) {
1929 set_next(heap->the_hole_value(), SKIP_WRITE_BARRIER);
1930 }
1931
1932
1933 bool WeakCell::next_cleared() { return next()->IsTheHole(); }
1934
1935
1928 int JSObject::GetHeaderSize() { 1936 int JSObject::GetHeaderSize() {
1929 InstanceType type = map()->instance_type(); 1937 InstanceType type = map()->instance_type();
1930 // Check for the most common kind of JavaScript object before 1938 // Check for the most common kind of JavaScript object before
1931 // falling into the generic switch. This speeds up the internal 1939 // falling into the generic switch. This speeds up the internal
1932 // field operations considerably on average. 1940 // field operations considerably on average.
1933 if (type == JS_OBJECT_TYPE) return JSObject::kHeaderSize; 1941 if (type == JS_OBJECT_TYPE) return JSObject::kHeaderSize;
1934 switch (type) { 1942 switch (type) {
1935 case JS_GENERATOR_OBJECT_TYPE: 1943 case JS_GENERATOR_OBJECT_TYPE:
1936 return JSGeneratorObject::kSize; 1944 return JSGeneratorObject::kSize;
1937 case JS_MODULE_TYPE: 1945 case JS_MODULE_TYPE:
(...skipping 5348 matching lines...) Expand 10 before | Expand all | Expand 10 after
7286 #undef READ_SHORT_FIELD 7294 #undef READ_SHORT_FIELD
7287 #undef WRITE_SHORT_FIELD 7295 #undef WRITE_SHORT_FIELD
7288 #undef READ_BYTE_FIELD 7296 #undef READ_BYTE_FIELD
7289 #undef WRITE_BYTE_FIELD 7297 #undef WRITE_BYTE_FIELD
7290 #undef NOBARRIER_READ_BYTE_FIELD 7298 #undef NOBARRIER_READ_BYTE_FIELD
7291 #undef NOBARRIER_WRITE_BYTE_FIELD 7299 #undef NOBARRIER_WRITE_BYTE_FIELD
7292 7300
7293 } } // namespace v8::internal 7301 } } // namespace v8::internal
7294 7302
7295 #endif // V8_OBJECTS_INL_H_ 7303 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/snapshot/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698