Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(605)

Side by Side Diff: test/cctest/test-regexp.cc

Issue 1599303002: [regexp] implement case-insensitive unicode regexps. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@unicodeclass
Patch Set: fix mips Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 1179
1180 ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1, 1180 ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
1181 4); 1181 4);
1182 1182
1183 Label fail, succ; 1183 Label fail, succ;
1184 1184
1185 m.WriteCurrentPositionToRegister(0, 0); 1185 m.WriteCurrentPositionToRegister(0, 0);
1186 m.WriteCurrentPositionToRegister(2, 0); 1186 m.WriteCurrentPositionToRegister(2, 0);
1187 m.AdvanceCurrentPosition(3); 1187 m.AdvanceCurrentPosition(3);
1188 m.WriteCurrentPositionToRegister(3, 0); 1188 m.WriteCurrentPositionToRegister(3, 0);
1189 m.CheckNotBackReferenceIgnoreCase(2, false, &fail); // Match "AbC". 1189 m.CheckNotBackReferenceIgnoreCase(2, false, false, &fail); // Match "AbC".
1190 m.CheckNotBackReferenceIgnoreCase(2, false, &fail); // Match "ABC". 1190 m.CheckNotBackReferenceIgnoreCase(2, false, false, &fail); // Match "ABC".
1191 Label expected_fail; 1191 Label expected_fail;
1192 m.CheckNotBackReferenceIgnoreCase(2, false, &expected_fail); 1192 m.CheckNotBackReferenceIgnoreCase(2, false, false, &expected_fail);
1193 m.Bind(&fail); 1193 m.Bind(&fail);
1194 m.Fail(); 1194 m.Fail();
1195 1195
1196 m.Bind(&expected_fail); 1196 m.Bind(&expected_fail);
1197 m.AdvanceCurrentPosition(3); // Skip "xYz" 1197 m.AdvanceCurrentPosition(3); // Skip "xYz"
1198 m.CheckNotBackReferenceIgnoreCase(2, false, &succ); 1198 m.CheckNotBackReferenceIgnoreCase(2, false, false, &succ);
1199 m.Fail(); 1199 m.Fail();
1200 1200
1201 m.Bind(&succ); 1201 m.Bind(&succ);
1202 m.WriteCurrentPositionToRegister(1, 0); 1202 m.WriteCurrentPositionToRegister(1, 0);
1203 m.Succeed(); 1203 m.Succeed();
1204 1204
1205 Handle<String> source = 1205 Handle<String> source =
1206 factory->NewStringFromStaticChars("^(abc)\1\1(?!\1)...(?!\1)"); 1206 factory->NewStringFromStaticChars("^(abc)\1\1(?!\1)...(?!\1)");
1207 Handle<Object> code_object = m.GetCode(source); 1207 Handle<Object> code_object = m.GetCode(source);
1208 Handle<Code> code = Handle<Code>::cast(code_object); 1208 Handle<Code> code = Handle<Code>::cast(code_object);
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
1956 // .toString() throws on non-RegExps that aren't RegExp.prototype 1956 // .toString() throws on non-RegExps that aren't RegExp.prototype
1957 v8::Local<v8::Value> resultToStringError = CompileRun( 1957 v8::Local<v8::Value> resultToStringError = CompileRun(
1958 "var exception;" 1958 "var exception;"
1959 "try { RegExp.prototype.toString.call(null) }" 1959 "try { RegExp.prototype.toString.call(null) }"
1960 "catch (e) { exception = e; }" 1960 "catch (e) { exception = e; }"
1961 "exception"); 1961 "exception");
1962 CHECK_EQ(1, use_counts[v8::Isolate::kRegExpPrototypeStickyGetter]); 1962 CHECK_EQ(1, use_counts[v8::Isolate::kRegExpPrototypeStickyGetter]);
1963 CHECK_EQ(1, use_counts[v8::Isolate::kRegExpPrototypeToString]); 1963 CHECK_EQ(1, use_counts[v8::Isolate::kRegExpPrototypeToString]);
1964 CHECK(resultToStringError->IsObject()); 1964 CHECK(resultToStringError->IsObject());
1965 } 1965 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698