Revision: 7301
Author:   [email protected]
Date:     Tue Mar 22 04:50:39 2011
Log:      Rename memory.h to v8memory.h

This is to avoid name collision with system include file named memory.h causing problems on some platforms.
Review URL: http://codereview.chromium.org/6716020
http://code.google.com/p/v8/source/detail?r=7301

Added:
 /branches/bleeding_edge/src/v8memory.h
Deleted:
 /branches/bleeding_edge/src/memory.h
Modified:
 /branches/bleeding_edge/src/arm/frames-arm.h
 /branches/bleeding_edge/src/frames-inl.h
 /branches/bleeding_edge/src/ia32/frames-ia32.h
 /branches/bleeding_edge/src/liveedit.cc
 /branches/bleeding_edge/src/objects-inl.h
 /branches/bleeding_edge/src/spaces-inl.h
 /branches/bleeding_edge/src/x64/assembler-x64-inl.h
 /branches/bleeding_edge/src/x64/frames-x64.h
 /branches/bleeding_edge/tools/gyp/v8.gyp
 /branches/bleeding_edge/tools/v8.xcodeproj/project.pbxproj
 /branches/bleeding_edge/tools/visual_studio/v8_base.vcproj
 /branches/bleeding_edge/tools/visual_studio/v8_base_arm.vcproj
 /branches/bleeding_edge/tools/visual_studio/v8_base_x64.vcproj

=======================================
--- /dev/null
+++ /branches/bleeding_edge/src/v8memory.h      Tue Mar 22 04:50:39 2011
@@ -0,0 +1,82 @@
+// Copyright 2006-2008 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:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_MEMORY_H_
+#define V8_MEMORY_H_
+
+namespace v8 {
+namespace internal {
+
+// Memory provides an interface to 'raw' memory. It encapsulates the casts
+// that typically are needed when incompatible pointer types are used.
+
+class Memory {
+ public:
+  static uint8_t& uint8_at(Address addr) {
+    return *reinterpret_cast<uint8_t*>(addr);
+  }
+
+  static uint16_t& uint16_at(Address addr)  {
+    return *reinterpret_cast<uint16_t*>(addr);
+  }
+
+  static uint32_t& uint32_at(Address addr)  {
+    return *reinterpret_cast<uint32_t*>(addr);
+  }
+
+  static int32_t& int32_at(Address addr)  {
+    return *reinterpret_cast<int32_t*>(addr);
+  }
+
+  static uint64_t& uint64_at(Address addr)  {
+    return *reinterpret_cast<uint64_t*>(addr);
+  }
+
+  static int& int_at(Address addr)  {
+    return *reinterpret_cast<int*>(addr);
+  }
+
+  static double& double_at(Address addr)  {
+    return *reinterpret_cast<double*>(addr);
+  }
+
+  static Address& Address_at(Address addr)  {
+    return *reinterpret_cast<Address*>(addr);
+  }
+
+  static Object*& Object_at(Address addr)  {
+    return *reinterpret_cast<Object**>(addr);
+  }
+
+  static Handle<Object>& Object_Handle_at(Address addr)  {
+    return *reinterpret_cast<Handle<Object>*>(addr);
+  }
+};
+
+} }  // namespace v8::internal
+
+#endif  // V8_MEMORY_H_
=======================================
--- /branches/bleeding_edge/src/memory.h        Tue Dec  7 03:31:57 2010
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2006-2008 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:
-//
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-//       copyright notice, this list of conditions and the following
-//       disclaimer in the documentation and/or other materials provided
-//       with the distribution.
-//     * Neither the name of Google Inc. nor the names of its
-//       contributors may be used to endorse or promote products derived
-//       from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef V8_MEMORY_H_
-#define V8_MEMORY_H_
-
-namespace v8 {
-namespace internal {
-
-// Memory provides an interface to 'raw' memory. It encapsulates the casts
-// that typically are needed when incompatible pointer types are used.
-
-class Memory {
- public:
-  static uint8_t& uint8_at(Address addr) {
-    return *reinterpret_cast<uint8_t*>(addr);
-  }
-
-  static uint16_t& uint16_at(Address addr)  {
-    return *reinterpret_cast<uint16_t*>(addr);
-  }
-
-  static uint32_t& uint32_at(Address addr)  {
-    return *reinterpret_cast<uint32_t*>(addr);
-  }
-
-  static int32_t& int32_at(Address addr)  {
-    return *reinterpret_cast<int32_t*>(addr);
-  }
-
-  static uint64_t& uint64_at(Address addr)  {
-    return *reinterpret_cast<uint64_t*>(addr);
-  }
-
-  static int& int_at(Address addr)  {
-    return *reinterpret_cast<int*>(addr);
-  }
-
-  static double& double_at(Address addr)  {
-    return *reinterpret_cast<double*>(addr);
-  }
-
-  static Address& Address_at(Address addr)  {
-    return *reinterpret_cast<Address*>(addr);
-  }
-
-  static Object*& Object_at(Address addr)  {
-    return *reinterpret_cast<Object**>(addr);
-  }
-
-  static Handle<Object>& Object_Handle_at(Address addr)  {
-    return *reinterpret_cast<Handle<Object>*>(addr);
-  }
-};
-
-} }  // namespace v8::internal
-
-#endif  // V8_MEMORY_H_
=======================================
--- /branches/bleeding_edge/src/arm/frames-arm.h        Fri Mar 18 13:35:07 2011
+++ /branches/bleeding_edge/src/arm/frames-arm.h        Tue Mar 22 04:50:39 2011
@@ -28,8 +28,6 @@
 #ifndef V8_ARM_FRAMES_ARM_H_
 #define V8_ARM_FRAMES_ARM_H_

