Skip to content

Commit 347e9bf

Browse files
committed
Formatting
1 parent e86812b commit 347e9bf

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

src/jni/Runtime.cpp

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,12 @@ Isolate* Runtime::PrepareV8Runtime(const string& filesPath, jstring packageName,
380380

381381
DEBUG_WRITE_FORCE("Snapshot read %s (%dB).", snapshotPath.c_str(), m_heapSnapshotBlob->size);
382382
}
383-
else if(saveSnapshot)
383+
else if (!saveSnapshot)
384+
{
385+
DEBUG_WRITE_FORCE("No snapshot file found at %s", snapshotPath.c_str());
386+
387+
}
388+
else
384389
{
385390
// This should be executed before V8::Initialize, which calls it with false.
386391
NativeScriptExtension::Probe(true);
@@ -390,22 +395,28 @@ Isolate* Runtime::PrepareV8Runtime(const string& filesPath, jstring packageName,
390395
string customScript;
391396

392397
// check for custom script to include in the snapshot
393-
if(Constants::V8_HEAP_SNAPSHOT_SCRIPT.size() > 0 && File::Exists(Constants::V8_HEAP_SNAPSHOT_SCRIPT))
398+
if (Constants::V8_HEAP_SNAPSHOT_SCRIPT.size() > 0 && File::Exists(Constants::V8_HEAP_SNAPSHOT_SCRIPT))
394399
{
395400
customScript = File::ReadText(Constants::V8_HEAP_SNAPSHOT_SCRIPT);
396401
}
397402

398403
DEBUG_WRITE_FORCE("Creating heap snapshot");
399404
*m_startupData = V8::CreateSnapshotDataBlob(customScript.c_str());
400405

401-
if (m_startupData->raw_size == 0) {
406+
if (m_startupData->raw_size == 0)
407+
{
402408
DEBUG_WRITE_FORCE("Failed to create heap snapshot.");
403-
} else {
409+
}
410+
else
411+
{
404412
bool writeSuccess = File::WriteBinary(snapshotPath, m_startupData->data, m_startupData->raw_size);
405413

406-
if (!writeSuccess) {
414+
if (!writeSuccess)
415+
{
407416
DEBUG_WRITE_FORCE("Failed to save created snapshot.");
408-
} else {
417+
}
418+
else
419+
{
409420
DEBUG_WRITE_FORCE("Saved snapshot of %s (%dB) in %s (%dB)",
410421
Constants::V8_HEAP_SNAPSHOT_SCRIPT.c_str(), customScript.size(),
411422
snapshotPath.c_str(), m_startupData->raw_size);

0 commit comments

Comments
 (0)