| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 3991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4002 public: | 4002 public: |
| 4003 ArrayConcatVisitor(Handle<FixedArray> storage, | 4003 ArrayConcatVisitor(Handle<FixedArray> storage, |
| 4004 uint32_t index_limit, | 4004 uint32_t index_limit, |
| 4005 bool fast_elements) : | 4005 bool fast_elements) : |
| 4006 storage_(storage), index_limit_(index_limit), | 4006 storage_(storage), index_limit_(index_limit), |
| 4007 fast_elements_(fast_elements), index_offset_(0) { } | 4007 fast_elements_(fast_elements), index_offset_(0) { } |
| 4008 | 4008 |
| 4009 void visit(uint32_t i, Handle<Object> elm) { | 4009 void visit(uint32_t i, Handle<Object> elm) { |
| 4010 uint32_t index = i + index_offset_; | 4010 uint32_t index = i + index_offset_; |
| 4011 if (index >= index_limit_) return; | 4011 if (index >= index_limit_) return; |
| 4012 | 4012 |
| 4013 if (fast_elements_) { | 4013 if (fast_elements_) { |
| 4014 ASSERT(index < static_cast<uint32_t>(storage_->length())); | 4014 ASSERT(index < static_cast<uint32_t>(storage_->length())); |
| 4015 storage_->set(index, *elm); | 4015 storage_->set(index, *elm); |
| 4016 | 4016 |
| 4017 } else { | 4017 } else { |
| 4018 Handle<Dictionary> dict = Handle<Dictionary>::cast(storage_); | 4018 Handle<Dictionary> dict = Handle<Dictionary>::cast(storage_); |
| 4019 Handle<Dictionary> result = | 4019 Handle<Dictionary> result = |
| 4020 Factory::DictionaryAtNumberPut(dict, index, elm); | 4020 Factory::DictionaryAtNumberPut(dict, index, elm); |
| 4021 if (!result.is_identical_to(dict)) | 4021 if (!result.is_identical_to(dict)) |
| 4022 storage_ = result; | 4022 storage_ = result; |
| (...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5766 | 5766 |
| 5767 void Runtime::PerformGC(Object* result) { | 5767 void Runtime::PerformGC(Object* result) { |
| 5768 Failure* failure = Failure::cast(result); | 5768 Failure* failure = Failure::cast(result); |
| 5769 // Try to do a garbage collection; ignore it if it fails. The C | 5769 // Try to do a garbage collection; ignore it if it fails. The C |
| 5770 // entry stub will throw an out-of-memory exception in that case. | 5770 // entry stub will throw an out-of-memory exception in that case. |
| 5771 Heap::CollectGarbage(failure->requested(), failure->allocation_space()); | 5771 Heap::CollectGarbage(failure->requested(), failure->allocation_space()); |
| 5772 } | 5772 } |
| 5773 | 5773 |
| 5774 | 5774 |
| 5775 } } // namespace v8::internal | 5775 } } // namespace v8::internal |
| OLD | NEW |