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

Side by Side Diff: src/objects.cc

Issue 2495563002: [runtime] Treat empty property cells properly when doing Object.freeze() on a global object. (Closed)
Patch Set: Created 4 years, 1 month 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 | test/mjsunit/regress/regress-crbug-663750.js » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <memory> 9 #include <memory>
10 #include <sstream> 10 #include <sstream>
(...skipping 7986 matching lines...) Expand 10 before | Expand all | Expand 10 after
7997 dictionary->DetailsAtPut(entry, details); 7997 dictionary->DetailsAtPut(entry, details);
7998 } 7998 }
7999 7999
8000 template <> 8000 template <>
8001 void DictionaryDetailsAtPut<GlobalDictionary>( 8001 void DictionaryDetailsAtPut<GlobalDictionary>(
8002 Isolate* isolate, Handle<GlobalDictionary> dictionary, int entry, 8002 Isolate* isolate, Handle<GlobalDictionary> dictionary, int entry,
8003 PropertyDetails details) { 8003 PropertyDetails details) {
8004 Object* value = dictionary->ValueAt(entry); 8004 Object* value = dictionary->ValueAt(entry);
8005 DCHECK(value->IsPropertyCell()); 8005 DCHECK(value->IsPropertyCell());
8006 value = PropertyCell::cast(value)->value(); 8006 value = PropertyCell::cast(value)->value();
8007 if (value->IsTheHole(isolate)) return;
8007 PropertyCell::PrepareForValue(dictionary, entry, handle(value, isolate), 8008 PropertyCell::PrepareForValue(dictionary, entry, handle(value, isolate),
8008 details); 8009 details);
8009 } 8010 }
8010 8011
8011 template <typename Dictionary> 8012 template <typename Dictionary>
8012 void ApplyAttributesToDictionary(Isolate* isolate, 8013 void ApplyAttributesToDictionary(Isolate* isolate,
8013 Handle<Dictionary> dictionary, 8014 Handle<Dictionary> dictionary,
8014 const PropertyAttributes attributes) { 8015 const PropertyAttributes attributes) {
8015 int capacity = dictionary->Capacity(); 8016 int capacity = dictionary->Capacity();
8016 for (int i = 0; i < capacity; i++) { 8017 for (int i = 0; i < capacity; i++) {
(...skipping 12322 matching lines...) Expand 10 before | Expand all | Expand 10 after
20339 // Check if the accessor uses a cached property. 20340 // Check if the accessor uses a cached property.
20340 if (!fti->cached_property_name()->IsTheHole(isolate)) { 20341 if (!fti->cached_property_name()->IsTheHole(isolate)) {
20341 return handle(Name::cast(fti->cached_property_name())); 20342 return handle(Name::cast(fti->cached_property_name()));
20342 } 20343 }
20343 } 20344 }
20344 return MaybeHandle<Name>(); 20345 return MaybeHandle<Name>();
20345 } 20346 }
20346 20347
20347 } // namespace internal 20348 } // namespace internal
20348 } // namespace v8 20349 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-663750.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698