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

Side by Side Diff: test/cctest/test-spaces.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, 7 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 unified diff | Download patch
« no previous file with comments | « test/cctest/test-serialize.cc ('k') | test/cctest/test-strings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 455
456 // No large objects required to perform the above steps. 456 // No large objects required to perform the above steps.
457 CHECK(isolate->heap()->lo_space()->IsEmpty()); 457 CHECK(isolate->heap()->lo_space()->IsEmpty());
458 } 458 }
459 459
460 460
461 UNINITIALIZED_TEST(NewSpaceGrowsToTargetCapacity) { 461 UNINITIALIZED_TEST(NewSpaceGrowsToTargetCapacity) {
462 FLAG_target_semi_space_size = 2 * (Page::kPageSize / MB); 462 FLAG_target_semi_space_size = 2 * (Page::kPageSize / MB);
463 if (FLAG_optimize_for_size) return; 463 if (FLAG_optimize_for_size) return;
464 464
465 v8::Isolate* isolate = v8::Isolate::New(); 465 v8::Isolate::CreateParams create_params;
466 create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
467 v8::Isolate* isolate = v8::Isolate::New(create_params);
466 { 468 {
467 v8::Isolate::Scope isolate_scope(isolate); 469 v8::Isolate::Scope isolate_scope(isolate);
468 v8::HandleScope handle_scope(isolate); 470 v8::HandleScope handle_scope(isolate);
469 v8::Context::New(isolate)->Enter(); 471 v8::Context::New(isolate)->Enter();
470 472
471 Isolate* i_isolate = reinterpret_cast<Isolate*>(isolate); 473 Isolate* i_isolate = reinterpret_cast<Isolate*>(isolate);
472 474
473 NewSpace* new_space = i_isolate->heap()->new_space(); 475 NewSpace* new_space = i_isolate->heap()->new_space();
474 476
475 // This test doesn't work if we start with a non-default new space 477 // This test doesn't work if we start with a non-default new space
(...skipping 13 matching lines...) Expand all
489 491
490 // Turn the allocation into a proper object so isolate teardown won't 492 // Turn the allocation into a proper object so isolate teardown won't
491 // crash. 493 // crash.
492 HeapObject* free_space = NULL; 494 HeapObject* free_space = NULL;
493 CHECK(allocation.To(&free_space)); 495 CHECK(allocation.To(&free_space));
494 new_space->heap()->CreateFillerObjectAt(free_space->address(), 80); 496 new_space->heap()->CreateFillerObjectAt(free_space->address(), 80);
495 } 497 }
496 } 498 }
497 isolate->Dispose(); 499 isolate->Dispose();
498 } 500 }
OLDNEW
« no previous file with comments | « test/cctest/test-serialize.cc ('k') | test/cctest/test-strings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698