OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 #include "src/api.h" |
5 #include "src/heap/array-buffer-tracker.h" | 6 #include "src/heap/array-buffer-tracker.h" |
| 7 #include "src/isolate.h" |
6 #include "test/cctest/cctest.h" | 8 #include "test/cctest/cctest.h" |
7 #include "test/cctest/heap/heap-utils.h" | 9 #include "test/cctest/heap/heap-utils.h" |
8 | 10 |
9 namespace { | 11 namespace { |
10 | 12 |
11 typedef i::LocalArrayBufferTracker LocalTracker; | 13 typedef i::LocalArrayBufferTracker LocalTracker; |
12 | 14 |
13 bool IsTracked(i::JSArrayBuffer* buf) { | 15 bool IsTracked(i::JSArrayBuffer* buf) { |
14 return i::ArrayBufferTracker::IsTracked(buf); | 16 return i::ArrayBufferTracker::IsTracked(buf); |
15 } | 17 } |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 Local<v8::ArrayBuffer> ab2 = v8::ArrayBuffer::New(isolate, 100); | 311 Local<v8::ArrayBuffer> ab2 = v8::ArrayBuffer::New(isolate, 100); |
310 Handle<JSArrayBuffer> buf2 = v8::Utils::OpenHandle(*ab2); | 312 Handle<JSArrayBuffer> buf2 = v8::Utils::OpenHandle(*ab2); |
311 CHECK_NE(Page::FromAddress(buf1->address()), | 313 CHECK_NE(Page::FromAddress(buf1->address()), |
312 Page::FromAddress(buf2->address())); | 314 Page::FromAddress(buf2->address())); |
313 heap::GcAndSweep(heap, OLD_SPACE); | 315 heap::GcAndSweep(heap, OLD_SPACE); |
314 } | 316 } |
315 } | 317 } |
316 | 318 |
317 } // namespace internal | 319 } // namespace internal |
318 } // namespace v8 | 320 } // namespace v8 |
OLD | NEW |