| 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 5634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5645 } | 5645 } |
| 5646 | 5646 |
| 5647 | 5647 |
| 5648 TEST(WeakFixedArray) { | 5648 TEST(WeakFixedArray) { |
| 5649 CcTest::InitializeVM(); | 5649 CcTest::InitializeVM(); |
| 5650 v8::HandleScope scope(CcTest::isolate()); | 5650 v8::HandleScope scope(CcTest::isolate()); |
| 5651 | 5651 |
| 5652 Handle<HeapNumber> number = CcTest::i_isolate()->factory()->NewHeapNumber(1); | 5652 Handle<HeapNumber> number = CcTest::i_isolate()->factory()->NewHeapNumber(1); |
| 5653 Handle<WeakFixedArray> array = WeakFixedArray::Add(Handle<Object>(), number); | 5653 Handle<WeakFixedArray> array = WeakFixedArray::Add(Handle<Object>(), number); |
| 5654 array->Remove(number); | 5654 array->Remove(number); |
| 5655 array->Compact(); | 5655 array->Compact<WeakFixedArray::NullCallback>(); |
| 5656 WeakFixedArray::Add(array, number); | 5656 WeakFixedArray::Add(array, number); |
| 5657 } | 5657 } |
| 5658 | 5658 |
| 5659 | 5659 |
| 5660 TEST(PreprocessStackTrace) { | 5660 TEST(PreprocessStackTrace) { |
| 5661 // Do not automatically trigger early GC. | 5661 // Do not automatically trigger early GC. |
| 5662 FLAG_gc_interval = -1; | 5662 FLAG_gc_interval = -1; |
| 5663 CcTest::InitializeVM(); | 5663 CcTest::InitializeVM(); |
| 5664 v8::HandleScope scope(CcTest::isolate()); | 5664 v8::HandleScope scope(CcTest::isolate()); |
| 5665 v8::TryCatch try_catch(CcTest::isolate()); | 5665 v8::TryCatch try_catch(CcTest::isolate()); |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6048 array->address(), | 6048 array->address(), |
| 6049 array->address() + array->Size()); | 6049 array->address() + array->Size()); |
| 6050 DCHECK(reinterpret_cast<void*>(buffer->Get(1)) == | 6050 DCHECK(reinterpret_cast<void*>(buffer->Get(1)) == |
| 6051 HeapObject::RawField(heap->empty_fixed_array(), | 6051 HeapObject::RawField(heap->empty_fixed_array(), |
| 6052 FixedArrayBase::kLengthOffset)); | 6052 FixedArrayBase::kLengthOffset)); |
| 6053 DCHECK(reinterpret_cast<void*>(buffer->Get(2)) == | 6053 DCHECK(reinterpret_cast<void*>(buffer->Get(2)) == |
| 6054 HeapObject::RawField(heap->empty_fixed_array(), | 6054 HeapObject::RawField(heap->empty_fixed_array(), |
| 6055 FixedArrayBase::kLengthOffset)); | 6055 FixedArrayBase::kLengthOffset)); |
| 6056 delete buffer; | 6056 delete buffer; |
| 6057 } | 6057 } |
| OLD | NEW |