Skip to content

Commit d5ccf25

Browse files
authored
Merge branch 'master' into trifonov/console-log-release
2 parents b18f29e + a56f918 commit d5ccf25

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,12 @@ void ObjectManager::MarkReachableObjects(Isolate* isolate, const Local<Object>&
468468
auto fromId = fromJsInfo->JavaObjectID;
469469

470470
auto curGCNumValue = Integer::New(isolate, numberOfGC);
471+
bool firstRun = true;
471472

472473
while (!s.empty()) {
474+
auto isInFirstRun = firstRun;
475+
firstRun = false;
476+
473477
auto top = s.top();
474478
s.pop();
475479

@@ -478,6 +482,14 @@ void ObjectManager::MarkReachableObjects(Isolate* isolate, const Local<Object>&
478482
}
479483

480484
auto o = top.As<Object>();
485+
if(!isInFirstRun) {
486+
uint8_t* addr = NativeScriptExtension::GetAddress(o);
487+
auto itFound = m_visited.find(addr);
488+
if (itFound != m_visited.end()) {
489+
continue;
490+
}
491+
m_visited.insert(addr); // set as processed only if the current object is not the object we are starting from
492+
}
481493

482494
auto jsInfo = GetJSInstanceInfo(o);
483495
if ((jsInfo != nullptr) && (jsInfo->JavaObjectID != fromId)) {
@@ -492,13 +504,6 @@ void ObjectManager::MarkReachableObjects(Isolate* isolate, const Local<Object>&
492504
V8SetPrivateValue(isolate, o, propName, curGCNumValue);
493505
}
494506

495-
uint8_t* addr = NativeScriptExtension::GetAddress(o);
496-
auto itFound = m_visited.find(addr);
497-
if (itFound != m_visited.end()) {
498-
continue;
499-
}
500-
m_visited.insert(addr);
501-
502507
if (o->IsFunction()) {
503508
auto func = o.As<Function>();
504509

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,12 @@ Isolate* Runtime::PrepareV8Runtime(const string& filesPath, const string& native
411411

412412
snapshotPtr = dlopen(snapshotPath.c_str(), RTLD_LAZY | RTLD_LOCAL);
413413
if (snapshotPtr == nullptr) {
414-
DEBUG_WRITE_FORCE("Failed to load snapshot: %s", dlerror());
414+
auto ignoredSearchValue = string("library \"" + snapshotPath + "\" not found");
415+
auto currentError = dlerror();
416+
std::string stringError(currentError);
417+
if (stringError.find(ignoredSearchValue) == std::string::npos) {
418+
DEBUG_WRITE_FORCE("Failed to load snapshot: %s", currentError);
419+
}
415420
}
416421

417422
if (snapshotPtr) {

0 commit comments

Comments
 (0)