| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 <iomanip> | 5 #include <iomanip> |
| 6 #include <sstream> | 6 #include <sstream> |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
| (...skipping 5725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5736 RETURN_ON_EXCEPTION( | 5736 RETURN_ON_EXCEPTION( |
| 5737 isolate, | 5737 isolate, |
| 5738 EnqueueChangeRecord(object, "preventExtensions", Handle<Name>(), | 5738 EnqueueChangeRecord(object, "preventExtensions", Handle<Name>(), |
| 5739 isolate->factory()->the_hole_value()), | 5739 isolate->factory()->the_hole_value()), |
| 5740 Object); | 5740 Object); |
| 5741 } | 5741 } |
| 5742 return object; | 5742 return object; |
| 5743 } | 5743 } |
| 5744 | 5744 |
| 5745 | 5745 |
| 5746 bool JSObject::IsExtensible() { |
| 5747 if (IsJSGlobalProxy()) { |
| 5748 PrototypeIterator iter(GetIsolate(), this); |
| 5749 if (iter.IsAtEnd()) return false; |
| 5750 DCHECK(iter.GetCurrent()->IsJSGlobalObject()); |
| 5751 return JSObject::cast(iter.GetCurrent())->map()->is_extensible(); |
| 5752 } |
| 5753 return map()->is_extensible(); |
| 5754 } |
| 5755 |
| 5756 |
| 5746 Handle<SeededNumberDictionary> JSObject::GetNormalizedElementDictionary( | 5757 Handle<SeededNumberDictionary> JSObject::GetNormalizedElementDictionary( |
| 5747 Handle<JSObject> object) { | 5758 Handle<JSObject> object) { |
| 5748 DCHECK(!object->elements()->IsDictionary()); | 5759 DCHECK(!object->elements()->IsDictionary()); |
| 5749 Isolate* isolate = object->GetIsolate(); | 5760 Isolate* isolate = object->GetIsolate(); |
| 5750 int length = object->IsJSArray() | 5761 int length = object->IsJSArray() |
| 5751 ? Smi::cast(Handle<JSArray>::cast(object)->length())->value() | 5762 ? Smi::cast(Handle<JSArray>::cast(object)->length())->value() |
| 5752 : object->elements()->length(); | 5763 : object->elements()->length(); |
| 5753 if (length > 0) { | 5764 if (length > 0) { |
| 5754 int capacity = 0; | 5765 int capacity = 0; |
| 5755 int used = 0; | 5766 int used = 0; |
| (...skipping 11572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17328 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, | 17339 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, |
| 17329 Handle<Object> new_value) { | 17340 Handle<Object> new_value) { |
| 17330 if (cell->value() != *new_value) { | 17341 if (cell->value() != *new_value) { |
| 17331 cell->set_value(*new_value); | 17342 cell->set_value(*new_value); |
| 17332 Isolate* isolate = cell->GetIsolate(); | 17343 Isolate* isolate = cell->GetIsolate(); |
| 17333 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 17344 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 17334 isolate, DependentCode::kPropertyCellChangedGroup); | 17345 isolate, DependentCode::kPropertyCellChangedGroup); |
| 17335 } | 17346 } |
| 17336 } | 17347 } |
| 17337 } } // namespace v8::internal | 17348 } } // namespace v8::internal |
| OLD | NEW |