| 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 1886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1897 for (int offset = JSObject::kHeaderSize; | 1897 for (int offset = JSObject::kHeaderSize; |
| 1898 offset < object_size; | 1898 offset < object_size; |
| 1899 offset += kPointerSize) { | 1899 offset += kPointerSize) { |
| 1900 RecordWrite(clone_address, offset); | 1900 RecordWrite(clone_address, offset); |
| 1901 } | 1901 } |
| 1902 } else { | 1902 } else { |
| 1903 clone = new_space_.AllocateRaw(object_size); | 1903 clone = new_space_.AllocateRaw(object_size); |
| 1904 if (clone->IsFailure()) return clone; | 1904 if (clone->IsFailure()) return clone; |
| 1905 ASSERT(Heap::InNewSpace(clone)); | 1905 ASSERT(Heap::InNewSpace(clone)); |
| 1906 // Since we know the clone is allocated in new space, we can copy | 1906 // Since we know the clone is allocated in new space, we can copy |
| 1907 // the contents without worring about updating the write barrier. | 1907 // the contents without worrying about updating the write barrier. |
| 1908 CopyBlock(reinterpret_cast<Object**>(HeapObject::cast(clone)->address()), | 1908 CopyBlock(reinterpret_cast<Object**>(HeapObject::cast(clone)->address()), |
| 1909 reinterpret_cast<Object**>(source->address()), | 1909 reinterpret_cast<Object**>(source->address()), |
| 1910 object_size); | 1910 object_size); |
| 1911 } | 1911 } |
| 1912 | 1912 |
| 1913 FixedArray* elements = FixedArray::cast(source->elements()); | 1913 FixedArray* elements = FixedArray::cast(source->elements()); |
| 1914 FixedArray* properties = FixedArray::cast(source->properties()); | 1914 FixedArray* properties = FixedArray::cast(source->properties()); |
| 1915 // Update elements if necessary. | 1915 // Update elements if necessary. |
| 1916 if (elements->length()> 0) { | 1916 if (elements->length()> 0) { |
| 1917 Object* elem = CopyFixedArray(elements); | 1917 Object* elem = CopyFixedArray(elements); |
| (...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3357 #ifdef DEBUG | 3357 #ifdef DEBUG |
| 3358 bool Heap::GarbageCollectionGreedyCheck() { | 3358 bool Heap::GarbageCollectionGreedyCheck() { |
| 3359 ASSERT(FLAG_gc_greedy); | 3359 ASSERT(FLAG_gc_greedy); |
| 3360 if (Bootstrapper::IsActive()) return true; | 3360 if (Bootstrapper::IsActive()) return true; |
| 3361 if (disallow_allocation_failure()) return true; | 3361 if (disallow_allocation_failure()) return true; |
| 3362 return CollectGarbage(0, NEW_SPACE); | 3362 return CollectGarbage(0, NEW_SPACE); |
| 3363 } | 3363 } |
| 3364 #endif | 3364 #endif |
| 3365 | 3365 |
| 3366 } } // namespace v8::internal | 3366 } } // namespace v8::internal |
| OLD | NEW |