Revision: 14554
Author:   [email protected]
Date:     Mon May  6 06:01:03 2013
Log:      Make v8 compilable without V8_USE_UNSAFE_HANDLES.

Without this modification, we get this error: "dereferencing type-punned pointer
will break strict-aliasing rules" (GCC strict aliasing).

Also included small CcTest sanity fixes: isolate() cannot return anything else
than default_isolate().

BUG=
[email protected]

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

Patch from Marja Hölttä <[email protected]>.
http://code.google.com/p/v8/source/detail?r=14554

Modified:
 /branches/bleeding_edge/test/cctest/cctest.h

=======================================
--- /branches/bleeding_edge/test/cctest/cctest.h        Thu May  2 13:18:42 2013
+++ /branches/bleeding_edge/test/cctest/cctest.h        Mon May  6 06:01:03 2013
@@ -83,19 +83,21 @@
   const char* name() { return name_; }
   const char* dependency() { return dependency_; }
   bool enabled() { return enabled_; }
-  static void set_default_isolate(v8::Isolate* default_isolate) {
-    default_isolate_ = default_isolate;
-  }
   static v8::Isolate* default_isolate() { return default_isolate_; }
-  static v8::Isolate* isolate() { return context()->GetIsolate(); }
-  static v8::Handle<v8::Context> env() { return context(); }
+
+  static v8::Handle<v8::Context> env() {
+    return v8::Local<v8::Context>::New(default_isolate_, context_);
+  }
+
+  static v8::Isolate* isolate() { return default_isolate_; }

   // Helper function to initialize the VM.
static void InitializeVM(CcTestExtensionFlags extensions = NO_EXTENSIONS);

  private:
-  static v8::Handle<v8::Context> context() {
-      return *reinterpret_cast<v8::Handle<v8::Context>*>(&context_);
+  friend int main(int argc, char** argv);
+  static void set_default_isolate(v8::Isolate* default_isolate) {
+    default_isolate_ = default_isolate;
   }
   TestFunction* callback_;
   const char* file_;

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to