Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/v8.h" | 5 #include "src/v8.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/lookup.h" | 9 #include "src/lookup.h" |
| 10 #include "src/lookup-inl.h" | 10 #include "src/lookup-inl.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 | 221 |
| 222 Handle<JSObject> receiver = GetStoreTarget(); | 222 Handle<JSObject> receiver = GetStoreTarget(); |
| 223 if (receiver->IsGlobalObject()) return; | 223 if (receiver->IsGlobalObject()) return; |
| 224 holder_ = receiver; | 224 holder_ = receiver; |
| 225 holder_map_ = transition_map(); | 225 holder_map_ = transition_map(); |
| 226 JSObject::MigrateToMap(receiver, holder_map_); | 226 JSObject::MigrateToMap(receiver, holder_map_); |
| 227 ReloadPropertyInformation(); | 227 ReloadPropertyInformation(); |
| 228 } | 228 } |
| 229 | 229 |
| 230 | 230 |
| 231 void LookupIterator::Delete() { | |
| 232 Handle<JSObject> holder = Handle<JSObject>::cast(holder_); | |
| 233 if (IsElement()) { | |
| 234 ElementsAccessor* accessor = holder->GetElementsAccessor(); | |
| 235 accessor->Delete(holder, number_); | |
| 236 } else { | |
| 237 PropertyNormalizationMode mode = holder->map()->is_prototype_map() | |
| 238 ? KEEP_INOBJECT_PROPERTIES | |
| 239 : CLEAR_INOBJECT_PROPERTIES; | |
| 240 | |
| 241 if (holder->HasFastProperties()) { | |
| 242 JSObject::NormalizeProperties(holder, mode, 0, "DeletingProperty"); | |
| 243 holder_map_ = handle(holder->map(), isolate_); | |
| 244 ReloadPropertyInformation(); | |
| 245 } | |
| 246 // TODO(verwaest): Get rid of the name_ argument. | |
| 247 JSObject::DeleteNormalizedProperty(holder, name_, number_); | |
| 248 JSObject::ReoptimizeIfPrototype(holder); | |
|
Igor Sheludko
2015/07/03 15:09:02
Shouldn't you call NotFound() here?
| |
| 249 } | |
| 250 } | |
| 251 | |
| 252 | |
| 231 void LookupIterator::TransitionToAccessorProperty( | 253 void LookupIterator::TransitionToAccessorProperty( |
| 232 AccessorComponent component, Handle<Object> accessor, | 254 AccessorComponent component, Handle<Object> accessor, |
| 233 PropertyAttributes attributes) { | 255 PropertyAttributes attributes) { |
| 234 DCHECK(!accessor->IsNull()); | 256 DCHECK(!accessor->IsNull()); |
| 235 // Can only be called when the receiver is a JSObject. JSProxy has to be | 257 // Can only be called when the receiver is a JSObject. JSProxy has to be |
| 236 // handled via a trap. Adding properties to primitive values is not | 258 // handled via a trap. Adding properties to primitive values is not |
| 237 // observable. | 259 // observable. |
| 238 Handle<JSObject> receiver = GetStoreTarget(); | 260 Handle<JSObject> receiver = GetStoreTarget(); |
| 239 holder_ = receiver; | 261 holder_ = receiver; |
| 240 holder_map_ = | 262 holder_map_ = |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 475 case InterceptorState::kSkipNonMasking: | 497 case InterceptorState::kSkipNonMasking: |
| 476 return true; | 498 return true; |
| 477 case InterceptorState::kProcessNonMasking: | 499 case InterceptorState::kProcessNonMasking: |
| 478 return false; | 500 return false; |
| 479 } | 501 } |
| 480 } | 502 } |
| 481 return interceptor_state_ == InterceptorState::kProcessNonMasking; | 503 return interceptor_state_ == InterceptorState::kProcessNonMasking; |
| 482 } | 504 } |
| 483 } // namespace internal | 505 } // namespace internal |
| 484 } // namespace v8 | 506 } // namespace v8 |
| OLD | NEW |