Skip to content

Commit 3a8316d

Browse files
committed
feat: Upgrade V8 to 8.3.110.9
1 parent 2ab8fd1 commit 3a8316d

File tree

131 files changed

+27263
-84214
lines changed

Some content is hidden

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

131 files changed

+27263
-84214
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=r21
4+
- NDK_VERSION=r21b
55
- DATE=$(date +%Y-%m-%d)
66
- PACKAGE_VERSION=next-$DATE-$TRAVIS_BUILD_NUMBER
77
- EMULATOR_API_LEVEL=21
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"v8Version": "8.0.426.16",
3-
"ndkRevision": "21.0.6113669",
2+
"v8Version": "8.3.110.9",
3+
"ndkRevision": "21.1.6352462",
44
"mksnapshotParams": "--profile_deserialization --turbo_instruction_scheduling --target_os=android --no-native-code-counters"
55
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
"version": "5.4.1",
1414
"android": "3.5.3"
1515
},
16-
"android_ndk_version": "21"
16+
"android_ndk_version": "21b"
1717
}

test-app/runtime/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ if (NOT OPTIMIZED_BUILD OR OPTIMIZED_WITH_INSPECTOR_BUILD)
118118
src/main/cpp/v8_inspector/src/inspector/v8-string-conversions.cc
119119
src/main/cpp/v8_inspector/src/inspector/v8-value-utils.cc
120120
src/main/cpp/v8_inspector/src/inspector/value-mirror.cc
121-
src/main/cpp/v8_inspector/src/inspector/wasm-translation.cc
122121
)
123122
else ()
124123
# Debug builds will include the V8 inspector sources

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <sstream>
66
#include <ArgConverter.h>
77
#include <NativeScriptAssert.h>
8+
#include <v8_inspector/third_party/inspector_protocol/crdtp/json.h>
89
#include "DOMDomainCallbackHandlers.h"
910

