Reviewers: Michael Starzinger,
Message:
Please take a look. Weird Visual Studio behavior. Some cctests crash when
using
'::new' instead of 'new' when initializing extension objects.
Description:
Avoid explicitly using built-in new operator where possible to appease
Windows
build.
Please review this at http://codereview.chromium.org/8561011/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/elements.cc
M src/extensions/gc-extension.cc
M src/hashmap.cc
M src/scopes.cc
Index: src/elements.cc
diff --git a/src/elements.cc b/src/elements.cc
index
4376df62c6460b3efa4509f71b63db7d3d538391..ef55d54abd73f8b65e357461af6022b27b953f1d
100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -827,7 +827,7 @@ void ElementsAccessor::InitializeOncePerProcess() {
ELEMENTS_LIST(ACCESSOR_STRUCT)
#undef ACCESSOR_STRUCT
} element_accessors = {
-#define ACCESSOR_INIT(Class, Name) ::new Class(),
+#define ACCESSOR_INIT(Class, Name) new Class(),
ELEMENTS_LIST(ACCESSOR_INIT)
#undef ACCESSOR_INIT
};
Index: src/extensions/gc-extension.cc
diff --git a/src/extensions/gc-extension.cc b/src/extensions/gc-extension.cc
index
238e305f3db712cbbb748dcec385077253b5516f..54c8cdc0c80bf0ac57fb78c19868f7c90c7fa45b
100644
--- a/src/extensions/gc-extension.cc
+++ b/src/extensions/gc-extension.cc
@@ -46,7 +46,8 @@ v8::Handle<v8::Value> GCExtension::GC(const
v8::Arguments& args) {
void GCExtension::Register() {
- static GCExtension* gc_extension = ::new GCExtension();
+ static GCExtension* gc_extension = NULL;
+ if (gc_extension == NULL) gc_extension = new GCExtension();
static v8::DeclareExtension gc_extension_declaration(gc_extension);
}
Index: src/hashmap.cc
diff --git a/src/hashmap.cc b/src/hashmap.cc
index
0b404a97e18667830198c2527ce86a792d751a82..20118a74f488cc15b925a095fa0dba232bb45165
100644
--- a/src/hashmap.cc
+++ b/src/hashmap.cc
@@ -36,7 +36,7 @@
namespace v8 {
namespace internal {
-Allocator* HashMap::DefaultAllocator = ::new Allocator();
+Allocator* HashMap::DefaultAllocator = new Allocator();
HashMap::HashMap(MatchFun match,
Index: src/scopes.cc
diff --git a/src/scopes.cc b/src/scopes.cc
index
60ea20f16d5ed94f8e8a6ab8f6e58db7aab1b4c6..224c1aed9d5ebb736b7fd6f7017d5df2607d31cc
100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -55,7 +55,7 @@ class ZoneAllocator: public Allocator {
};
-static ZoneAllocator* LocalsMapAllocator = ::new ZoneAllocator();
+static ZoneAllocator* LocalsMapAllocator = new ZoneAllocator();
//
----------------------------------------------------------------------------
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev