Reviewers: Dmitry Titov, Mads Ager, zarko, Vitaly,

Description:
[Isolates] Fixing Win32 compile and running tests failure.
1. Fixed using boolean expressions in preprocessor directives.

MSVC complains (src\version.cc(46) : fatal error C1017: invalid integer
constant expression) on this preprocessor line

#if CANDIDATE_VERSION == true

replaced true with 1 in this line and in previous #define .
2. Initialized var_ field in one of VariableProxy constructors in order to
VariableProxySentinel get initialized state
(tests crash otherwise)
2. Initialized initialized_ field of Builtins class (tests crash otherwise)
3. Extracted Isolate::TearDown from Isolate::TearDownAndRecreateGlobalIsolate
and use extracted method from
V8::TearDown (tests crash otherwise)


Please review this at http://codereview.chromium.org/2844034/show

SVN Base: http://v8.googlecode.com/svn/branches/experimental/isolates/

Affected files:
  M     src/ast.cc
  M     src/builtins.cc
  M     src/isolate.h
  M     src/isolate.cc
  M     src/v8.cc
  M     src/version.cc


Index: src/builtins.cc
===================================================================
--- src/builtins.cc     (revision 4957)
+++ src/builtins.cc     (working copy)
@@ -1379,7 +1379,7 @@
 #endif


-Builtins::Builtins() {
+Builtins::Builtins(): initialized_(false) {
   memset(builtins_, 0, sizeof(builtins_[0]) * builtin_count);
   memset(names_, 0, sizeof(names_[0]) * builtin_count);
 }
Index: src/isolate.h
===================================================================
--- src/isolate.h       (revision 4957)
+++ src/isolate.h       (working copy)
@@ -248,6 +248,9 @@
 #endif

   // Destroy the global isolate and create a new one in its place.
+  static void TearDown();
+
+  // Destroy the global isolate and create a new one in its place.
   static void TearDownAndRecreateGlobalIsolate();

   // Creates a new isolate (perhaps using a deserializer). Returns null
Index: src/v8.cc
===================================================================
--- src/v8.cc   (revision 4957)
+++ src/v8.cc   (working copy)
@@ -67,7 +67,7 @@
 void V8::TearDown() {
   if (!has_been_setup_ || has_been_disposed_) return;

-  Isolate::TearDownAndRecreateGlobalIsolate();
+  Isolate::TearDown();

   is_running_ = false;
   has_been_disposed_ = true;
Index: src/isolate.cc
===================================================================
--- src/isolate.cc      (revision 4957)
+++ src/isolate.cc      (working copy)
@@ -279,13 +279,16 @@
 #undef ISOLATE_INIT_ARRAY_EXECUTE
 }

-
-void Isolate::TearDownAndRecreateGlobalIsolate() {
+void Isolate::TearDown() {
   if (global_isolate_ != NULL) {
     delete global_isolate_;
     global_isolate_ = NULL;
   }
+}

+void Isolate::TearDownAndRecreateGlobalIsolate() {
+  TearDown();
+
   global_isolate_ = new Isolate();
   global_isolate_->PreInit();
 }
Index: src/ast.cc
===================================================================
--- src/ast.cc  (revision 4957)
+++ src/ast.cc  (working copy)
@@ -91,6 +91,7 @@
 VariableProxy::VariableProxy(bool is_this)
   : is_this_(is_this),
     reaching_definitions_(NULL),
+    var_(NULL),
     is_primitive_(false) {
 }

Index: src/version.cc
===================================================================
--- src/version.cc      (revision 4957)
+++ src/version.cc      (working copy)
@@ -36,14 +36,14 @@
 #define MINOR_VERSION     2
 #define BUILD_NUMBER      20
 #define PATCH_LEVEL       0
-#define CANDIDATE_VERSION true
+#define CANDIDATE_VERSION 1

 // Define SONAME to have the SCons build the put a specific SONAME into the
 // shared library instead the generic SONAME generated from the V8 version
 // number. This define is mainly used by the SCons build script.
 #define SONAME            ""

-#if CANDIDATE_VERSION == true
+#if CANDIDATE_VERSION == 1
 #define CANDIDATE_STRING " (candidate)"
 #else
 #define CANDIDATE_STRING ""


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

Reply via email to