10000 Improve performance of generating JS class from Metadata by ammarahm-ed · Pull Request #1824 · NativeScript/android · GitHub
[go: up one dir, main page]

Skip to content

Improve performance of generating JS class from Metadata #1824

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 10 commits into from
Jan 19, 2025
Merged
Prev Previous commit
Next Next commit
fix: pass entry by reference to SymbolHasInstanceCallback
  • Loading branch information
ammarahm-ed committed Oct 7, 2024
commit 0eb90522c6c1e021fd47eb7947d8dd9d007058ed
8 changes: 4 additions & 4 deletions test-app/runtime/src/main/cpp/MetadataNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ void MetadataNode::PackageGetterCallback(Local<Name> property, const PropertyCal
// return true;
// }
// });
RegisterSymbolHasInstanceCallback(isolate, &child, cachedItem);
RegisterSymbolHasInstanceCallback(isolate, child, cachedItem);
}

V8SetPrivateValue(isolate, thiz, strProperty, cachedItem);
Expand Down Expand Up @@ -2138,7 +2138,7 @@ void MetadataNode::SetMissingBaseMethods(
}
}

void MetadataNode::RegisterSymbolHasInstanceCallback(Isolate* isolate, MetadataEntry* entry, Local<Value> interface) {
void MetadataNode::RegisterSymbolHasInstanceCallback(Isolate* isolate, MetadataEntry& entry, Local<Value> interface) {
if (interface->IsNullOrUndefined()) {
return;
}
Expand Down Expand Up @@ -2193,9 +2193,9 @@ void MetadataNode::SymbolHasInstanceCallback(const v8::FunctionCallbackInfo<v8::
info.GetReturnValue().Set(isInstanceOf);
}

std::string MetadataNode::GetJniClassName(MetadataEntry* entry) {
std::string MetadataNode::GetJniClassName(MetadataEntry& entry) {
std::stack<string> s;
MetadataTreeNode* n = entry->treeNode;
MetadataTreeNode* n = entry.treeNode;
while (n != nullptr && n->name != "") {
s.push(n->name);
n = n->parent;
Expand Down
4 changes: 2 additions & 2 deletions test-app/runtime/src/main/cpp/MetadataNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ class MetadataNode {
static bool GetExtendLocation(v8::Isolate* isolate, std::string& extendLocation, bool isTypeScriptExtend);
static ExtendedClassCacheData GetCachedExtendedClassData(v8::Isolate* isolate, const std::string& proxyClassName);

static void RegisterSymbolHasInstanceCallback(v8::Isolate* isolate, MetadataEntry* entry, v8::Local<v8::Value> interface);
static void RegisterSymbolHasInstanceCallback(v8::Isolate* isolate, MetadataEntry& entry, v8::Local<v8::Value> interface);
static void SymbolHasInstanceCallback(const v8::FunctionCallbackInfo<v8::Value>& info);
static std::string GetJniClassName(MetadataEntry* entry);
static std::string GetJniClassName(MetadataEntry& entry);

static v8::Local<v8::Function> Wrap(v8::Isolate* isolate, const v8::Local<v8::Function>& function, const std::string& name, const std::string& origin, bool isCtorFunc);

Expand Down
Loading
0