OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2172 | 2172 |
2173 CallbacksDescriptor new_desc(name, | 2173 CallbacksDescriptor new_desc(name, |
2174 instance_desc->GetValue(index), | 2174 instance_desc->GetValue(index), |
2175 static_cast<PropertyAttributes>(details.attributes() | READ_ONLY), | 2175 static_cast<PropertyAttributes>(details.attributes() | READ_ONLY), |
2176 details.descriptor_index()); | 2176 details.descriptor_index()); |
2177 | 2177 |
2178 // Create a new map featuring the new field descriptors array. | 2178 // Create a new map featuring the new field descriptors array. |
2179 Map* new_map; | 2179 Map* new_map; |
2180 MaybeObject* maybe_map = | 2180 MaybeObject* maybe_map = |
2181 function->map()->CopyReplaceDescriptor( | 2181 function->map()->CopyReplaceDescriptor( |
2182 &new_desc, index, OMIT_TRANSITION); | 2182 instance_desc, &new_desc, index, OMIT_TRANSITION); |
2183 if (!maybe_map->To(&new_map)) return maybe_map; | 2183 if (!maybe_map->To(&new_map)) return maybe_map; |
2184 | 2184 |
2185 function->set_map(new_map); | 2185 function->set_map(new_map); |
2186 } else { // Dictionary properties. | 2186 } else { // Dictionary properties. |
2187 // Directly manipulate the property details. | 2187 // Directly manipulate the property details. |
2188 int entry = function->property_dictionary()->FindEntry(name); | 2188 int entry = function->property_dictionary()->FindEntry(name); |
2189 ASSERT(entry != StringDictionary::kNotFound); | 2189 ASSERT(entry != StringDictionary::kNotFound); |
2190 PropertyDetails details = function->property_dictionary()->DetailsAt(entry); | 2190 PropertyDetails details = function->property_dictionary()->DetailsAt(entry); |
2191 PropertyDetails new_details( | 2191 PropertyDetails new_details( |
2192 static_cast<PropertyAttributes>(details.attributes() | READ_ONLY), | 2192 static_cast<PropertyAttributes>(details.attributes() | READ_ONLY), |
(...skipping 11086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13279 // Handle last resort GC and make sure to allow future allocations | 13279 // Handle last resort GC and make sure to allow future allocations |
13280 // to grow the heap without causing GCs (if possible). | 13280 // to grow the heap without causing GCs (if possible). |
13281 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13281 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13282 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13282 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13283 "Runtime::PerformGC"); | 13283 "Runtime::PerformGC"); |
13284 } | 13284 } |
13285 } | 13285 } |
13286 | 13286 |
13287 | 13287 |
13288 } } // namespace v8::internal | 13288 } } // namespace v8::internal |
OLD | NEW |