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

Side by Side Diff: src/snapshot/serialize.cc

Issue 1488593003: Optimize clearing of map transitions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment Created 5 years 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-inl.h ('k') | no next file » | 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 #include "src/snapshot/serialize.h" 5 #include "src/snapshot/serialize.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/base/platform/platform.h" 9 #include "src/base/platform/platform.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1901 matching lines...) Expand 10 before | Expand all | Expand 10 after
1912 } 1912 }
1913 1913
1914 1914
1915 // Clear and later restore the next link in the weak cell, if the object is one. 1915 // Clear and later restore the next link in the weak cell, if the object is one.
1916 class UnlinkWeakCellScope { 1916 class UnlinkWeakCellScope {
1917 public: 1917 public:
1918 explicit UnlinkWeakCellScope(HeapObject* object) : weak_cell_(NULL) { 1918 explicit UnlinkWeakCellScope(HeapObject* object) : weak_cell_(NULL) {
1919 if (object->IsWeakCell()) { 1919 if (object->IsWeakCell()) {
1920 weak_cell_ = WeakCell::cast(object); 1920 weak_cell_ = WeakCell::cast(object);
1921 next_ = weak_cell_->next(); 1921 next_ = weak_cell_->next();
1922 weak_cell_->clear_next(object->GetHeap()); 1922 weak_cell_->clear_next(object->GetHeap()->the_hole_value());
1923 } 1923 }
1924 } 1924 }
1925 1925
1926 ~UnlinkWeakCellScope() { 1926 ~UnlinkWeakCellScope() {
1927 if (weak_cell_) weak_cell_->set_next(next_, UPDATE_WEAK_WRITE_BARRIER); 1927 if (weak_cell_) weak_cell_->set_next(next_, UPDATE_WEAK_WRITE_BARRIER);
1928 } 1928 }
1929 1929
1930 private: 1930 private:
1931 WeakCell* weak_cell_; 1931 WeakCell* weak_cell_;
1932 Object* next_; 1932 Object* next_;
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
2795 SerializedCodeData* scd = new SerializedCodeData(cached_data); 2795 SerializedCodeData* scd = new SerializedCodeData(cached_data);
2796 SanityCheckResult r = scd->SanityCheck(isolate, source); 2796 SanityCheckResult r = scd->SanityCheck(isolate, source);
2797 if (r == CHECK_SUCCESS) return scd; 2797 if (r == CHECK_SUCCESS) return scd;
2798 cached_data->Reject(); 2798 cached_data->Reject();
2799 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); 2799 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r);
2800 delete scd; 2800 delete scd;
2801 return NULL; 2801 return NULL;
2802 } 2802 }
2803 } // namespace internal 2803 } // namespace internal
2804 } // namespace v8 2804 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698