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

Unified Diff: src/platform-win32.cc

Issue 353113003: Remove dependency from platform files on v8.h (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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 | « src/platform-solaris.cc ('k') | src/v8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-win32.cc
diff --git a/src/platform-win32.cc b/src/platform-win32.cc
index 9fe3e1411245ea929bd2ec0129985b3b46fb02b3..1897b75be68cf1e88da3bf07f257501ac00bb376 100644
--- a/src/platform-win32.cc
+++ b/src/platform-win32.cc
@@ -17,10 +17,10 @@
#include "src/base/win32-headers.h"
-#include "src/v8.h"
-
#include "src/base/lazy-instance.h"
#include "src/platform.h"
+#include "src/platform/time.h"
+#include "src/utils.h"
#include "src/utils/random-number-generator.h"
#ifdef _MSC_VER
@@ -103,6 +103,12 @@ int strncpy_s(char* dest, size_t dest_size, const char* source, size_t count) {
namespace v8 {
namespace internal {
+namespace {
+
+bool g_hard_abort = false;
+
+} // namespace
+
intptr_t OS::MaxVirtualMemory() {
return 0;
}
@@ -713,8 +719,12 @@ static base::LazyInstance<RandomNumberGenerator>::type
platform_random_number_generator = LAZY_INSTANCE_INITIALIZER;
-void OS::SetRandomSeed(int64_t seed) {
- platform_random_number_generator.Pointer()->SetSeed(seed);
+void OS::Initialize(int64_t random_seed, bool hard_abort,
+ const char* const gc_fake_mmap) {
+ if (random_seed) {
+ platform_random_number_generator.Pointer()->SetSeed(random_seed);
+ }
+ g_hard_abort = hard_abort;
}
@@ -808,7 +818,7 @@ void OS::Sleep(int milliseconds) {
void OS::Abort() {
- if (FLAG_hard_abort) {
+ if (g_hard_abort) {
V8_IMMEDIATE_CRASH();
}
// Make the MSVCRT do a silent abort.
@@ -1217,7 +1227,7 @@ VirtualMemory::VirtualMemory(size_t size, size_t alignment)
static_cast<intptr_t>(OS::AllocateAlignment()));
void* address = ReserveRegion(request_size);
if (address == NULL) return;
- Address base = RoundUp(static_cast<Address>(address), alignment);
+ uint8_t* base = RoundUp(static_cast<uint8_t*>(address), alignment);
// Try reducing the size by freeing and then reallocating a specific area.
bool result = ReleaseRegion(address, request_size);
USE(result);
@@ -1225,7 +1235,7 @@ VirtualMemory::VirtualMemory(size_t size, size_t alignment)
address = VirtualAlloc(base, size, MEM_RESERVE, PAGE_NOACCESS);
if (address != NULL) {
request_size = size;
- ASSERT(base == static_cast<Address>(address));
+ ASSERT(base == static_cast<uint8_t*>(address));
} else {
// Resizing failed, just go with a bigger area.
address = ReserveRegion(request_size);
« no previous file with comments | « src/platform-solaris.cc ('k') | src/v8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698