Skip to content

v8 7.1.302.31 update instructions #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 22 additions & 58 deletions 6.9.427.23.patch → 7.1.302.31.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
diff --git a/BUILD.gn b/BUILD.gn
index 1e31acb..1c7c170 100644
index 83f1fdb..2f3fe6d 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -376,7 +376,7 @@ config("toolchain") {
visibility = [ ":*" ] # Only targets in this file can depend on this.

defines = []
- cflags = []
+ cflags = [ "-Wno-deprecated-declarations" ]
ldflags = []

if (v8_current_cpu == "arm") {
@@ -1493,6 +1493,8 @@ v8_source_set("v8_base") {
@@ -1535,6 +1535,8 @@ v8_source_set("v8_base") {
"include/v8-util.h",
"include/v8.h",
"include/v8config.h",
Expand All @@ -22,13 +13,13 @@ index 1e31acb..1c7c170 100644
"src/address-map.cc",
diff --git a/src/V8NativeScriptExtension.cc b/src/V8NativeScriptExtension.cc
new file mode 100644
index 0000000..6d67650
index 0000000..7a49c4f
--- /dev/null
+++ b/src/V8NativeScriptExtension.cc
@@ -0,0 +1,212 @@
@@ -0,0 +1,213 @@
+#include "V8NativeScriptExtension.h"
+#include "objects-inl.h"
+#include "api.h"
+#include "api-inl.h"
+#include "checks.h"
+#include "contexts.h"
+#include "globals.h"
Expand Down Expand Up @@ -109,9 +100,9 @@ index 0000000..6d67650
+ return h->address();
+}
+
+Local<Value>* NativeScriptExtension::GetClosureObjects(Isolate *isolate, const Local<Function>& func, int *length)
+Local<Value>* NativeScriptExtension::GetClosureObjects(Isolate* isolate, const Local<Function>& func, int* length)
+{
+ unsafe_arr< Local<Value> > arr;
+ unsafe_arr<Local<Value>> arr;
+
+ i::Handle<i::JSReceiver> receiver = Utils::OpenHandle(*func);
+
Expand All @@ -130,26 +121,27 @@ index 0000000..6d67650
+
+ i::ContextLookupFlags cxtFlags = i::FOLLOW_CHAINS;
+
+ if ((cxt != nullptr) && (!cxt->IsNativeContext()))
+ if (cxt != nullptr && !cxt->IsNativeContext())
+ {
+ i::ScopeInfo *si = cxt->scope_info();
+
+ if (si != nullptr)
+ if (si != nullptr && si->HasContext())
+ {
+ int len = si->length();
+
+ for (int i = 0; i < len; i++)
+ {
+ i::Object *cur = si->get(i);
+
+ if ((cur != nullptr) && (cur->IsString()))
+ if (cur != nullptr && cur->IsString())
+ {
+ i::String *s = i::String::cast(cur);
+
+ i::Handle<i::String> name = i::Handle<i::String>(s, internal_isolate);
+
+ i::PropertyAttributes attr;
+ i::InitializationFlag init_flag; i::VariableMode var_mode;
+ i::InitializationFlag init_flag;
+ i::VariableMode var_mode;
+ int idx;
+
+ i::Handle<i::Object> o = cxt->Lookup(name, cxtFlags, &idx, &attr, &init_flag, &var_mode);
Expand Down Expand Up @@ -178,11 +170,11 @@ index 0000000..6d67650
+
+void NativeScriptExtension::ReleaseClosureObjects(Local<Value>* closureObjects)
+{
+ unsafe_arr< Local<Value> >::release_data(closureObjects);
+ unsafe_arr<Local<Value>>::release_data(closureObjects);
+}
+
+
+void NativeScriptExtension::GetAssessorPair(Isolate *isolate, const Local<Object>& obj, const Local<String>& propName, Local<Value>& getter, Local<Value>& setter)
+void NativeScriptExtension::GetAssessorPair(Isolate* isolate, const Local<Object>& obj, const Local<String>& propName, Local<Value>& getter, Local<Value>& setter)
+{
+ i::Handle<i::JSObject> o = i::Handle<i::JSObject>::cast(Utils::OpenHandle(*obj));
+
Expand Down Expand Up @@ -210,7 +202,7 @@ index 0000000..6d67650
+}
+
+
+Local<Array> NativeScriptExtension::GetPropertyKeys(Isolate *isolate, const Local<Context>& context, const Local<Object>& object, bool& success)
+Local<Array> NativeScriptExtension::GetPropertyKeys(Isolate* isolate, const Local<Context>& context, const Local<Object>& object, bool& success)
+{
+ success = true;
+
Expand All @@ -235,66 +227,38 @@ index 0000000..6d67650
+}
+
+void NativeScriptExtension::CpuFeaturesProbe(bool cross_compile) {
+ internal::CpuFeatures::Probe(cross_compile);
+ i::CpuFeatures::Probe(cross_compile);
+}
+
diff --git a/src/V8NativeScriptExtension.h b/src/V8NativeScriptExtension.h
new file mode 100644
index 0000000..c7954f4
index 0000000..1111215
--- /dev/null
+++ b/src/V8NativeScriptExtension.h
@@ -0,0 +1,22 @@
@@ -0,0 +1,23 @@
+#include "v8.h"
+#include "api.h"
+
+namespace v8 {
+
+ class NativeScriptExtension {
+ public:
+ static unsigned long GetAddress(const v8::Local<v8::Object>& obj);
+
+ static v8::Local<v8::Value>* GetClosureObjects(v8::Isolate *isolate, const v8::Local<v8::Function>& func, int *length);
+ static v8::Local<v8::Value>* GetClosureObjects(v8::Isolate* isolate, const v8::Local<v8::Function>& func, int* length);
+
+ static void ReleaseClosureObjects(v8::Local<v8::Value>* closureObjects);
+
+ static void GetAssessorPair(v8::Isolate *isolate, const v8::Local<v8::Object>& obj, const v8::Local<v8::String>& propName, v8::Local<v8::Value>& getter, v8::Local<v8::Value>& setter);
+ static void GetAssessorPair(v8::Isolate* isolate, const v8::Local<v8::Object>& obj, const v8::Local<v8::String>& propName, v8::Local<v8::Value>& getter, v8::Local<v8::Value>& setter);
+
+ static v8::Local<v8::Array> GetPropertyKeys(v8::Isolate *isolate, const v8::Local<v8::Context>& context, const v8::Local<v8::Object>& object, bool& success);
+ static v8::Local<v8::Array> GetPropertyKeys(v8::Isolate* isolate, const v8::Local<v8::Context>& context, const v8::Local<v8::Object>& object, bool& success);
+
+ static void CpuFeaturesProbe(bool cross_compile);
+ private:
+ NativeScriptExtension();
+ };
+}
+
diff --git a/src/api.cc b/src/api.cc
index 7c569e3..409bcb9 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -551,8 +551,22 @@ bool RunExtraCode(Isolate* isolate, Local<Context> context,
ScriptOrigin origin(resource_name);
ScriptCompiler::Source source(source_string, origin);
Local<Script> script;
- if (!ScriptCompiler::Compile(context, &source).ToLocal(&script)) return false;
- if (script->Run(context).IsEmpty()) return false;
+ if (!ScriptCompiler::Compile(context, &source).ToLocal(&script)) {
+ base::OS::PrintError("# Script compile failed in %s@%d:%d\n%s\n",
+ *String::Utf8Value(try_catch.Message()->GetScriptResourceName()),
+ try_catch.Message()->GetLineNumber(context).FromJust(),
+ try_catch.Message()->GetStartColumn(context).FromJust(),
+ *String::Utf8Value(try_catch.Exception()));
+ return false;
+ }
+ if (script->Run(context).IsEmpty()) {
+ base::OS::PrintError("# Script run failed in %s@%d:%d\n%s\n",
+ *String::Utf8Value(try_catch.Message()->GetScriptResourceName()),
+ try_catch.Message()->GetLineNumber(context).FromJust(),
+ try_catch.Message()->GetStartColumn(context).FromJust(),
+ *String::Utf8Value(try_catch.Exception()));
+ return false;
+ }
if (i::FLAG_profile_deserialization) {
i::PrintF("Executing custom snapshot script %s took %0.3f ms\n", name,
timer.Elapsed().InMillisecondsF());
diff --git a/src/inspector/inspector_protocol_config.json b/src/inspector/inspector_protocol_config.json
index fa07312..d7e2cef 100644
--- a/src/inspector/inspector_protocol_config.json
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ export PATH=`pwd`/depot_tools:"$PATH"
sudo apt-get install curl libc6-dev-i386 g++-multilib
```

* Download and extract Android NDK 17c
* Download and extract Android NDK 18b

Mac OS:
```
curl -O https://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip
unzip android-ndk-r17c-darwin-x86_64.zip -d ndkr17c
curl -O https://dl.google.com/android/repository/android-ndk-r18b-darwin-x86_64.zip
unzip android-ndk-r18b-darwin-x86_64.zip -d ndkr18b
```

Linux:
```
curl -O https://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip
unzip android-ndk-r17c-linux-x86_64.zip -d ndkr17c
curl -O https://dl.google.com/android/repository/android-ndk-r18b-linux-x86_64.zip
unzip android-ndk-r18b-linux-x86_64.zip -d ndkr18b
```

* Export ANDROID_NDK_HOME environment variable
```
export ANDROID_NDK_HOME=`pwd`/ndkr17c/android-ndk-r17c
export ANDROID_NDK_HOME=`pwd`/ndkr18b/android-ndk-r18b
```

* `fetch v8` (this will create a `v8` repo folder)
Expand All @@ -44,9 +44,9 @@ ln -s $ANDROID_NDK_HOME third_party/android_tools/ndk
ln -s $ANDROID_NDK_HOME third_party/android_ndk
```

* checkout tag 6.9.427.23
* checkout tag 7.1.302.31
```
git checkout 6.9.427.23
git checkout 7.1.302.31
```

* Run sync
Expand Down
48 changes: 23 additions & 25 deletions build_v8
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,28 @@

case "$(uname -s)" in

Darwin)
echo 'Mac OS X'
cp ./llvm-ar ./v8/third_party/llvm-build/Release+Asserts/bin
NDK_BUILD_TOOLS_ARR=($ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/arm-linux-androideabi/bin \
$ANDROID_NDK_HOME/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/aarch64-linux-android/bin \
$ANDROID_NDK_HOME/toolchains/x86-4.9/prebuilt/darwin-x86_64/i686-linux-android/bin \
$ANDROID_NDK_HOME/toolchains/x86_64-4.9/prebuilt/darwin-x86_64/x86_64-linux-android/bin)
;;

Linux)
echo 'Linux'
NDK_BUILD_TOOLS_ARR=($ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/arm-linux-androideabi/bin \
$ANDROID_NDK_HOME/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/aarch64-linux-android/bin \
$ANDROID_NDK_HOME/toolchains/x86-4.9/prebuilt/linux-x86_64/i686-linux-android/bin \
$ANDROID_NDK_HOME/toolchains/x86_64-4.9/prebuilt/linux-x86_64/x86_64-linux-android/bin)
;;

*)
echo 'Unsupported OS'
;;
Darwin)
echo 'Mac OS X'
cp ./llvm-ar ./v8/third_party/llvm-build/Release+Asserts/bin
NDK_BUILD_TOOLS_ARR=(
$ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/arm-linux-androideabi/bin \
$ANDROID_NDK_HOME/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/aarch64-linux-android/bin \
$ANDROID_NDK_HOME/toolchains/x86-4.9/prebuilt/darwin-x86_64/i686-linux-android/bin \
$ANDROID_NDK_HOME/toolchains/x86_64-4.9/prebuilt/darwin-x86_64/x86_64-linux-android/bin
)
;;

Linux)
echo 'Linux'
NDK_BUILD_TOOLS_ARR=($ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/arm-linux-androideabi/bin \
$ANDROID_NDK_HOME/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/aarch64-linux-android/bin \
$ANDROID_NDK_HOME/toolchains/x86-4.9/prebuilt/linux-x86_64/i686-linux-android/bin \
$ANDROID_NDK_HOME/toolchains/x86_64-4.9/prebuilt/linux-x86_64/x86_64-linux-android/bin)
;;

*)
echo 'Unsupported OS'
;;
esac

# The order of CPU architectures in this array must be the same
Expand All @@ -45,7 +47,7 @@ do
if [[ $BUILD_TYPE == "debug" ]] ;then
gn gen $BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE --args="v8_use_snapshot=true v8_use_external_startup_data=false is_debug=true symbol_level=2 target_cpu=\"$CURRENT_ARCH\" v8_target_cpu=\"$CURRENT_ARCH\" v8_enable_i18n_support=false target_os=\"android\" v8_android_log_stdout=true"
else
gn gen $BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE --args="v8_use_snapshot=true v8_use_external_startup_data=false is_official_build=true is_debug=false symbol_level=0 target_cpu=\"$CURRENT_ARCH\" v8_target_cpu=\"$CURRENT_ARCH\" v8_enable_i18n_support=false target_os=\"android\" v8_android_log_stdout=true"
gn gen $BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE --args="v8_enable_embedded_builtins=false v8_use_snapshot=true v8_use_external_startup_data=false is_official_build=true use_thin_lto=false is_debug=false symbol_level=0 target_cpu=\"$CURRENT_ARCH\" v8_target_cpu=\"$CURRENT_ARCH\" v8_enable_i18n_support=false target_os=\"android\" v8_android_log_stdout=true"
fi
done

Expand All @@ -72,10 +74,6 @@ do
eval $CURRENT_BUILD_TOOL/ar r $BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE/obj/$CURRENT_V8_FOLDER/lib$CURRENT_V8_FOLDER.a "${LAST_PARAM}"
mv $BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE/obj/$CURRENT_V8_FOLDER/lib$CURRENT_V8_FOLDER.a $DIST/$CURRENT_ARCH-$BUILD_TYPE
done

LAST_PARAM=${BUILD_DIR_PREFIX}/${CURRENT_ARCH}-${BUILD_TYPE}/obj/src/inspector/inspector/*.o
eval $CURRENT_BUILD_TOOL/ar r $BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE/obj/src/inspector/inspector/libinspector.a "${LAST_PARAM}"
mv $BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE/obj/src/inspector/inspector/libinspector.a $DIST/$CURRENT_ARCH-$BUILD_TYPE
done

echo "=================================="
Expand Down