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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 216 |
217 Handle<JSObject> receiver = GetStoreTarget(); | 217 Handle<JSObject> receiver = GetStoreTarget(); |
218 if (receiver->IsGlobalObject()) return; | 218 if (receiver->IsGlobalObject()) return; |
219 holder_ = receiver; | 219 holder_ = receiver; |
220 holder_map_ = transition_map(); | 220 holder_map_ = transition_map(); |
221 JSObject::MigrateToMap(receiver, holder_map_); | 221 JSObject::MigrateToMap(receiver, holder_map_); |
222 ReloadPropertyInformation(); | 222 ReloadPropertyInformation(); |
223 } | 223 } |
224 | 224 |
225 | 225 |
| 226 void LookupIterator::Delete() { |
| 227 Handle<JSObject> holder = Handle<JSObject>::cast(holder_); |
| 228 if (IsElement()) { |
| 229 ElementsAccessor* accessor = holder->GetElementsAccessor(); |
| 230 accessor->Delete(holder, number_); |
| 231 } else { |
| 232 PropertyNormalizationMode mode = holder->map()->is_prototype_map() |
| 233 ? KEEP_INOBJECT_PROPERTIES |
| 234 : CLEAR_INOBJECT_PROPERTIES; |
| 235 |
| 236 if (holder->HasFastProperties()) { |
| 237 JSObject::NormalizeProperties(holder, mode, 0, "DeletingProperty"); |
| 238 holder_map_ = handle(holder->map(), isolate_); |
| 239 ReloadPropertyInformation(); |
| 240 } |
| 241 // TODO(verwaest): Get rid of the name_ argument. |
| 242 JSObject::DeleteNormalizedProperty(holder, name_, number_); |
| 243 JSObject::ReoptimizeIfPrototype(holder); |
| 244 } |
| 245 } |
| 246 |
| 247 |
226 void LookupIterator::TransitionToAccessorProperty( | 248 void LookupIterator::TransitionToAccessorProperty( |
227 AccessorComponent component, Handle<Object> accessor, | 249 AccessorComponent component, Handle<Object> accessor, |
228 PropertyAttributes attributes) { | 250 PropertyAttributes attributes) { |
229 DCHECK(!accessor->IsNull()); | 251 DCHECK(!accessor->IsNull()); |
230 // Can only be called when the receiver is a JSObject. JSProxy has to be | 252 // Can only be called when the receiver is a JSObject. JSProxy has to be |
231 // handled via a trap. Adding properties to primitive values is not | 253 // handled via a trap. Adding properties to primitive values is not |
232 // observable. | 254 // observable. |
233 Handle<JSObject> receiver = GetStoreTarget(); | 255 Handle<JSObject> receiver = GetStoreTarget(); |
234 holder_ = receiver; | 256 holder_ = receiver; |
235 holder_map_ = | 257 holder_map_ = |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 case InterceptorState::kSkipNonMasking: | 492 case InterceptorState::kSkipNonMasking: |
471 return true; | 493 return true; |
472 case InterceptorState::kProcessNonMasking: | 494 case InterceptorState::kProcessNonMasking: |
473 return false; | 495 return false; |
474 } | 496 } |
475 } | 497 } |
476 return interceptor_state_ == InterceptorState::kProcessNonMasking; | 498 return interceptor_state_ == InterceptorState::kProcessNonMasking; |
477 } | 499 } |
478 } // namespace internal | 500 } // namespace internal |
479 } // namespace v8 | 501 } // namespace v8 |
OLD | NEW |