Skip to content

Commit 1568df7

Browse files
authored
Merge pull request #1357 from NativeScript/darind/v8-7.4.288.25
Upgrade v8 to 7.4.288.25
2 parents 9762e7d + 2df7898 commit 1568df7

File tree

362 files changed

+104015
-110109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

362 files changed

+104015
-110109
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
env:
22
global:
33
- NODE_VERSION=10
4-
- NDK_VERSION=r19b
4+
- NDK_VERSION=r19c
55
- DATE=$(date +%Y-%m-%d)
66
- PACKAGE_VERSION=next-$DATE-$TRAVIS_BUILD_NUMBER
77
- EMULATOR_API_LEVEL=21
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"v8Version": "7.3.492.25",
2+
"v8Version": "7.4.288.25",
33
"mksnapshotParams": "--profile_deserialization --turbo_instruction_scheduling"
44
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
"version": "5.1.1",
1414
"android": "3.4.0"
1515
},
16-
"android_ndk_version": "19b"
16+
"android_ndk_version": "19c"
1717
}
Binary file not shown.
Binary file not shown.
Binary file not shown.

test-app/runtime/src/main/cpp/ArgConverter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ using namespace tns;
1515

1616
void ArgConverter::Init(Isolate* isolate) {
1717
auto cache = GetTypeLongCache(isolate);
18+
auto context = isolate->GetCurrentContext();
1819

1920
auto ft = FunctionTemplate::New(isolate, ArgConverter::NativeScriptLongFunctionCallback);
2021
ft->SetClassName(V8StringConstants::GetLongNumber(isolate));
2122
ft->InstanceTemplate()->Set(V8StringConstants::GetValueOf(isolate), FunctionTemplate::New(isolate, ArgConverter::NativeScriptLongValueOfFunctionCallback));
2223
ft->InstanceTemplate()->Set(V8StringConstants::GetToString(isolate), FunctionTemplate::New(isolate, ArgConverter::NativeScriptLongToStringFunctionCallback));
23-
cache->LongNumberCtorFunc = new Persistent<Function>(isolate, ft->GetFunction());
24+
cache->LongNumberCtorFunc = new Persistent<Function>(isolate, ft->GetFunction(context).ToLocalChecked());
2425

2526
auto nanObject = Number::New(isolate, numeric_limits<double>::quiet_NaN()).As<NumberObject>();
2627
cache->NanNumberObject = new Persistent<NumberObject>(isolate, nanObject);

test-app/runtime/src/main/cpp/ArrayBufferHelper.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ ArrayBufferHelper::ArrayBufferHelper()
1515
void ArrayBufferHelper::CreateConvertFunctions(Isolate* isolate, const Local<Object>& global, ObjectManager* objectManager) {
1616
m_objectManager = objectManager;
1717
auto extData = External::New(isolate, this);
18-
auto fromFunc = FunctionTemplate::New(isolate, CreateFromCallbackStatic, extData)->GetFunction();
18+
auto context = isolate->GetCurrentContext();
19+
auto fromFunc = FunctionTemplate::New(isolate, CreateFromCallbackStatic, extData)->GetFunction(context).ToLocalChecked();
1920
auto ctx = isolate->GetCurrentContext();
2021
auto arrBufferCtorFunc = global->Get(ArgConverter::ConvertToV8String(isolate, "ArrayBuffer")).As<Function>();
2122
arrBufferCtorFunc->Set(ctx, ArgConverter::ConvertToV8String(isolate, "from"), fromFunc);

test-app/runtime/src/main/cpp/ArrayHelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void ArrayHelper::Init(const Local<Context>& context) {
2929
auto success = arr.ToLocal(&arrVal);
3030
if (success) {
3131
auto arrayObj = arrVal.As<Object>();
32-
arrayObj->Set(context, ArgConverter::ConvertToV8String(isolate, "create"), FunctionTemplate::New(isolate, CreateJavaArrayCallback)->GetFunction());
32+
arrayObj->Set(context, ArgConverter::ConvertToV8String(isolate, "create"), FunctionTemplate::New(isolate, CreateJavaArrayCallback)->GetFunction(context).ToLocalChecked());
3333
}
3434
}
3535
}

test-app/runtime/src/main/cpp/CallbackHandlers.cpp

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,9 @@ CallbackHandlers::GetImplementedInterfaces(JEnv& env, const Local<Object>& imple
558558
}
559559

560560
vector<jstring> interfacesToImplement;
561-
auto propNames = implementationObject->GetOwnPropertyNames();
562561
auto isolate = implementationObject->GetIsolate();
562+
auto context = isolate->GetCurrentContext();
563+
auto propNames = implementationObject->GetOwnPropertyNames(context).ToLocalChecked();
563564
for (int i = 0; i < propNames->Length(); i++) {
564565
auto name = propNames->Get(i).As<String>();
565566
auto prop = implementationObject->Get(name);
@@ -616,8 +617,9 @@ CallbackHandlers::GetMethodOverrides(JEnv& env, const Local<Object>& implementat
616617
}
617618

618619
vector<jstring> methodNames;
619-
auto propNames = implementationObject->GetOwnPropertyNames();
620620
auto isolate = implementationObject->GetIsolate();
621+
auto context = isolate->GetCurrentContext();
622+
auto propNames = implementationObject->GetOwnPropertyNames(context).ToLocalChecked();
621623
for (int i = 0; i < propNames->Length(); i++) {
622624
auto name = propNames->Get(i).As<String>();
623625
auto method = implementationObject->Get(name);
@@ -842,11 +844,13 @@ Local<Value> CallbackHandlers::CallJSMethod(Isolate* isolate, JNIEnv* _env,
842844
arguments[i] = jsArgs->Get(i);
843845
}
844846

847+
auto context = isolate->GetCurrentContext();
848+
845849
TryCatch tc(isolate);
846850
Local<Value> jsResult;
847851
{
848852
SET_PROFILER_FRAME();
849-
jsResult = jsMethod->Call(jsObject, argc, argc == 0 ? nullptr : arguments.data());
853+
jsMethod->Call(context, jsObject, argc, argc == 0 ? nullptr : arguments.data()).ToLocal(&jsResult);
850854
}
851855

852856
//TODO: if javaResult is a pure js object create a java object that represents this object in java land
@@ -1043,7 +1047,7 @@ void CallbackHandlers::WorkerGlobalOnMessageCallback(Isolate* isolate, jstring m
10431047

10441048
auto func = callback.As<Function>();
10451049

1046-
func->Call(Undefined(isolate), 1, args1);
1050+
func->Call(context, Undefined(isolate), 1, args1);
10471051
} else {
10481052
DEBUG_WRITE(
10491053
"WORKER: WorkerGlobalOnMessageCallback couldn't fire a worker's `onmessage` callback because it isn't implemented!");
@@ -1154,7 +1158,7 @@ CallbackHandlers::WorkerObjectOnMessageCallback(Isolate* isolate, jint workerId,
11541158

11551159
auto func = callback.As<Function>();
11561160

1157-
func->Call(Undefined(isolate), 1, args1);
1161+
func->Call(context, Undefined(isolate), 1, args1);
11581162
} else {
11591163
DEBUG_WRITE(
11601164
"MAIN: WorkerObjectOnMessageCallback couldn't fire a worker(id=%d) object's `onmessage` callback because it isn't implemented.",
@@ -1264,7 +1268,7 @@ void CallbackHandlers::WorkerGlobalCloseCallback(const v8::FunctionCallbackInfo<
12641268
auto func = callback.As<Function>();
12651269

12661270
DEBUG_WRITE("WORKER: WorketThreadCloseCallback onclose handle is being called.");
1267-
func->Call(Undefined(isolate), 0, args1);
1271+
func->Call(context, Undefined(isolate), 0, args1);
12681272
DEBUG_WRITE("WORKER: WorketThreadCloseCallback onclose handle was called.");
12691273
}
12701274

@@ -1309,7 +1313,8 @@ void CallbackHandlers::CallWorkerScopeOnErrorHandle(Isolate* isolate, TryCatch&
13091313

13101314
auto func = callback.As<Function>();
13111315

1312-
auto result = func->Call(Undefined(isolate), 1, args1);
1316+
Local<Value> result;
1317+
func->Call(context, Undefined(isolate), 1, args1).ToLocal(&result);
13131318

13141319
// return 'true'-like value, don't bubble up to main Worker.onerror
13151320
if (!result.IsEmpty() && result->BooleanValue(context).ToChecked()) {
@@ -1404,9 +1409,11 @@ CallbackHandlers::CallWorkerObjectOnErrorHandle(Isolate* isolate, jint workerId,
14041409

14051410
auto func = callback.As<Function>();
14061411

1407-
// Handle exceptions thrown in onmessage with the worker.onerror handler, if present
1408-
auto result = func->Call(Undefined(isolate), 1, args1);
14091412
auto context = isolate->GetCurrentContext();
1413+
1414+
// Handle exceptions thrown in onmessage with the worker.onerror handler, if present
1415+
Local<Value> result;
1416+
func->Call(context, Undefined(isolate), 1, args1).ToLocal(&result);
14101417
if (!result.IsEmpty() && result->BooleanValue(context).ToChecked()) {
14111418
// Do nothing, exception is handled and does not need to be raised to application level
14121419
return;

0 commit comments

Comments
 (0)