-#include "memory.h"
-
 namespace v8 {
 namespace internal {

=======================================
--- /branches/bleeding_edge/src/frames-inl.h    Fri Mar 18 13:35:07 2011
+++ /branches/bleeding_edge/src/frames-inl.h    Tue Mar 22 04:50:39 2011
@@ -29,8 +29,8 @@
 #define V8_FRAMES_INL_H_

 #include "frames.h"
-
 #include "isolate.h"
+#include "v8memory.h"

 #if V8_TARGET_ARCH_IA32
 #include "ia32/frames-ia32.h"
=======================================
--- /branches/bleeding_edge/src/ia32/frames-ia32.h      Fri Mar 18 13:35:07 2011
+++ /branches/bleeding_edge/src/ia32/frames-ia32.h      Tue Mar 22 04:50:39 2011
@@ -28,8 +28,6 @@
 #ifndef V8_IA32_FRAMES_IA32_H_
 #define V8_IA32_FRAMES_IA32_H_

-#include "memory.h"
-
 namespace v8 {
 namespace internal {

=======================================
--- /branches/bleeding_edge/src/liveedit.cc     Fri Mar 18 13:35:07 2011
+++ /branches/bleeding_edge/src/liveedit.cc     Tue Mar 22 04:50:39 2011
@@ -35,10 +35,10 @@
 #include "debug.h"
 #include "deoptimizer.h"
 #include "global-handles.h"
-#include "memory.h"
 #include "parser.h"
 #include "scopeinfo.h"
 #include "scopes.h"
+#include "v8memory.h"

 namespace v8 {
 namespace internal {
=======================================
--- /branches/bleeding_edge/src/objects-inl.h   Fri Mar 18 13:35:07 2011
+++ /branches/bleeding_edge/src/objects-inl.h   Tue Mar 22 04:50:39 2011
@@ -39,10 +39,10 @@
 #include "contexts.h"
 #include "conversions-inl.h"
 #include "heap.h"
-#include "memory.h"
 #include "isolate.h"
 #include "property.h"
 #include "spaces.h"
+#include "v8memory.h"

 namespace v8 {
 namespace internal {
=======================================
--- /branches/bleeding_edge/src/spaces-inl.h    Fri Mar 18 13:35:07 2011
+++ /branches/bleeding_edge/src/spaces-inl.h    Tue Mar 22 04:50:39 2011
@@ -29,8 +29,8 @@
 #define V8_SPACES_INL_H_

 #include "isolate.h"
-#include "memory.h"
 #include "spaces.h"
+#include "v8memory.h"

 namespace v8 {
 namespace internal {
=======================================
--- /branches/bleeding_edge/src/x64/assembler-x64-inl.h Fri Mar 18 13:35:07 2011 +++ /branches/bleeding_edge/src/x64/assembler-x64-inl.h Tue Mar 22 04:50:39 2011
@@ -30,7 +30,7 @@

 #include "cpu.h"
 #include "debug.h"
-#include "memory.h"
+#include "v8memory.h"

 namespace v8 {
 namespace internal {
=======================================
--- /branches/bleeding_edge/src/x64/frames-x64.h        Fri Mar 18 13:35:07 2011
+++ /branches/bleeding_edge/src/x64/frames-x64.h        Tue Mar 22 04:50:39 2011
@@ -28,8 +28,6 @@
 #ifndef V8_X64_FRAMES_X64_H_
 #define V8_X64_FRAMES_X64_H_

-#include "memory.h"
-
 namespace v8 {
 namespace internal {

=======================================
--- /branches/bleeding_edge/tools/gyp/v8.gyp    Fri Mar 18 13:35:07 2011
+++ /branches/bleeding_edge/tools/gyp/v8.gyp    Tue Mar 22 04:50:39 2011
@@ -457,7 +457,6 @@
             '../../src/macro-assembler.h',
             '../../src/mark-compact.cc',
             '../../src/mark-compact.h',
-            '../../src/memory.h',
             '../../src/messages.cc',
             '../../src/messages.h',
             '../../src/natives.h',
@@ -546,6 +545,7 @@
             '../../src/v8.h',
             '../../src/v8checks.h',
             '../../src/v8globals.h',
+            '../../src/v8memory.h',
             '../../src/v8threads.cc',
             '../../src/v8threads.h',
             '../../src/v8utils.h',
=======================================
--- /branches/bleeding_edge/tools/v8.xcodeproj/project.pbxproj Fri Mar 18 19:23:59 2011 +++ /branches/bleeding_edge/tools/v8.xcodeproj/project.pbxproj Tue Mar 22 04:50:39 2011
@@ -761,7 +761,7 @@
897FF1580E719B8F00D62E90 /* macro-assembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "macro-assembler.h"; sourceTree = "<group>"; }; 897FF1590E719B8F00D62E90 /* mark-compact.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "mark-compact.cc"; sourceTree = "<group>"; }; 897FF15A0E719B8F00D62E90 /* mark-compact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "mark-compact.h"; sourceTree = "<group>"; }; - 897FF15B0E719B8F00D62E90 /* memory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memory.h; sourceTree = "<group>"; }; + 897FF15B0E719B8F00D62E90 /* v8memory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = v8memory.h; sourceTree = "<group>"; }; 897FF15C0E719B8F00D62E90 /* messages.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = messages.cc; sourceTree = "<group>"; }; 897FF15D0E719B8F00D62E90 /* messages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = messages.h; sourceTree = "<group>"; }; 897FF15E0E719B8F00D62E90 /* mksnapshot.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mksnapshot.cc; sourceTree = "<group>"; };
@@ -1218,7 +1218,7 @@
                                897FF1580E719B8F00D62E90 /* macro-assembler.h 
*/,
                                897FF1590E719B8F00D62E90 /* mark-compact.cc */,
                                897FF15A0E719B8F00D62E90 /* mark-compact.h */,
-                               897FF15B0E719B8F00D62E90 /* memory.h */,
+                               897FF15B0E719B8F00D62E90 /* v8memory.h */,
                                897FF15C0E719B8F00D62E90 /* messages.cc */,
                                897FF15D0E719B8F00D62E90 /* messages.h */,
                                897FF15E0E719B8F00D62E90 /* mksnapshot.cc */,
=======================================
--- /branches/bleeding_edge/tools/visual_studio/v8_base.vcproj Fri Feb 11 04:25:41 2011 +++ /branches/bleeding_edge/tools/visual_studio/v8_base.vcproj Tue Mar 22 04:50:39 2011
@@ -781,7 +781,7 @@
         >
       </File>
       <File
-        RelativePath="..\..\src\memory.h"
+        RelativePath="..\..\src\v8memory.h"
         >
       </File>
       <File
=======================================
--- /branches/bleeding_edge/tools/visual_studio/v8_base_arm.vcproj Fri Feb 11 04:25:41 2011 +++ /branches/bleeding_edge/tools/visual_studio/v8_base_arm.vcproj Tue Mar 22 04:50:39 2011
@@ -765,7 +765,7 @@
         >
       </File>
       <File
-        RelativePath="..\..\src\memory.h"
+        RelativePath="..\..\src\v8memory.h"
         >
       </File>
       <File
=======================================
--- /branches/bleeding_edge/tools/visual_studio/v8_base_x64.vcproj Fri Feb 11 04:25:41 2011 +++ /branches/bleeding_edge/tools/visual_studio/v8_base_x64.vcproj Tue Mar 22 04:50:39 2011
@@ -782,7 +782,7 @@
         >
       </File>
       <File
-        RelativePath="..\..\src\memory.h"
+        RelativePath="..\..\src\v8memory.h"
         >
       </File>
       <File

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to