diff options
Diffstat (limited to 'deps/v8/src/startup-data-util.cc')
-rw-r--r-- | deps/v8/src/startup-data-util.cc | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/deps/v8/src/startup-data-util.cc b/deps/v8/src/startup-data-util.cc index e20ec218d5..7c6d9ebf21 100644 --- a/deps/v8/src/startup-data-util.cc +++ b/deps/v8/src/startup-data-util.cc @@ -7,9 +7,9 @@ #include <stdlib.h> #include <string.h> +#include "src/base/file-utils.h" #include "src/base/logging.h" #include "src/base/platform/platform.h" -#include "src/flags.h" #include "src/utils.h" @@ -78,27 +78,6 @@ void LoadFromFiles(const char* natives_blob, const char* snapshot_blob) { atexit(&FreeStartupData); } - -char* RelativePath(char** buffer, const char* exec_path, const char* name) { - DCHECK(exec_path); - int path_separator = static_cast<int>(strlen(exec_path)) - 1; - while (path_separator >= 0 && - !base::OS::isDirectorySeparator(exec_path[path_separator])) { - path_separator--; - } - if (path_separator >= 0) { - int name_length = static_cast<int>(strlen(name)); - *buffer = - reinterpret_cast<char*>(calloc(path_separator + name_length + 2, 1)); - *buffer[0] = '\0'; - strncat(*buffer, exec_path, path_separator + 1); - strncat(*buffer, name, name_length); - } else { - *buffer = strdup(name); - } - return *buffer; -} - } // namespace #endif // V8_USE_EXTERNAL_STARTUP_DATA @@ -108,9 +87,7 @@ void InitializeExternalStartupData(const char* directory_path) { char* natives; char* snapshot; LoadFromFiles(RelativePath(&natives, directory_path, "natives_blob.bin"), - RelativePath(&snapshot, directory_path, - FLAG_ignition ? "snapshot_blob_ignition.bin" - : "snapshot_blob.bin")); + RelativePath(&snapshot, directory_path, "snapshot_blob.bin")); free(natives); free(snapshot); #endif // V8_USE_EXTERNAL_STARTUP_DATA |