1011
using namespace tns;
@@ -41,14 +42,18 @@ void DOMDomainCallbackHandlers::ChildNodeInsertedCallback(const v8::FunctionCall
4142
auto node = args[2]->ToString(context).ToLocalChecked();
4243

4344
auto resultString = V8DOMAgentImpl::AddBackendNodeIdProperty(isolate, node);
44-
auto resultUtf16Data = resultString.data();
45-
46-
auto nodeJson = protocol::StringUtil::parseJSON(String16((const uint16_t*) resultUtf16Data));
45+
auto nodeUtf16Data = resultString.data();
46+
const String16& nodeString16 = String16((const uint16_t*) nodeUtf16Data);
47+
std::vector<uint8_t> cbor;
48+
v8_crdtp::json::ConvertJSONToCBOR(v8_crdtp::span<uint16_t>(nodeString16.characters16(), nodeString16.length()), &cbor);
49+
std::unique_ptr<protocol::Value> protocolNodeJson = protocol::Value::parseBinary(cbor.data(), cbor.size());
4750

4851
protocol::ErrorSupport errorSupport;
49-
auto domNode = protocol::DOM::Node::fromValue(nodeJson.get(), &errorSupport);
52+
auto domNode = protocol::DOM::Node::fromValue(protocolNodeJson.get(), &errorSupport);
5053

51-
auto errorSupportString = errorSupport.errors().utf8();
54+
std::vector<uint8_t> json;
55+
v8_crdtp::json::ConvertCBORToJSON(errorSupport.Errors(), &json);
56+
auto errorSupportString = String16(reinterpret_cast<const char*>(json.data()), json.size()).utf8();
5257
if (!errorSupportString.empty()) {
5358
auto errorMessage = "Error while parsing debug `DOM Node` object. ";
5459
DEBUG_WRITE_FORCE("%s Error: %s", errorMessage, errorSupportString.c_str());

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,8 @@ void MetadataNode::FieldAccessorSetterCallback(Local<Name> property, Local<Value
351351
auto fieldCallbackData = reinterpret_cast<FieldCallbackData*>(info.Data().As<External>()->Value());
352352

353353
if (!fieldCallbackData->isStatic && thiz->StrictEquals(info.Holder())) {
354-
info.GetReturnValue().SetUndefined();
354+
auto isolate = info.GetIsolate();
355+
info.GetReturnValue().Set(v8::Undefined(isolate));
355356
return;
356357
}
357358

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Response NSV8DebuggerAgentImpl::getPossibleBreakpoints(
3131
return V8DebuggerAgentImpl::getPossibleBreakpoints(std::move(start), std::move(end), std::move(restrictToFunction), locations);
3232
} else {
3333
*locations = std::make_unique<protocol::Array<protocol::Debugger::BreakLocation>>();
34-
return Response::OK();
34+
return Response::Success();
3535
}
3636
}
3737

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

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44

55
#include <sstream>
6+
#include <v8_inspector/third_party/inspector_protocol/crdtp/json.h>
67
#include "NetworkDomainCallbackHandlers.h"
78
#include "NativeScriptAssert.h"
89

@@ -65,16 +66,17 @@ void NetworkDomainCallbackHandlers::ResponseReceivedCallback(const v8::FunctionC
6566
throw NativeScriptException("`response` parameter not in the correct format.");
6667
}
6768

68-
auto responseJsonString = ArgConverter::ConvertToUtf16String(responseJson);
69-
auto responseUtf16Data = responseJsonString.data();
70-
auto protocolResponseJson = protocol::StringUtil::parseJSON(String16((const uint16_t*) responseUtf16Data));
69+
const String16 responseJsonString = toProtocolString(isolate, responseJson);
70+
std::vector<uint8_t> cbor;
71+
v8_crdtp::json::ConvertJSONToCBOR(v8_crdtp::span<uint16_t>(responseJsonString.characters16(), responseJsonString.length()), &cbor);
72+
std::unique_ptr<protocol::Value> protocolResponseJson = protocol::Value::parseBinary(cbor.data(), cbor.size());
7173

7274
protocol::ErrorSupport errorSupport;
75+
auto protocolResponseObj = protocol::Network::Response::fromValue(protocolResponseJson.get(), &errorSupport);
7376

74-
auto protocolResponseObj = protocol::Network::Response::fromValue(protocolResponseJson.get(),
75-
&errorSupport);
76-
77-
auto errorString = errorSupport.errors().utf8();
77+
std::vector<uint8_t> json;
78+
v8_crdtp::json::ConvertCBORToJSON(errorSupport.Errors(), &json);
79+
auto errorString = String16(reinterpret_cast<const char*>(json.data()), json.size()).utf8();
7880

7981
if (!errorString.empty()) {
8082
auto errorMessage = "Error while parsing debug `response` object. ";
@@ -166,16 +168,18 @@ void NetworkDomainCallbackHandlers::RequestWillBeSentCallback(const v8::Function
166168
throw NativeScriptException("`request` parameter not in the correct format.");
167169
}
168170

169-
auto requestJsonString = ArgConverter::ConvertToUtf16String(requestJson);
170-
auto requestUtf16Data = requestJsonString.data();
171-
auto protocolRequestJson = protocol::StringUtil::parseJSON(String16((const uint16_t*) requestUtf16Data));
171+
const String16& requestJsonString16 = toProtocolString(isolate, requestJson);
172+
std::vector<uint8_t> cbor;
173+
v8_crdtp::json::ConvertJSONToCBOR(v8_crdtp::span<uint16_t>(requestJsonString16.characters16(), requestJsonString16.length()), &cbor);
174+
std::unique_ptr<protocol::Value> protocolRequestJson = protocol::Value::parseBinary(cbor.data(), cbor.size());
172175

173176
protocol::ErrorSupport errorSupport;
174-
175177
auto protocolRequestObj = protocol::Network::Request::fromValue(protocolRequestJson.get(), &errorSupport);
176178
auto initiator = protocol::Network::Initiator::create().setType(protocol::Network::Initiator::TypeEnum::Script).build();
177179

178-
auto errorString = errorSupport.errors().utf8();
180+
std::vector<uint8_t> json;
181+
v8_crdtp::json::ConvertCBORToJSON(errorSupport.Errors(), &json);
182+
auto errorString = String16(reinterpret_cast<const char*>(json.data()), json.size()).utf8();
179183

180184
if (!errorString.empty()) {
181185
auto errorMessage = "Error while parsing debug `request` object. ";

test-app/runtime/src/main/cpp/include/inspector/Debugger.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ namespace protocol {
1616
#define v8_inspector_protocol_exported_api_h
1717
class V8_EXPORT Exported {
1818
public:
19-
virtual std::unique_ptr<StringBuffer> toJSONString() const = 0;
20-
virtual void writeBinary(std::vector<uint8_t>* out) const = 0;
19+
virtual void AppendSerialized(std::vector<uint8_t>* out) const = 0;
20+
2121
virtual ~Exported() { }
2222
};
2323
#endif // !defined(v8_inspector_protocol_exported_api_h)
@@ -47,7 +47,6 @@ V8_EXPORT extern const char* XHR;
4747

4848
class V8_EXPORT SearchMatch : public Exported {
4949
public:
50-
static std::unique_ptr<protocol::Debugger::API::SearchMatch> fromJSONString(const StringView& json);
5150
static std::unique_ptr<protocol::Debugger::API::SearchMatch> fromBinary(const uint8_t* data, size_t length);
5251
};
5352

test-app/runtime/src/main/cpp/include/inspector/Runtime.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ namespace protocol {
1616
#define v8_inspector_protocol_exported_api_h
1717
class V8_EXPORT Exported {
1818
public:
19-
virtual std::unique_ptr<StringBuffer> toJSONString() const = 0;
20-
virtual void writeBinary(std::vector<uint8_t>* out) const = 0;
19+
virtual void AppendSerialized(std::vector<uint8_t>* out) const = 0;
20+
2121
virtual ~Exported() { }
2222
};
2323
#endif // !defined(v8_inspector_protocol_exported_api_h)
@@ -31,19 +31,16 @@ namespace API {
3131

3232
class V8_EXPORT RemoteObject : public Exported {
3333
public:
34-
static std::unique_ptr<protocol::Runtime::API::RemoteObject> fromJSONString(const StringView& json);
3534
static std::unique_ptr<protocol::Runtime::API::RemoteObject> fromBinary(const uint8_t* data, size_t length);
3635
};
3736

3837
class V8_EXPORT StackTrace : public Exported {
3938
public:
40-
static std::unique_ptr<protocol::Runtime::API::StackTrace> fromJSONString(const StringView& json);
4139
static std::unique_ptr<protocol::Runtime::API::StackTrace> fromBinary(const uint8_t* data, size_t length);
4240
};
4341

4442
class V8_EXPORT StackTraceId : public Exported {
4543
public:
46-
static std::unique_ptr<protocol::Runtime::API::StackTraceId> fromJSONString(const StringView& json);
4744
static std::unique_ptr<protocol::Runtime::API::StackTraceId> fromBinary(const uint8_t* data, size_t length);
4845
};
4946

0 commit comments

Comments
 (0)