c42f5829a1
In the shell sample don't print the result of executing a script, only evaluating expressions. Fixed issue when building samples on Windows using a shared V8 library. Added visibility option on Linux build which makes the generated library 18% smaller. Changed build system to accept multiple build modes in one build and generate seperate objects, libraries and executables for each mode. Removed deferred negation optimization (a * -b => -(a * b)) since this visibly changes operand conversion order. Improved parsing performance by introducing stack guard in preparsing. Without a stack guard preparsing always bails out with stack overflow. git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
27 lines
604 B
C++
27 lines
604 B
C++
// Copyright 2006-2008 Google, Inc. All Rights Reserved.
|
|
//
|
|
// Tests of the TokenLock class from lock.h
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "v8.h"
|
|
|
|
#include "platform.h"
|
|
#include "cctest.h"
|
|
|
|
using namespace ::v8::internal;
|
|
|
|
|
|
TEST(VirtualMemory) {
|
|
VirtualMemory* vm = new VirtualMemory(1 * MB);
|
|
CHECK(vm->IsReserved());
|
|
void* block_addr = vm->address();
|
|
size_t block_size = 4 * KB;
|
|
CHECK(vm->Commit(block_addr, block_size, false));
|
|
// Check whether we can write to memory.
|
|
int* addr = static_cast<int*>(block_addr);
|
|
addr[KB-1] = 2;
|
|
CHECK(vm->Uncommit(block_addr, block_size));
|
|
delete vm;
|
|
}
|