Commit 1a9997ee authored by dcarney@chromium.org's avatar dcarney@chromium.org

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=
TBR=dcarney@chromium.org

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

Patch from Marja Hölttä <marja@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14554 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 2d902c12
......@@ -83,19 +83,21 @@ class CcTest {
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_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment