OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3224 StringDictionary::Allocate( | 3224 StringDictionary::Allocate( |
3225 map->NumberOfDescribedProperties() * 2 + initial_size); | 3225 map->NumberOfDescribedProperties() * 2 + initial_size); |
3226 if (!maybe_obj->ToObject(&obj)) return maybe_obj; | 3226 if (!maybe_obj->ToObject(&obj)) return maybe_obj; |
3227 } | 3227 } |
3228 StringDictionary* dictionary = StringDictionary::cast(obj); | 3228 StringDictionary* dictionary = StringDictionary::cast(obj); |
3229 | 3229 |
3230 // The global object might be created from an object template with accessors. | 3230 // The global object might be created from an object template with accessors. |
3231 // Fill these accessors into the dictionary. | 3231 // Fill these accessors into the dictionary. |
3232 DescriptorArray* descs = map->instance_descriptors(); | 3232 DescriptorArray* descs = map->instance_descriptors(); |
3233 for (int i = 0; i < descs->number_of_descriptors(); i++) { | 3233 for (int i = 0; i < descs->number_of_descriptors(); i++) { |
3234 PropertyDetails details = descs->GetDetails(i); | 3234 PropertyDetails details(descs->GetDetails(i)); |
3235 ASSERT(details.type() == CALLBACKS); // Only accessors are expected. | 3235 ASSERT(details.type() == CALLBACKS); // Only accessors are expected. |
3236 PropertyDetails d = | 3236 PropertyDetails d = |
3237 PropertyDetails(details.attributes(), CALLBACKS, details.index()); | 3237 PropertyDetails(details.attributes(), CALLBACKS, details.index()); |
3238 Object* value = descs->GetCallbacksObject(i); | 3238 Object* value = descs->GetCallbacksObject(i); |
3239 { MaybeObject* maybe_value = AllocateJSGlobalPropertyCell(value); | 3239 { MaybeObject* maybe_value = AllocateJSGlobalPropertyCell(value); |
3240 if (!maybe_value->ToObject(&value)) return maybe_value; | 3240 if (!maybe_value->ToObject(&value)) return maybe_value; |
3241 } | 3241 } |
3242 | 3242 |
3243 Object* result; | 3243 Object* result; |
3244 { MaybeObject* maybe_result = dictionary->Add(descs->GetKey(i), value, d); | 3244 { MaybeObject* maybe_result = dictionary->Add(descs->GetKey(i), value, d); |
(...skipping 2602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5847 } | 5847 } |
5848 | 5848 |
5849 | 5849 |
5850 void ExternalStringTable::TearDown() { | 5850 void ExternalStringTable::TearDown() { |
5851 new_space_strings_.Free(); | 5851 new_space_strings_.Free(); |
5852 old_space_strings_.Free(); | 5852 old_space_strings_.Free(); |
5853 } | 5853 } |
5854 | 5854 |
5855 | 5855 |
5856 } } // namespace v8::internal | 5856 } } // namespace v8::internal |
OLD | NEW |