| 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/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/extensions/externalize-string-extension.h" | 10 #include "src/extensions/externalize-string-extension.h" |
| (...skipping 3552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3563 break; | 3563 break; |
| 3564 } | 3564 } |
| 3565 } | 3565 } |
| 3566 } | 3566 } |
| 3567 } else if (from->IsJSGlobalObject()) { | 3567 } else if (from->IsJSGlobalObject()) { |
| 3568 Handle<GlobalDictionary> properties = | 3568 Handle<GlobalDictionary> properties = |
| 3569 Handle<GlobalDictionary>(from->global_dictionary()); | 3569 Handle<GlobalDictionary>(from->global_dictionary()); |
| 3570 int capacity = properties->Capacity(); | 3570 int capacity = properties->Capacity(); |
| 3571 for (int i = 0; i < capacity; i++) { | 3571 for (int i = 0; i < capacity; i++) { |
| 3572 Object* raw_key(properties->KeyAt(i)); | 3572 Object* raw_key(properties->KeyAt(i)); |
| 3573 if (properties->IsKey(raw_key)) { | 3573 if (properties->IsKey(isolate(), raw_key)) { |
| 3574 DCHECK(raw_key->IsName()); | 3574 DCHECK(raw_key->IsName()); |
| 3575 // If the property is already there we skip it. | 3575 // If the property is already there we skip it. |
| 3576 Handle<Name> key(Name::cast(raw_key)); | 3576 Handle<Name> key(Name::cast(raw_key)); |
| 3577 LookupIterator it(to, key, LookupIterator::OWN_SKIP_INTERCEPTOR); | 3577 LookupIterator it(to, key, LookupIterator::OWN_SKIP_INTERCEPTOR); |
| 3578 CHECK_NE(LookupIterator::ACCESS_CHECK, it.state()); | 3578 CHECK_NE(LookupIterator::ACCESS_CHECK, it.state()); |
| 3579 if (it.IsFound()) continue; | 3579 if (it.IsFound()) continue; |
| 3580 // Set the property. | 3580 // Set the property. |
| 3581 DCHECK(properties->ValueAt(i)->IsPropertyCell()); | 3581 DCHECK(properties->ValueAt(i)->IsPropertyCell()); |
| 3582 Handle<PropertyCell> cell(PropertyCell::cast(properties->ValueAt(i))); | 3582 Handle<PropertyCell> cell(PropertyCell::cast(properties->ValueAt(i))); |
| 3583 Handle<Object> value(cell->value(), isolate()); | 3583 Handle<Object> value(cell->value(), isolate()); |
| 3584 if (value->IsTheHole(isolate())) continue; | 3584 if (value->IsTheHole(isolate())) continue; |
| 3585 PropertyDetails details = cell->property_details(); | 3585 PropertyDetails details = cell->property_details(); |
| 3586 DCHECK_EQ(kData, details.kind()); | 3586 DCHECK_EQ(kData, details.kind()); |
| 3587 JSObject::AddProperty(to, key, value, details.attributes()); | 3587 JSObject::AddProperty(to, key, value, details.attributes()); |
| 3588 } | 3588 } |
| 3589 } | 3589 } |
| 3590 } else { | 3590 } else { |
| 3591 Handle<NameDictionary> properties = | 3591 Handle<NameDictionary> properties = |
| 3592 Handle<NameDictionary>(from->property_dictionary()); | 3592 Handle<NameDictionary>(from->property_dictionary()); |
| 3593 int capacity = properties->Capacity(); | 3593 int capacity = properties->Capacity(); |
| 3594 for (int i = 0; i < capacity; i++) { | 3594 for (int i = 0; i < capacity; i++) { |
| 3595 Object* raw_key(properties->KeyAt(i)); | 3595 Object* raw_key(properties->KeyAt(i)); |
| 3596 if (properties->IsKey(raw_key)) { | 3596 if (properties->IsKey(isolate(), raw_key)) { |
| 3597 DCHECK(raw_key->IsName()); | 3597 DCHECK(raw_key->IsName()); |
| 3598 // If the property is already there we skip it. | 3598 // If the property is already there we skip it. |
| 3599 Handle<Name> key(Name::cast(raw_key)); | 3599 Handle<Name> key(Name::cast(raw_key)); |
| 3600 LookupIterator it(to, key, LookupIterator::OWN_SKIP_INTERCEPTOR); | 3600 LookupIterator it(to, key, LookupIterator::OWN_SKIP_INTERCEPTOR); |
| 3601 CHECK_NE(LookupIterator::ACCESS_CHECK, it.state()); | 3601 CHECK_NE(LookupIterator::ACCESS_CHECK, it.state()); |
| 3602 if (it.IsFound()) continue; | 3602 if (it.IsFound()) continue; |
| 3603 // Set the property. | 3603 // Set the property. |
| 3604 Handle<Object> value = Handle<Object>(properties->ValueAt(i), | 3604 Handle<Object> value = Handle<Object>(properties->ValueAt(i), |
| 3605 isolate()); | 3605 isolate()); |
| 3606 DCHECK(!value->IsCell()); | 3606 DCHECK(!value->IsCell()); |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3817 } | 3817 } |
| 3818 | 3818 |
| 3819 | 3819 |
| 3820 // Called when the top-level V8 mutex is destroyed. | 3820 // Called when the top-level V8 mutex is destroyed. |
| 3821 void Bootstrapper::FreeThreadResources() { | 3821 void Bootstrapper::FreeThreadResources() { |
| 3822 DCHECK(!IsActive()); | 3822 DCHECK(!IsActive()); |
| 3823 } | 3823 } |
| 3824 | 3824 |
| 3825 } // namespace internal | 3825 } // namespace internal |
| 3826 } // namespace v8 | 3826 } // namespace v8 |
| OLD | NEW |