OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/builtins/builtins.h" | 5 #include "src/builtins/builtins.h" |
6 #include "src/builtins/builtins-utils.h" | 6 #include "src/builtins/builtins-utils.h" |
7 | 7 |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/regexp/regexp-utils.h" | 9 #include "src/regexp/regexp-utils.h" |
10 | 10 |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 } | 594 } |
595 | 595 |
596 if (index == length) { | 596 if (index == length) { |
597 RETURN_RESULT_OR_FAILURE(isolate, isolate->factory()->NewStringFromOneByte( | 597 RETURN_RESULT_OR_FAILURE(isolate, isolate->factory()->NewStringFromOneByte( |
598 one_byte_buffer.ToConstVector())); | 598 one_byte_buffer.ToConstVector())); |
599 } | 599 } |
600 | 600 |
601 List<uc16> two_byte_buffer(length - index); | 601 List<uc16> two_byte_buffer(length - index); |
602 | 602 |
603 while (true) { | 603 while (true) { |
604 if (code <= unibrow::Utf16::kMaxNonSurrogateCharCode) { | 604 if (code <= static_cast<uc32>(unibrow::Utf16::kMaxNonSurrogateCharCode)) { |
605 two_byte_buffer.Add(code); | 605 two_byte_buffer.Add(code); |
606 } else { | 606 } else { |
607 two_byte_buffer.Add(unibrow::Utf16::LeadSurrogate(code)); | 607 two_byte_buffer.Add(unibrow::Utf16::LeadSurrogate(code)); |
608 two_byte_buffer.Add(unibrow::Utf16::TrailSurrogate(code)); | 608 two_byte_buffer.Add(unibrow::Utf16::TrailSurrogate(code)); |
609 } | 609 } |
610 | 610 |
611 if (++index == length) { | 611 if (++index == length) { |
612 break; | 612 break; |
613 } | 613 } |
614 code = NextCodePoint(isolate, args, index); | 614 code = NextCodePoint(isolate, args, index); |
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1427 Runtime::kThrowIncompatibleMethodReceiver, context, | 1427 Runtime::kThrowIncompatibleMethodReceiver, context, |
1428 assembler->HeapConstant(assembler->factory()->NewStringFromAsciiChecked( | 1428 assembler->HeapConstant(assembler->factory()->NewStringFromAsciiChecked( |
1429 "String Iterator.prototype.next", TENURED)), | 1429 "String Iterator.prototype.next", TENURED)), |
1430 iterator); | 1430 iterator); |
1431 assembler->Return(result); // Never reached. | 1431 assembler->Return(result); // Never reached. |
1432 } | 1432 } |
1433 } | 1433 } |
1434 | 1434 |
1435 } // namespace internal | 1435 } // namespace internal |
1436 } // namespace v8 | 1436 } // namespace v8 |
OLD | NEW |