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

Side by Side Diff: src/lookup.cc

Issue 1361103002: [field type tracking] Fix handling of cleared WeakCells (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add more --verify-heap checks after object migrations Created 5 years, 3 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/accessors.cc ('k') | src/objects.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/lookup.h" 5 #include "src/lookup.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/deoptimizer.h" 8 #include "src/deoptimizer.h"
9 #include "src/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 #include "src/lookup-inl.h" 10 #include "src/lookup-inl.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 JSObject::SetNormalizedProperty(holder, name(), value, details); 171 JSObject::SetNormalizedProperty(holder, name(), value, details);
172 } else { 172 } else {
173 holder_map_ = Map::ReconfigureExistingProperty( 173 holder_map_ = Map::ReconfigureExistingProperty(
174 holder_map_, descriptor_number(), i::kData, attributes); 174 holder_map_, descriptor_number(), i::kData, attributes);
175 holder_map_ = 175 holder_map_ =
176 Map::PrepareForDataProperty(holder_map_, descriptor_number(), value); 176 Map::PrepareForDataProperty(holder_map_, descriptor_number(), value);
177 JSObject::MigrateToMap(holder, holder_map_); 177 JSObject::MigrateToMap(holder, holder_map_);
178 } 178 }
179 179
180 ReloadPropertyInformation(); 180 ReloadPropertyInformation();
181 WriteDataValue(value);
182
183 #if VERIFY_HEAP
184 if (FLAG_verify_heap) {
185 holder->JSObjectVerify();
186 }
187 #endif
181 } 188 }
182 189
183 190
184 void LookupIterator::PrepareTransitionToDataProperty( 191 void LookupIterator::PrepareTransitionToDataProperty(
185 Handle<Object> value, PropertyAttributes attributes, 192 Handle<Object> value, PropertyAttributes attributes,
186 Object::StoreFromKeyed store_mode) { 193 Object::StoreFromKeyed store_mode) {
187 if (state_ == TRANSITION) return; 194 if (state_ == TRANSITION) return;
188 DCHECK(state_ != LookupIterator::ACCESSOR || 195 DCHECK(state_ != LookupIterator::ACCESSOR ||
189 (GetAccessors()->IsAccessorInfo() && 196 (GetAccessors()->IsAccessorInfo() &&
190 AccessorInfo::cast(*GetAccessors())->is_special_data_property())); 197 AccessorInfo::cast(*GetAccessors())->is_special_data_property()));
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 } else { 290 } else {
284 pair = AccessorPair::Copy(pair); 291 pair = AccessorPair::Copy(pair);
285 pair->set(component, *accessor); 292 pair->set(component, *accessor);
286 } 293 }
287 } else { 294 } else {
288 pair = factory()->NewAccessorPair(); 295 pair = factory()->NewAccessorPair();
289 pair->set(component, *accessor); 296 pair->set(component, *accessor);
290 } 297 }
291 298
292 TransitionToAccessorPair(pair, attributes); 299 TransitionToAccessorPair(pair, attributes);
300
301 #if VERIFY_HEAP
302 if (FLAG_verify_heap) {
303 receiver->JSObjectVerify();
304 }
305 #endif
293 } 306 }
294 307
295 308
296 void LookupIterator::TransitionToAccessorPair(Handle<Object> pair, 309 void LookupIterator::TransitionToAccessorPair(Handle<Object> pair,
297 PropertyAttributes attributes) { 310 PropertyAttributes attributes) {
298 Handle<JSObject> receiver = GetStoreTarget(); 311 Handle<JSObject> receiver = GetStoreTarget();
299 holder_ = receiver; 312 holder_ = receiver;
300 313
301 PropertyDetails details(attributes, ACCESSOR_CONSTANT, 0, 314 PropertyDetails details(attributes, ACCESSOR_CONSTANT, 0,
302 PropertyCellType::kMutable); 315 PropertyCellType::kMutable);
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 case InterceptorState::kSkipNonMasking: 556 case InterceptorState::kSkipNonMasking:
544 return true; 557 return true;
545 case InterceptorState::kProcessNonMasking: 558 case InterceptorState::kProcessNonMasking:
546 return false; 559 return false;
547 } 560 }
548 } 561 }
549 return interceptor_state_ == InterceptorState::kProcessNonMasking; 562 return interceptor_state_ == InterceptorState::kProcessNonMasking;
550 } 563 }
551 } // namespace internal 564 } // namespace internal
552 } // namespace v8 565 } // namespace v8
OLDNEW
« no previous file with comments | « src/accessors.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698