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 8218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8229 Handle<JSObject> object, | 8229 Handle<JSObject> object, |
8230 AllocationSiteUsageContext* site_context, | 8230 AllocationSiteUsageContext* site_context, |
8231 DeepCopyHints hints) { | 8231 DeepCopyHints hints) { |
8232 JSObjectWalkVisitor<AllocationSiteUsageContext> v(site_context, true, hints); | 8232 JSObjectWalkVisitor<AllocationSiteUsageContext> v(site_context, true, hints); |
8233 MaybeHandle<JSObject> copy = v.StructureWalk(object); | 8233 MaybeHandle<JSObject> copy = v.StructureWalk(object); |
8234 Handle<JSObject> for_assert; | 8234 Handle<JSObject> for_assert; |
8235 DCHECK(!copy.ToHandle(&for_assert) || !for_assert.is_identical_to(object)); | 8235 DCHECK(!copy.ToHandle(&for_assert) || !for_assert.is_identical_to(object)); |
8236 return copy; | 8236 return copy; |
8237 } | 8237 } |
8238 | 8238 |
8239 class DummyContextObject : public AllocationSiteContext { | |
8240 public: | |
8241 explicit DummyContextObject(Isolate* isolate) | |
8242 : AllocationSiteContext(isolate) {} | |
8243 | |
8244 bool ShouldCreateMemento(Handle<JSObject> object) { return false; } | |
8245 Handle<AllocationSite> EnterNewScope() { return Handle<AllocationSite>(); } | |
8246 void ExitScope(Handle<AllocationSite> site, Handle<JSObject> object) {} | |
8247 }; | |
8248 | |
8249 MaybeHandle<JSObject> JSObject::DeepCopy(Handle<JSObject> object, | |
8250 DeepCopyHints hints) { | |
8251 DummyContextObject dummy_context_object(object->GetIsolate()); | |
8252 JSObjectWalkVisitor<DummyContextObject> v(&dummy_context_object, true, hints); | |
8253 MaybeHandle<JSObject> copy = v.StructureWalk(object); | |
8254 Handle<JSObject> for_assert; | |
8255 DCHECK(!copy.ToHandle(&for_assert) || !for_assert.is_identical_to(object)); | |
8256 return copy; | |
8257 } | |
8258 | 8239 |
8259 // static | 8240 // static |
8260 MaybeHandle<Object> JSReceiver::ToPrimitive(Handle<JSReceiver> receiver, | 8241 MaybeHandle<Object> JSReceiver::ToPrimitive(Handle<JSReceiver> receiver, |
8261 ToPrimitiveHint hint) { | 8242 ToPrimitiveHint hint) { |
8262 Isolate* const isolate = receiver->GetIsolate(); | 8243 Isolate* const isolate = receiver->GetIsolate(); |
8263 Handle<Object> exotic_to_prim; | 8244 Handle<Object> exotic_to_prim; |
8264 ASSIGN_RETURN_ON_EXCEPTION( | 8245 ASSIGN_RETURN_ON_EXCEPTION( |
8265 isolate, exotic_to_prim, | 8246 isolate, exotic_to_prim, |
8266 GetMethod(receiver, isolate->factory()->to_primitive_symbol()), Object); | 8247 GetMethod(receiver, isolate->factory()->to_primitive_symbol()), Object); |
8267 if (!exotic_to_prim->IsUndefined()) { | 8248 if (!exotic_to_prim->IsUndefined()) { |
(...skipping 11500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19768 if (cell->value() != *new_value) { | 19749 if (cell->value() != *new_value) { |
19769 cell->set_value(*new_value); | 19750 cell->set_value(*new_value); |
19770 Isolate* isolate = cell->GetIsolate(); | 19751 Isolate* isolate = cell->GetIsolate(); |
19771 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19752 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
19772 isolate, DependentCode::kPropertyCellChangedGroup); | 19753 isolate, DependentCode::kPropertyCellChangedGroup); |
19773 } | 19754 } |
19774 } | 19755 } |
19775 | 19756 |
19776 } // namespace internal | 19757 } // namespace internal |
19777 } // namespace v8 | 19758 } // namespace v8 |
OLD | NEW |