| OLD | NEW |
| 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 <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 8237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8248 Handle<JSObject> object, | 8248 Handle<JSObject> object, |
| 8249 AllocationSiteUsageContext* site_context, | 8249 AllocationSiteUsageContext* site_context, |
| 8250 DeepCopyHints hints) { | 8250 DeepCopyHints hints) { |
| 8251 JSObjectWalkVisitor<AllocationSiteUsageContext> v(site_context, true, hints); | 8251 JSObjectWalkVisitor<AllocationSiteUsageContext> v(site_context, true, hints); |
| 8252 MaybeHandle<JSObject> copy = v.StructureWalk(object); | 8252 MaybeHandle<JSObject> copy = v.StructureWalk(object); |
| 8253 Handle<JSObject> for_assert; | 8253 Handle<JSObject> for_assert; |
| 8254 DCHECK(!copy.ToHandle(&for_assert) || !for_assert.is_identical_to(object)); | 8254 DCHECK(!copy.ToHandle(&for_assert) || !for_assert.is_identical_to(object)); |
| 8255 return copy; | 8255 return copy; |
| 8256 } | 8256 } |
| 8257 | 8257 |
| 8258 class DummyContextObject : public AllocationSiteContext { | |
| 8259 public: | |
| 8260 explicit DummyContextObject(Isolate* isolate) | |
| 8261 : AllocationSiteContext(isolate) {} | |
| 8262 | |
| 8263 bool ShouldCreateMemento(Handle<JSObject> object) { return false; } | |
| 8264 Handle<AllocationSite> EnterNewScope() { return Handle<AllocationSite>(); } | |
| 8265 void ExitScope(Handle<AllocationSite> site, Handle<JSObject> object) {} | |
| 8266 }; | |
| 8267 | |
| 8268 MaybeHandle<JSObject> JSObject::DeepCopy(Handle<JSObject> object, | |
| 8269 DeepCopyHints hints) { | |
| 8270 DummyContextObject dummy_context_object(object->GetIsolate()); | |
| 8271 JSObjectWalkVisitor<DummyContextObject> v(&dummy_context_object, true, hints); | |
| 8272 MaybeHandle<JSObject> copy = v.StructureWalk(object); | |
| 8273 Handle<JSObject> for_assert; | |
| 8274 DCHECK(!copy.ToHandle(&for_assert) || !for_assert.is_identical_to(object)); | |
| 8275 return copy; | |
| 8276 } | |
| 8277 | 8258 |
| 8278 // static | 8259 // static |
| 8279 MaybeHandle<Object> JSReceiver::ToPrimitive(Handle<JSReceiver> receiver, | 8260 MaybeHandle<Object> JSReceiver::ToPrimitive(Handle<JSReceiver> receiver, |
| 8280 ToPrimitiveHint hint) { | 8261 ToPrimitiveHint hint) { |
| 8281 Isolate* const isolate = receiver->GetIsolate(); | 8262 Isolate* const isolate = receiver->GetIsolate(); |
| 8282 Handle<Object> exotic_to_prim; | 8263 Handle<Object> exotic_to_prim; |
| 8283 ASSIGN_RETURN_ON_EXCEPTION( | 8264 ASSIGN_RETURN_ON_EXCEPTION( |
| 8284 isolate, exotic_to_prim, | 8265 isolate, exotic_to_prim, |
| 8285 GetMethod(receiver, isolate->factory()->to_primitive_symbol()), Object); | 8266 GetMethod(receiver, isolate->factory()->to_primitive_symbol()), Object); |
| 8286 if (!exotic_to_prim->IsUndefined()) { | 8267 if (!exotic_to_prim->IsUndefined()) { |
| (...skipping 11502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19789 if (cell->value() != *new_value) { | 19770 if (cell->value() != *new_value) { |
| 19790 cell->set_value(*new_value); | 19771 cell->set_value(*new_value); |
| 19791 Isolate* isolate = cell->GetIsolate(); | 19772 Isolate* isolate = cell->GetIsolate(); |
| 19792 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19773 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 19793 isolate, DependentCode::kPropertyCellChangedGroup); | 19774 isolate, DependentCode::kPropertyCellChangedGroup); |
| 19794 } | 19775 } |
| 19795 } | 19776 } |
| 19796 | 19777 |
| 19797 } // namespace internal | 19778 } // namespace internal |
| 19798 } // namespace v8 | 19779 } // namespace v8 |
| OLD | NEW |