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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 } else { | 311 } else { |
312 MaybeObject* maybe_value = from->get(i + from_start); | 312 MaybeObject* maybe_value = from->get(i + from_start); |
313 Object* value; | 313 Object* value; |
314 ASSERT(IsFastObjectElementsKind(to_kind)); | 314 ASSERT(IsFastObjectElementsKind(to_kind)); |
315 // Because Double -> Object elements transitions allocate HeapObjects | 315 // Because Double -> Object elements transitions allocate HeapObjects |
316 // iteratively, the allocate must succeed within a single GC cycle, | 316 // iteratively, the allocate must succeed within a single GC cycle, |
317 // otherwise the retry after the GC will also fail. In order to ensure | 317 // otherwise the retry after the GC will also fail. In order to ensure |
318 // that no GC is triggered, allocate HeapNumbers from old space if they | 318 // that no GC is triggered, allocate HeapNumbers from old space if they |
319 // can't be taken from new space. | 319 // can't be taken from new space. |
320 if (!maybe_value->ToObject(&value)) { | 320 if (!maybe_value->ToObject(&value)) { |
321 ASSERT(maybe_value->IsRetryAfterGC() || maybe_value->IsOutOfMemory()); | 321 ASSERT(maybe_value->IsRetryAfterGC()); |
322 Heap* heap = from->GetHeap(); | 322 Heap* heap = from->GetHeap(); |
323 MaybeObject* maybe_value_object = | 323 MaybeObject* maybe_value_object = |
324 heap->AllocateHeapNumber(from->get_scalar(i + from_start), | 324 heap->AllocateHeapNumber(from->get_scalar(i + from_start), |
325 TENURED); | 325 TENURED); |
326 if (!maybe_value_object->ToObject(&value)) return maybe_value_object; | 326 if (!maybe_value_object->ToObject(&value)) return maybe_value_object; |
327 } | 327 } |
328 to->set(i + to_start, value, UPDATE_WRITE_BARRIER); | 328 to->set(i + to_start, value, UPDATE_WRITE_BARRIER); |
329 } | 329 } |
330 } | 330 } |
331 return to; | 331 return to; |
(...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2095 UNREACHABLE(); | 2095 UNREACHABLE(); |
2096 break; | 2096 break; |
2097 } | 2097 } |
2098 | 2098 |
2099 array->set_elements(*elms); | 2099 array->set_elements(*elms); |
2100 array->set_length(Smi::FromInt(number_of_elements)); | 2100 array->set_length(Smi::FromInt(number_of_elements)); |
2101 return array; | 2101 return array; |
2102 } | 2102 } |
2103 | 2103 |
2104 } } // namespace v8::internal | 2104 } } // namespace v8::internal |
OLD | NEW |