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

Unified Diff: test/cctest/interpreter/test-bytecode-generator.cc

Issue 1472323002: [es6] Correct parsing of regular expression literal flags. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix oversight in interpreter Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/scanner.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/interpreter/test-bytecode-generator.cc
diff --git a/test/cctest/interpreter/test-bytecode-generator.cc b/test/cctest/interpreter/test-bytecode-generator.cc
index d5d71c8b7b6a52a0583bba8fe26295588d720692..b942c6a76d2aceefa741f8a1035b68b89c76b5ea 100644
--- a/test/cctest/interpreter/test-bytecode-generator.cc
+++ b/test/cctest/interpreter/test-bytecode-generator.cc
@@ -2853,56 +2853,51 @@ TEST(RegExpLiterals) {
FeedbackVectorSpec feedback_spec(&zone);
FeedbackVectorSlot slot1 = feedback_spec.AddCallICSlot();
FeedbackVectorSlot slot2 = feedback_spec.AddLoadICSlot();
+ uint8_t i_flags = JSRegExp::kIgnoreCase;
Handle<i::TypeFeedbackVector> vector =
i::NewTypeFeedbackVector(helper.isolate(), &feedback_spec);
ExpectedSnippet<const char*> snippets[] = {
{"return /ab+d/;",
- 1 * kPointerSize,
+ 0 * kPointerSize,
1,
- 10,
+ 6,
{
- B(LdaConstant), U8(0), //
- B(Star), R(0), //
- B(LdaConstant), U8(1), //
- B(CreateRegExpLiteral), U8(0), R(0), //
- B(Return), //
+ B(LdaConstant), U8(0), //
+ B(CreateRegExpLiteral), U8(0), U8(0), //
+ B(Return), //
},
- 2,
- {"", "ab+d"}},
+ 1,
+ {"ab+d"}},
{"return /(\\w+)\\s(\\w+)/i;",
- 1 * kPointerSize,
+ 0 * kPointerSize,
1,
- 10,
+ 6,
{
- B(LdaConstant), U8(0), //
- B(Star), R(0), //
- B(LdaConstant), U8(1), //
- B(CreateRegExpLiteral), U8(0), R(0), //
- B(Return), //
+ B(LdaConstant), U8(0), //
+ B(CreateRegExpLiteral), U8(0), U8(i_flags), //
+ B(Return), //
},
- 2,
- {"i", "(\\w+)\\s(\\w+)"}},
+ 1,
+ {"(\\w+)\\s(\\w+)"}},
{"return /ab+d/.exec('abdd');",
3 * kPointerSize,
1,
- 27,
+ 23,
{
B(LdaConstant), U8(0), //
- B(Star), R(2), //
- B(LdaConstant), U8(1), //
- B(CreateRegExpLiteral), U8(0), R(2), //
+ B(CreateRegExpLiteral), U8(0), U8(0), //
B(Star), R(1), //
- B(LoadICSloppy), R(1), U8(2), U8(vector->GetIndex(slot2)), //
+ B(LoadICSloppy), R(1), U8(1), U8(vector->GetIndex(slot2)), //
B(Star), R(0), //
- B(LdaConstant), U8(3), //
+ B(LdaConstant), U8(2), //
B(Star), R(2), //
B(Call), R(0), R(1), U8(1), U8(vector->GetIndex(slot1)), //
B(Return), //
},
- 4,
- {"", "ab+d", "exec", "abdd"}},
+ 3,
+ {"ab+d", "exec", "abdd"}},
};
for (size_t i = 0; i < arraysize(snippets); i++) {
« no previous file with comments | « src/scanner.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698