Generation of our home-grown memmove doesn't depend on serializer state anymore.
authorsvenpanne@chromium.org <svenpanne@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 2 May 2014 10:14:37 +0000 (10:14 +0000)
committersvenpanne@chromium.org <svenpanne@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 2 May 2014 10:14:37 +0000 (10:14 +0000)
The serializer state has to be per-Isolate, but at the point where we
generate our memmoves we don't really have an Isolate. Furthermore,
there was no fundamental reason why we shouldn't use our home-grown
memmove during mksnapshot time.

Perhaps we can totally remove our own memmove nowadays, but this would
be a separate CL.

BUG=359977
LOG=y
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/261903002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@21116 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/arm/codegen-arm.cc
src/mips/codegen-mips.cc
src/platform-posix.cc
src/platform-win32.cc
src/platform.h
src/v8.cc

index 7ac14e3..a8e3877 100644 (file)
@@ -79,14 +79,11 @@ UnaryMathFunction CreateExpFunction() {
 
 #if defined(V8_HOST_ARCH_ARM)
 OS::MemCopyUint8Function CreateMemCopyUint8Function(
-    bool serializer_enabled,
     OS::MemCopyUint8Function stub) {
 #if defined(USE_SIMULATOR)
   return stub;
 #else
-  if (serializer_enabled || !CpuFeatures::IsSupported(UNALIGNED_ACCESSES)) {
-    return stub;
-  }
+  if (!CpuFeatures::IsSupported(UNALIGNED_ACCESSES)) return stub;
   size_t actual_size;
   byte* buffer = static_cast<byte*>(OS::Allocate(1 * KB, &actual_size, true));
   if (buffer == NULL) return stub;
@@ -238,14 +235,11 @@ OS::MemCopyUint8Function CreateMemCopyUint8Function(
 
 // Convert 8 to 16. The number of character to copy must be at least 8.
 OS::MemCopyUint16Uint8Function CreateMemCopyUint16Uint8Function(
-    bool serializer_enabled,
     OS::MemCopyUint16Uint8Function stub) {
 #if defined(USE_SIMULATOR)
   return stub;
 #else
-  if (serializer_enabled || !CpuFeatures::IsSupported(UNALIGNED_ACCESSES)) {
-    return stub;
-  }
+  if (!CpuFeatures::IsSupported(UNALIGNED_ACCESSES)) return stub;
   size_t actual_size;
   byte* buffer = static_cast<byte*>(OS::Allocate(1 * KB, &actual_size, true));
   if (buffer == NULL) return stub;
index c69c8f2..ce04dd4 100644 (file)
@@ -72,13 +72,10 @@ UnaryMathFunction CreateExpFunction() {
 
 #if defined(V8_HOST_ARCH_MIPS)
 OS::MemCopyUint8Function CreateMemCopyUint8Function(
-    bool serializer_enabled,
     OS::MemCopyUint8Function stub) {
 #if defined(USE_SIMULATOR)
   return stub;
 #else
-  if (serializer_enabled) return stub;
-
   size_t actual_size;
   byte* buffer = static_cast<byte*>(OS::Allocate(3 * KB, &actual_size, true));
   if (buffer == NULL) return stub;
index 01eb639..6375fdd 100644 (file)
@@ -514,22 +514,19 @@ OS::MemCopyUint16Uint8Function OS::memcopy_uint16_uint8_function =
     &OS::MemCopyUint16Uint8Wrapper;
 // Defined in codegen-arm.cc.
 OS::MemCopyUint8Function CreateMemCopyUint8Function(
-    bool serializer_enabled,
     OS::MemCopyUint8Function stub);
 OS::MemCopyUint16Uint8Function CreateMemCopyUint16Uint8Function(
-    bool serializer_enabled,
     OS::MemCopyUint16Uint8Function stub);
 
 #elif defined(V8_HOST_ARCH_MIPS)
 OS::MemCopyUint8Function OS::memcopy_uint8_function = &OS::MemCopyUint8Wrapper;
 // Defined in codegen-mips.cc.
 OS::MemCopyUint8Function CreateMemCopyUint8Function(
-    bool serializer_enabled,
     OS::MemCopyUint8Function stub);
 #endif
 
 
-void OS::PostSetUp(bool serializer_enabled) {
+void OS::PostSetUp() {
 #if V8_TARGET_ARCH_IA32
   OS::MemMoveFunction generated_memmove = CreateMemMoveFunction();
   if (generated_memmove != NULL) {
@@ -537,13 +534,12 @@ void OS::PostSetUp(bool serializer_enabled) {
   }
 #elif defined(V8_HOST_ARCH_ARM)
   OS::memcopy_uint8_function =
-      CreateMemCopyUint8Function(serializer_enabled, &OS::MemCopyUint8Wrapper);
+      CreateMemCopyUint8Function(&OS::MemCopyUint8Wrapper);
   OS::memcopy_uint16_uint8_function =
-      CreateMemCopyUint16Uint8Function(serializer_enabled,
-                                       &OS::MemCopyUint16Uint8Wrapper);
+      CreateMemCopyUint16Uint8Function(&OS::MemCopyUint16Uint8Wrapper);
 #elif defined(V8_HOST_ARCH_MIPS)
   OS::memcopy_uint8_function =
-      CreateMemCopyUint8Function(serializer_enabled, &OS::MemCopyUint8Wrapper);
+      CreateMemCopyUint8Function(&OS::MemCopyUint8Wrapper);
 #endif
   // fast_exp is initialized lazily.
   init_fast_sqrt_function();
index 4486caf..11dcdcc 100644 (file)
@@ -515,7 +515,7 @@ char* Win32Time::LocalTimezone(TimezoneCache* cache) {
 }
 
 
-void OS::PostSetUp(bool serializer_enabled) {
+void OS::PostSetUp() {
   // Math functions depend on CPU features therefore they are initialized after
   // CPU.
   MathSetup();
index d82dea1..31b7bdf 100644 (file)
@@ -151,7 +151,7 @@ class OS {
  public:
   // Initializes the platform OS support that depend on CPU features. This is
   // called after CPU initialization.
-  static void PostSetUp(bool serializer_enabled);
+  static void PostSetUp();
 
   // Returns the accumulated user time for thread. This routine
   // can be used for profiling. The implementation should
index c5c6df3..eed4333 100644 (file)
--- a/src/v8.cc
+++ b/src/v8.cc
@@ -124,7 +124,7 @@ void V8::InitializeOncePerProcessImpl() {
   // TODO(svenpanne) Clean this up when Serializer is a real object.
   bool serializer_enabled = Serializer::enabled(NULL);
   CpuFeatures::Probe(serializer_enabled);
-  OS::PostSetUp(serializer_enabled);
+  OS::PostSetUp();
   ElementsAccessor::InitializeOncePerProcess();
   LOperand::SetUpCaches();
   SetUpJSCallerSavedCodeData();