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/base/utils/random-number-generator.h" | 9 #include "src/base/utils/random-number-generator.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 2873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2884 for (int i = 0; i < capacity; i++) { | 2884 for (int i = 0; i < capacity; i++) { |
2885 Object* raw_key(properties->KeyAt(i)); | 2885 Object* raw_key(properties->KeyAt(i)); |
2886 if (properties->IsKey(raw_key)) { | 2886 if (properties->IsKey(raw_key)) { |
2887 DCHECK(raw_key->IsName()); | 2887 DCHECK(raw_key->IsName()); |
2888 // If the property is already there we skip it. | 2888 // If the property is already there we skip it. |
2889 Handle<Name> key(Name::cast(raw_key)); | 2889 Handle<Name> key(Name::cast(raw_key)); |
2890 LookupIterator it(to, key, LookupIterator::OWN_SKIP_INTERCEPTOR); | 2890 LookupIterator it(to, key, LookupIterator::OWN_SKIP_INTERCEPTOR); |
2891 CHECK_NE(LookupIterator::ACCESS_CHECK, it.state()); | 2891 CHECK_NE(LookupIterator::ACCESS_CHECK, it.state()); |
2892 if (it.IsFound()) continue; | 2892 if (it.IsFound()) continue; |
2893 // Set the property. | 2893 // Set the property. |
2894 Handle<Object> value = | 2894 DCHECK(properties->ValueAt(i)->IsPropertyCell()); |
2895 Handle<Object>(properties->ValueAt(i), isolate()); | 2895 Handle<PropertyCell> cell(PropertyCell::cast(properties->ValueAt(i))); |
2896 DCHECK(value->IsPropertyCell()); | 2896 Handle<Object> value(cell->value(), isolate()); |
2897 value = handle(PropertyCell::cast(*value)->value(), isolate()); | |
2898 if (value->IsTheHole()) continue; | 2897 if (value->IsTheHole()) continue; |
2899 PropertyDetails details = properties->DetailsAt(i); | 2898 PropertyDetails details = cell->property_details(); |
2900 DCHECK_EQ(kData, details.kind()); | 2899 DCHECK_EQ(kData, details.kind()); |
2901 JSObject::AddProperty(to, key, value, details.attributes()); | 2900 JSObject::AddProperty(to, key, value, details.attributes()); |
2902 } | 2901 } |
2903 } | 2902 } |
2904 } else { | 2903 } else { |
2905 Handle<NameDictionary> properties = | 2904 Handle<NameDictionary> properties = |
2906 Handle<NameDictionary>(from->property_dictionary()); | 2905 Handle<NameDictionary>(from->property_dictionary()); |
2907 int capacity = properties->Capacity(); | 2906 int capacity = properties->Capacity(); |
2908 for (int i = 0; i < capacity; i++) { | 2907 for (int i = 0; i < capacity; i++) { |
2909 Object* raw_key(properties->KeyAt(i)); | 2908 Object* raw_key(properties->KeyAt(i)); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3113 return from + sizeof(NestingCounterType); | 3112 return from + sizeof(NestingCounterType); |
3114 } | 3113 } |
3115 | 3114 |
3116 | 3115 |
3117 // Called when the top-level V8 mutex is destroyed. | 3116 // Called when the top-level V8 mutex is destroyed. |
3118 void Bootstrapper::FreeThreadResources() { | 3117 void Bootstrapper::FreeThreadResources() { |
3119 DCHECK(!IsActive()); | 3118 DCHECK(!IsActive()); |
3120 } | 3119 } |
3121 | 3120 |
3122 } } // namespace v8::internal | 3121 } } // namespace v8::internal |
OLD | NEW |