summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRefael Ackermann <refack@gmail.com>2019-03-31 11:53:24 -0400
committerRefael Ackermann <refack@gmail.com>2019-06-01 09:55:50 -0400
commita74c46bf4bcda5a3cc96d193c26e08cdae5593c5 (patch)
tree9dfaa0f107072d5d2588c3ddabdf171c5ebcb838
parent317b712a52e0bb855bd18670ea8efa6c32bae032 (diff)
downloadandroid-node-v8-a74c46bf4bcda5a3cc96d193c26e08cdae5593c5.tar.gz
android-node-v8-a74c46bf4bcda5a3cc96d193c26e08cdae5593c5.tar.bz2
android-node-v8-a74c46bf4bcda5a3cc96d193c26e08cdae5593c5.zip
deps: V8: fix filename manipulation for Windows
PR-URL: https://github.com/nodejs/node/pull/27375 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
-rw-r--r--common.gypi2
-rw-r--r--deps/v8/src/snapshot/embedded-file-writer.cc6
-rw-r--r--deps/v8/src/torque/csa-generator.cc6
3 files changed, 11 insertions, 3 deletions
diff --git a/common.gypi b/common.gypi
index 5e57bf5d42..72eb613dc0 100644
--- a/common.gypi
+++ b/common.gypi
@@ -38,7 +38,7 @@
# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
- 'v8_embedder_string': '-node.0',
+ 'v8_embedder_string': '-node.1',
##### V8 defaults for Node.js #####
diff --git a/deps/v8/src/snapshot/embedded-file-writer.cc b/deps/v8/src/snapshot/embedded-file-writer.cc
index 191ebf7b7c..3ead35bd9a 100644
--- a/deps/v8/src/snapshot/embedded-file-writer.cc
+++ b/deps/v8/src/snapshot/embedded-file-writer.cc
@@ -819,7 +819,11 @@ void PlatformDependentEmbeddedFileWriter::DeclareExternalFilename(
// Replace any Windows style paths (backslashes) with forward
// slashes.
std::string fixed_filename(filename);
- std::replace(fixed_filename.begin(), fixed_filename.end(), '\\', '/');
+ for (auto& c : fixed_filename) {
+ if (c == '\\') {
+ c = '/';
+ }
+ }
fprintf(fp_, ".file %d \"%s\"\n", fileid, fixed_filename.c_str());
}
diff --git a/deps/v8/src/torque/csa-generator.cc b/deps/v8/src/torque/csa-generator.cc
index dae517f401..cdbcc64b01 100644
--- a/deps/v8/src/torque/csa-generator.cc
+++ b/deps/v8/src/torque/csa-generator.cc
@@ -56,10 +56,14 @@ Stack<std::string> CSAGenerator::EmitBlock(const Block* block) {
}
void CSAGenerator::EmitSourcePosition(SourcePosition pos, bool always_emit) {
- const std::string& file = SourceFileMap::GetSource(pos.source);
+ std::string file = SourceFileMap::GetSource(pos.source);
if (always_emit || !previous_position_.CompareStartIgnoreColumn(pos)) {
// Lines in Torque SourcePositions are zero-based, while the
// CodeStubAssembler and downwind systems are one-based.
+ for (auto& c : file) {
+ if (c == '\\')
+ c = '/';
+ }
out_ << " ca_.SetSourcePosition(\"" << file << "\", "
<< (pos.start.line + 1) << ");\n";
previous_position_ = pos;