| 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 4442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4453 } | 4453 } |
| 4454 } | 4454 } |
| 4455 | 4455 |
| 4456 // Allocate an array with storage for all the property names. | 4456 // Allocate an array with storage for all the property names. |
| 4457 Handle<FixedArray> names = | 4457 Handle<FixedArray> names = |
| 4458 isolate->factory()->NewFixedArray(total_property_count); | 4458 isolate->factory()->NewFixedArray(total_property_count); |
| 4459 | 4459 |
| 4460 // Get the property names. | 4460 // Get the property names. |
| 4461 jsproto = obj; | 4461 jsproto = obj; |
| 4462 int proto_with_hidden_properties = 0; | 4462 int proto_with_hidden_properties = 0; |
| 4463 int next_copy_index = 0; |
| 4463 for (int i = 0; i < length; i++) { | 4464 for (int i = 0; i < length; i++) { |
| 4464 jsproto->GetLocalPropertyNames(*names, | 4465 jsproto->GetLocalPropertyNames(*names, next_copy_index); |
| 4465 i == 0 ? 0 : local_property_count[i - 1]); | 4466 next_copy_index += local_property_count[i]; |
| 4466 if (!GetHiddenProperties(jsproto, false)->IsUndefined()) { | 4467 if (!GetHiddenProperties(jsproto, false)->IsUndefined()) { |
| 4467 proto_with_hidden_properties++; | 4468 proto_with_hidden_properties++; |
| 4468 } | 4469 } |
| 4469 if (i < length - 1) { | 4470 if (i < length - 1) { |
| 4470 jsproto = Handle<JSObject>(JSObject::cast(jsproto->GetPrototype())); | 4471 jsproto = Handle<JSObject>(JSObject::cast(jsproto->GetPrototype())); |
| 4471 } | 4472 } |
| 4472 } | 4473 } |
| 4473 | 4474 |
| 4474 // Filter out name of hidden propeties object. | 4475 // Filter out name of hidden propeties object. |
| 4475 if (proto_with_hidden_properties > 0) { | 4476 if (proto_with_hidden_properties > 0) { |
| (...skipping 8218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12694 } else { | 12695 } else { |
| 12695 // Handle last resort GC and make sure to allow future allocations | 12696 // Handle last resort GC and make sure to allow future allocations |
| 12696 // to grow the heap without causing GCs (if possible). | 12697 // to grow the heap without causing GCs (if possible). |
| 12697 isolate->counters()->gc_last_resort_from_js()->Increment(); | 12698 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 12698 isolate->heap()->CollectAllGarbage(false); | 12699 isolate->heap()->CollectAllGarbage(false); |
| 12699 } | 12700 } |
| 12700 } | 12701 } |
| 12701 | 12702 |
| 12702 | 12703 |
| 12703 } } // namespace v8::internal | 12704 } } // namespace v8::internal |
| OLD | NEW |