| Index: test/cctest/test-alloc.cc
|
| diff --git a/test/cctest/test-alloc.cc b/test/cctest/test-alloc.cc
|
| index 59328496ea9a56d7d31cb75e6182412f336af9f6..4ad7c4ceddb521d1255cc71a771198278be871e0 100644
|
| --- a/test/cctest/test-alloc.cc
|
| +++ b/test/cctest/test-alloc.cc
|
| @@ -1,4 +1,4 @@
|
| -// Copyright 2007-2008 the V8 project authors. All rights reserved.
|
| +// Copyright 2011 the V8 project authors. All rights reserved.
|
| // Redistribution and use in source and binary forms, with or without
|
| // modification, are permitted provided that the following conditions are
|
| // met:
|
| @@ -186,7 +186,9 @@ class Block {
|
| TEST(CodeRange) {
|
| const int code_range_size = 32*MB;
|
| OS::Setup();
|
| - Isolate::Current()->code_range()->Setup(code_range_size);
|
| + Isolate::Current()->InitializeLoggingAndCounters();
|
| + CodeRange* code_range = new CodeRange(Isolate::Current());
|
| + code_range->Setup(code_range_size);
|
| int current_allocated = 0;
|
| int total_allocated = 0;
|
| List<Block> blocks(1000);
|
| @@ -200,8 +202,7 @@ TEST(CodeRange) {
|
| size_t requested = (Page::kMaxHeapObjectSize << (Pseudorandom() % 3)) +
|
| Pseudorandom() % 5000 + 1;
|
| size_t allocated = 0;
|
| - Address base = Isolate::Current()->code_range()->
|
| - AllocateRawMemory(requested, &allocated);
|
| + Address base = code_range->AllocateRawMemory(requested, &allocated);
|
| CHECK(base != NULL);
|
| blocks.Add(Block(base, static_cast<int>(allocated)));
|
| current_allocated += static_cast<int>(allocated);
|
| @@ -209,8 +210,7 @@ TEST(CodeRange) {
|
| } else {
|
| // Free a block.
|
| int index = Pseudorandom() % blocks.length();
|
| - Isolate::Current()->code_range()->FreeRawMemory(
|
| - blocks[index].base, blocks[index].size);
|
| + code_range->FreeRawMemory(blocks[index].base, blocks[index].size);
|
| current_allocated -= blocks[index].size;
|
| if (index < blocks.length() - 1) {
|
| blocks[index] = blocks.RemoveLast();
|
| @@ -220,5 +220,6 @@ TEST(CodeRange) {
|
| }
|
| }
|
|
|
| - Isolate::Current()->code_range()->TearDown();
|
| + code_range->TearDown();
|
| + delete code_range;
|
| }
|
|
|