Index: src/builtins/builtins-string.cc |
diff --git a/src/builtins/builtins-string.cc b/src/builtins/builtins-string.cc |
index 6b14e2510b773ea5f5004334041e174b043e3846..49fc6c28070186b6d713fd22aab4b147aa0943ab 100644 |
--- a/src/builtins/builtins-string.cc |
+++ b/src/builtins/builtins-string.cc |
@@ -1380,7 +1380,12 @@ compiler::Node* LoadSurrogatePairInternal(CodeStubAssembler* assembler, |
switch (encoding) { |
case UnicodeEncoding::UTF16: |
var_result.Bind(assembler->WordOr( |
+// Need to swap the order for big-endian platforms |
+#if V8_TARGET_BIG_ENDIAN |
+ assembler->WordShl(lead, assembler->Int32Constant(16)), trail)); |
+#else |
assembler->WordShl(trail, assembler->Int32Constant(16)), lead)); |
+#endif |
break; |
case UnicodeEncoding::UTF32: { |