Avoid using "<<<<" for better merge conflict grep support

Change-Id: Ie5d8ec9030df9f838522b4531205e71394a988da
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3263884
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77737}
This commit is contained in:
Camillo Bruni 2021-11-05 16:40:22 +01:00 committed by V8 LUCI CQ
parent 0599776f95
commit 1fa34d14b8
2 changed files with 33 additions and 19 deletions

View File

@ -183,7 +183,7 @@ void ShiftModFn(digit_t* result, const digit_t* input, int power_of_two, int K,
// The modulo-reduction amounts to a subtraction, which we combine
// with the shift as follows:
// input = [ iK ][iK-1] .... .... [ i1 ][ i0 ]
// result = [iX-1] .... [ i0 ] <<<<<<<<<<< shift by {power_of_two}
// result = [iX-1] .... [ i0 ] <---------- shift by {power_of_two}
// - [ iK ] .... [ iX ]
// where "X" is the index "K - digit_shift".
int digit_shift = power_of_two / kDigitBits;

View File

@ -25,6 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --allow-natives-syntax
/**
* @fileoverview Check that the global escape and unescape functions work
* right.
@ -70,9 +72,16 @@ example = example + String.fromCharCode(267, 0x1234, 0x6667, 0xabcd);
example = example + " The quick brown fox jumps over the lazy dog."
example = example + String.fromCharCode(171, 172, 173, 174, 175, 176, 178, 179);
for (var i = 0; i < 3000; i++) {
function testRoundTrip() {
assertEquals(example, unescape(escape(example)));
}
%PrepareFunctionForOptimization(testRoundTrip);
for (var i = 0; i < 3; i++) {
testRoundTrip();
};
%OptimizeFunctionOnNextCall(testRoundTrip);
testRoundTrip();
// Check unescape can cope with upper and lower case
assertEquals(unescape("%41%4A%4a"), "AJJ");
@ -92,27 +101,32 @@ assertEquals("%uzzzz", unescape("%uzzzz"));
assertEquals("%u4zzz", unescape("%u4zzz"));
assertEquals("%u44zz", unescape("%u44zz"));
assertEquals("%u444z", unescape("%u444z"));
assertEquals("%4<", unescape("%4<"));
assertEquals("%u<<<<", unescape("%u<<<<"));
assertEquals("%u4<<<", unescape("%u4<<<"));
assertEquals("%u44<<", unescape("%u44<<"));
assertEquals("%u444<", unescape("%u444<"));
assertEquals("foo%4<", unescape("foo%4<"));
assertEquals("foo%u<<<<", unescape("foo%u<<<<"));
assertEquals("foo%u4<<<", unescape("foo%u4<<<"));
assertEquals("foo%u44<<", unescape("foo%u44<<"));
assertEquals("foo%u444<", unescape("foo%u444<"));
assertEquals("foo%4<bar", unescape("foo%4<bar"));
assertEquals("foo%u<<<<bar", unescape("foo%u<<<<bar"));
assertEquals("foo%u4<<<bar", unescape("foo%u4<<<bar"));
assertEquals("foo%u44<<bar", unescape("foo%u44<<bar"));
assertEquals("foo%u444<bar", unescape("foo%u444<bar"));
assertEquals("%4+", unescape("%4+"));
assertEquals("%u++++", unescape("%u++++"));
assertEquals("%u4+++", unescape("%u4+++"));
assertEquals("%u44++", unescape("%u44++"));
assertEquals("%u444+", unescape("%u444+"));
assertEquals("foo%4+", unescape("foo%4+"));
assertEquals("foo%u++++", unescape("foo%u++++"));
assertEquals("foo%u4+++", unescape("foo%u4+++"));
assertEquals("foo%u44++", unescape("foo%u44++"));
assertEquals("foo%u444+", unescape("foo%u444+"));
assertEquals("foo%4+bar", unescape("foo%4+bar"));
assertEquals("foo%u++++bar", unescape("foo%u++++bar"));
assertEquals("foo%u4+++bar", unescape("foo%u4+++bar"));
assertEquals("foo%u44++bar", unescape("foo%u44++bar"));
assertEquals("foo%u444+bar", unescape("foo%u444+bar"));
assertEquals("% ", unescape("%%20"));
assertEquals("%% ", unescape("%%%20"));
// Unescape stress
var eexample = escape(example);
for (var i = 1; i < 3000; i++) {
function stressTestUnescape() {
assertEquals(example, unescape(eexample));
}
%PrepareFunctionForOptimization(stressTestUnescape);
for (var i = 0; i < 3; i++) {
stressTestUnescape();
}
%OptimizeFunctionOnNextCall(stressTestUnescape);
stressTestUnescape();