Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(889)

Unified Diff: test/cctest/test-lockers.cc

Issue 1116633002: Pass ArrayBuffer::Allocator via Isolate::CreateParams (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-heap.cc ('k') | test/cctest/test-log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-lockers.cc
diff --git a/test/cctest/test-lockers.cc b/test/cctest/test-lockers.cc
index c53ac5ccc879bb808006850a4116745a275308f2..c86a9d67dcd3ecb9b45649691fa70ef376f48bff 100644
--- a/test/cctest/test-lockers.cc
+++ b/test/cctest/test-lockers.cc
@@ -98,7 +98,9 @@ class KangarooThread : public v8::base::Thread {
// Migrates an isolate from one thread to another
TEST(KangarooIsolates) {
- v8::Isolate* isolate = v8::Isolate::New();
+ v8::Isolate::CreateParams create_params;
+ create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
+ v8::Isolate* isolate = v8::Isolate::New(create_params);
i::SmartPointer<KangarooThread> thread1;
{
v8::Locker locker(isolate);
@@ -216,7 +218,9 @@ TEST(IsolateLockingStress) {
const int kNThreads = 100;
#endif
i::List<JoinableThread*> threads(kNThreads);
- v8::Isolate* isolate = v8::Isolate::New();
+ v8::Isolate::CreateParams create_params;
+ create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
+ v8::Isolate* isolate = v8::Isolate::New(create_params);
for (int i = 0; i < kNThreads; i++) {
threads.Add(new IsolateLockingThreadWithLocalContext(isolate));
}
@@ -257,7 +261,9 @@ TEST(IsolateNestedLocking) {
#else
const int kNThreads = 100;
#endif
- v8::Isolate* isolate = v8::Isolate::New();
+ v8::Isolate::CreateParams create_params;
+ create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
+ v8::Isolate* isolate = v8::Isolate::New(create_params);
i::List<JoinableThread*> threads(kNThreads);
for (int i = 0; i < kNThreads; i++) {
threads.Add(new IsolateNestedLockingThread(isolate));
@@ -300,8 +306,10 @@ TEST(SeparateIsolatesLocksNonexclusive) {
#else
const int kNThreads = 100;
#endif
- v8::Isolate* isolate1 = v8::Isolate::New();
- v8::Isolate* isolate2 = v8::Isolate::New();
+ v8::Isolate::CreateParams create_params;
+ create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
+ v8::Isolate* isolate1 = v8::Isolate::New(create_params);
+ v8::Isolate* isolate2 = v8::Isolate::New(create_params);
i::List<JoinableThread*> threads(kNThreads);
for (int i = 0; i < kNThreads; i++) {
threads.Add(new SeparateIsolatesLocksNonexclusiveThread(isolate1,
@@ -379,7 +387,9 @@ TEST(LockerUnlocker) {
const int kNThreads = 100;
#endif
i::List<JoinableThread*> threads(kNThreads);
- v8::Isolate* isolate = v8::Isolate::New();
+ v8::Isolate::CreateParams create_params;
+ create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
+ v8::Isolate* isolate = v8::Isolate::New(create_params);
for (int i = 0; i < kNThreads; i++) {
threads.Add(new LockerUnlockerThread(isolate));
}
@@ -434,7 +444,9 @@ TEST(LockTwiceAndUnlock) {
const int kNThreads = 100;
#endif
i::List<JoinableThread*> threads(kNThreads);
- v8::Isolate* isolate = v8::Isolate::New();
+ v8::Isolate::CreateParams create_params;
+ create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
+ v8::Isolate* isolate = v8::Isolate::New(create_params);
for (int i = 0; i < kNThreads; i++) {
threads.Add(new LockTwiceAndUnlockThread(isolate));
}
@@ -496,8 +508,10 @@ class LockAndUnlockDifferentIsolatesThread : public JoinableThread {
// Lock two isolates and unlock one of them.
TEST(LockAndUnlockDifferentIsolates) {
- v8::Isolate* isolate1 = v8::Isolate::New();
- v8::Isolate* isolate2 = v8::Isolate::New();
+ v8::Isolate::CreateParams create_params;
+ create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
+ v8::Isolate* isolate1 = v8::Isolate::New(create_params);
+ v8::Isolate* isolate2 = v8::Isolate::New(create_params);
LockAndUnlockDifferentIsolatesThread thread(isolate1, isolate2);
thread.Start();
thread.Join();
@@ -556,7 +570,9 @@ TEST(LockUnlockLockMultithreaded) {
#else
const int kNThreads = 100;
#endif
- v8::Isolate* isolate = v8::Isolate::New();
+ v8::Isolate::CreateParams create_params;
+ create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
+ v8::Isolate* isolate = v8::Isolate::New(create_params);
i::List<JoinableThread*> threads(kNThreads);
{
v8::Locker locker_(isolate);
@@ -631,7 +647,9 @@ TEST(LockUnlockLockDefaultIsolateMultithreaded) {
TEST(Regress1433) {
for (int i = 0; i < 10; i++) {
- v8::Isolate* isolate = v8::Isolate::New();
+ v8::Isolate::CreateParams create_params;
+ create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
+ v8::Isolate* isolate = v8::Isolate::New(create_params);
{
v8::Locker lock(isolate);
v8::Isolate::Scope isolate_scope(isolate);
@@ -662,7 +680,9 @@ class IsolateGenesisThread : public JoinableThread {
{}
virtual void Run() {
- v8::Isolate* isolate = v8::Isolate::New();
+ v8::Isolate::CreateParams create_params;
+ create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
+ v8::Isolate* isolate = v8::Isolate::New(create_params);
{
v8::Isolate::Scope isolate_scope(isolate);
CHECK(!i::Isolate::Current()->has_installed_extensions());
@@ -673,6 +693,7 @@ class IsolateGenesisThread : public JoinableThread {
}
isolate->Dispose();
}
+
private:
int count_;
const char** extension_names_;
« no previous file with comments | « test/cctest/test-heap.cc ('k') | test/cctest/test-log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698