Update V8 to r4588
We're using WebKit r58033, as used by
http://src.chromium.org/svn/releases/5.0.387.0/DEPS
This requires http://v8.googlecode.com/svn/trunk@4465 but this version has a
crashing bug for ARM. Instead we use http://v8.googlecode.com/svn/trunk@4588,
which is used by http://src.chromium.org/svn/releases/6.0.399.0/DEPS
Note that a trivial bug fix was required in arm/codegen-arm.cc. This is guarded
with ANDROID. See http://code.google.com/p/v8/issues/detail?id=703
Change-Id: I459647a8286c4f8c7405f0c5581ecbf051a6f1e8
diff --git a/src/d8.cc b/src/d8.cc
index dedbd55..a69320a 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -102,7 +102,7 @@
// Converts a V8 value to a C string.
-const char* ToCString(const v8::String::Utf8Value& value) {
+const char* Shell::ToCString(const v8::String::Utf8Value& value) {
return *value ? *value : "<string conversion failed>";
}
@@ -447,9 +447,10 @@
#ifdef ENABLE_DEBUGGER_SUPPORT
// Install the debugger object in the utility scope
i::Debug::Load();
- i::JSObject* debug = i::Debug::debug_context()->global();
+ i::Handle<i::JSObject> debug
+ = i::Handle<i::JSObject>(i::Debug::debug_context()->global());
utility_context_->Global()->Set(String::New("$debug"),
- Utils::ToLocal(&debug));
+ Utils::ToLocal(debug));
#endif
// Run the d8 shell utility script in the utility context
@@ -467,9 +468,12 @@
// Mark the d8 shell script as native to avoid it showing up as normal source
// in the debugger.
- i::Handle<i::JSFunction> script_fun = Utils::OpenHandle(*script);
- i::Handle<i::Script> script_object =
- i::Handle<i::Script>(i::Script::cast(script_fun->shared()->script()));
+ i::Handle<i::Object> compiled_script = Utils::OpenHandle(*script);
+ i::Handle<i::Script> script_object = compiled_script->IsJSFunction()
+ ? i::Handle<i::Script>(i::Script::cast(
+ i::JSFunction::cast(*compiled_script)->shared()->script()))
+ : i::Handle<i::Script>(i::Script::cast(
+ i::SharedFunctionInfo::cast(*compiled_script)->script()));
script_object->set_type(i::Smi::FromInt(i::Script::TYPE_NATIVE));
// Create the evaluation context