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/api.h" |
6 #include "src/heap/array-buffer-tracker.h" | 6 #include "src/heap/array-buffer-tracker.h" |
| 7 #include "src/heap/spaces.h" |
7 #include "src/isolate.h" | 8 #include "src/isolate.h" |
8 #include "test/cctest/cctest.h" | 9 #include "test/cctest/cctest.h" |
9 #include "test/cctest/heap/heap-utils.h" | 10 #include "test/cctest/heap/heap-utils.h" |
10 | 11 |
11 namespace { | 12 namespace { |
12 | 13 |
13 typedef i::LocalArrayBufferTracker LocalTracker; | 14 typedef i::LocalArrayBufferTracker LocalTracker; |
14 | 15 |
15 bool IsTracked(i::JSArrayBuffer* buf) { | 16 bool IsTracked(i::JSArrayBuffer* buf) { |
16 return i::ArrayBufferTracker::IsTracked(buf); | 17 return i::ArrayBufferTracker::IsTracked(buf); |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 Local<v8::ArrayBuffer> ab2 = v8::ArrayBuffer::New(isolate, 100); | 315 Local<v8::ArrayBuffer> ab2 = v8::ArrayBuffer::New(isolate, 100); |
315 Handle<JSArrayBuffer> buf2 = v8::Utils::OpenHandle(*ab2); | 316 Handle<JSArrayBuffer> buf2 = v8::Utils::OpenHandle(*ab2); |
316 CHECK_NE(Page::FromAddress(buf1->address()), | 317 CHECK_NE(Page::FromAddress(buf1->address()), |
317 Page::FromAddress(buf2->address())); | 318 Page::FromAddress(buf2->address())); |
318 heap::GcAndSweep(heap, OLD_SPACE); | 319 heap::GcAndSweep(heap, OLD_SPACE); |
319 } | 320 } |
320 } | 321 } |
321 | 322 |
322 } // namespace internal | 323 } // namespace internal |
323 } // namespace v8 | 324 } // namespace v8 |
OLD | NEW |