| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 5237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5248 Factory::DictionaryAtNumberPut(dict, index, elm); | 5248 Factory::DictionaryAtNumberPut(dict, index, elm); |
| 5249 if (!result.is_identical_to(dict)) | 5249 if (!result.is_identical_to(dict)) |
| 5250 storage_ = result; | 5250 storage_ = result; |
| 5251 } | 5251 } |
| 5252 } | 5252 } |
| 5253 | 5253 |
| 5254 void increase_index_offset(uint32_t delta) { | 5254 void increase_index_offset(uint32_t delta) { |
| 5255 index_offset_ += delta; | 5255 index_offset_ += delta; |
| 5256 } | 5256 } |
| 5257 | 5257 |
| 5258 Handle<FixedArray> storage() { return storage_; } |
| 5259 |
| 5258 private: | 5260 private: |
| 5259 Handle<FixedArray> storage_; | 5261 Handle<FixedArray> storage_; |
| 5260 uint32_t index_limit_; | 5262 uint32_t index_limit_; |
| 5261 bool fast_elements_; | 5263 bool fast_elements_; |
| 5262 uint32_t index_offset_; | 5264 uint32_t index_offset_; |
| 5263 }; | 5265 }; |
| 5264 | 5266 |
| 5265 | 5267 |
| 5266 template<class ExternalArrayClass, class ElementType> | 5268 template<class ExternalArrayClass, class ElementType> |
| 5267 static uint32_t IterateExternalArrayElements(Handle<JSObject> receiver, | 5269 static uint32_t IterateExternalArrayElements(Handle<JSObject> receiver, |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5557 Factory::NewNumberDictionary(at_least_space_for)); | 5559 Factory::NewNumberDictionary(at_least_space_for)); |
| 5558 } | 5560 } |
| 5559 | 5561 |
| 5560 Handle<Object> len = Factory::NewNumber(static_cast<double>(result_length)); | 5562 Handle<Object> len = Factory::NewNumber(static_cast<double>(result_length)); |
| 5561 | 5563 |
| 5562 ArrayConcatVisitor visitor(storage, result_length, fast_case); | 5564 ArrayConcatVisitor visitor(storage, result_length, fast_case); |
| 5563 | 5565 |
| 5564 IterateArguments(arguments, &visitor); | 5566 IterateArguments(arguments, &visitor); |
| 5565 | 5567 |
| 5566 result->set_length(*len); | 5568 result->set_length(*len); |
| 5567 result->set_elements(*storage); | 5569 // Please note the storage might have changed in the visitor. |
| 5570 result->set_elements(*visitor.storage()); |
| 5568 | 5571 |
| 5569 return *result; | 5572 return *result; |
| 5570 } | 5573 } |
| 5571 | 5574 |
| 5572 | 5575 |
| 5573 // This will not allocate (flatten the string), but it may run | 5576 // This will not allocate (flatten the string), but it may run |
| 5574 // very slowly for very deeply nested ConsStrings. For debugging use only. | 5577 // very slowly for very deeply nested ConsStrings. For debugging use only. |
| 5575 static Object* Runtime_GlobalPrint(Arguments args) { | 5578 static Object* Runtime_GlobalPrint(Arguments args) { |
| 5576 NoHandleAllocation ha; | 5579 NoHandleAllocation ha; |
| 5577 ASSERT(args.length() == 1); | 5580 ASSERT(args.length() == 1); |
| (...skipping 2277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7855 } else { | 7858 } else { |
| 7856 // Handle last resort GC and make sure to allow future allocations | 7859 // Handle last resort GC and make sure to allow future allocations |
| 7857 // to grow the heap without causing GCs (if possible). | 7860 // to grow the heap without causing GCs (if possible). |
| 7858 Counters::gc_last_resort_from_js.Increment(); | 7861 Counters::gc_last_resort_from_js.Increment(); |
| 7859 Heap::CollectAllGarbage(false); | 7862 Heap::CollectAllGarbage(false); |
| 7860 } | 7863 } |
| 7861 } | 7864 } |
| 7862 | 7865 |
| 7863 | 7866 |
| 7864 } } // namespace v8::internal | 7867 } } // namespace v8::internal |
| OLD | NEW |