| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 for (Object* o = array_buffer->weak_first_array(); | 78 for (Object* o = array_buffer->weak_first_array(); |
| 79 !o->IsUndefined(); | 79 !o->IsUndefined(); |
| 80 o = JSTypedArray::cast(o)->weak_next()) { | 80 o = JSTypedArray::cast(o)->weak_next()) { |
| 81 if (ta == o) return true; | 81 if (ta == o) return true; |
| 82 } | 82 } |
| 83 return false; | 83 return false; |
| 84 } | 84 } |
| 85 | 85 |
| 86 | 86 |
| 87 TEST(WeakArrayBuffersFromApi) { | 87 TEST(WeakArrayBuffersFromApi) { |
| 88 i::FLAG_stress_compaction = false; |
| 88 v8::V8::Initialize(); | 89 v8::V8::Initialize(); |
| 89 LocalContext context; | 90 LocalContext context; |
| 90 Isolate* isolate = GetIsolateFrom(&context); | 91 Isolate* isolate = GetIsolateFrom(&context); |
| 91 | 92 |
| 92 CHECK_EQ(0, CountArrayBuffersInWeakList(isolate->heap())); | 93 CHECK_EQ(0, CountArrayBuffersInWeakList(isolate->heap())); |
| 93 { | 94 { |
| 94 v8::HandleScope s1(context->GetIsolate()); | 95 v8::HandleScope s1(context->GetIsolate()); |
| 95 v8::Handle<v8::ArrayBuffer> ab1 = v8::ArrayBuffer::New(256); | 96 v8::Handle<v8::ArrayBuffer> ab1 = v8::ArrayBuffer::New(256); |
| 96 { | 97 { |
| 97 v8::HandleScope s2(context->GetIsolate()); | 98 v8::HandleScope s2(context->GetIsolate()); |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 | 378 |
| 378 TEST(Float64ArrayFromScript) { | 379 TEST(Float64ArrayFromScript) { |
| 379 TestTypedArrayFromScript<v8::Float64Array>("Float64Array"); | 380 TestTypedArrayFromScript<v8::Float64Array>("Float64Array"); |
| 380 } | 381 } |
| 381 | 382 |
| 382 | 383 |
| 383 TEST(Uint8ClampedArrayFromScript) { | 384 TEST(Uint8ClampedArrayFromScript) { |
| 384 TestTypedArrayFromScript<v8::Uint8ClampedArray>("Uint8ClampedArray"); | 385 TestTypedArrayFromScript<v8::Uint8ClampedArray>("Uint8ClampedArray"); |
| 385 } | 386 } |
| 386 | 387 |
| OLD | NEW |