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

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

Issue 297303004: Revert 21502 - "Move OS::MemCopy and OS::MemMove out of platform to utils" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-heap-profiler.cc ('k') | test/cctest/test-utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 { 77 {
78 i::Utf8ToUtf16CharacterStream stream(keyword, length - 1); 78 i::Utf8ToUtf16CharacterStream stream(keyword, length - 1);
79 i::Scanner scanner(&unicode_cache); 79 i::Scanner scanner(&unicode_cache);
80 scanner.Initialize(&stream); 80 scanner.Initialize(&stream);
81 CHECK_EQ(i::Token::IDENTIFIER, scanner.Next()); 81 CHECK_EQ(i::Token::IDENTIFIER, scanner.Next());
82 CHECK_EQ(i::Token::EOS, scanner.Next()); 82 CHECK_EQ(i::Token::EOS, scanner.Next());
83 } 83 }
84 // Adding characters will make keyword matching fail. 84 // Adding characters will make keyword matching fail.
85 static const char chars_to_append[] = { 'z', '0', '_' }; 85 static const char chars_to_append[] = { 'z', '0', '_' };
86 for (int j = 0; j < static_cast<int>(ARRAY_SIZE(chars_to_append)); ++j) { 86 for (int j = 0; j < static_cast<int>(ARRAY_SIZE(chars_to_append)); ++j) {
87 i::MemMove(buffer, keyword, length); 87 i::OS::MemMove(buffer, keyword, length);
88 buffer[length] = chars_to_append[j]; 88 buffer[length] = chars_to_append[j];
89 i::Utf8ToUtf16CharacterStream stream(buffer, length + 1); 89 i::Utf8ToUtf16CharacterStream stream(buffer, length + 1);
90 i::Scanner scanner(&unicode_cache); 90 i::Scanner scanner(&unicode_cache);
91 scanner.Initialize(&stream); 91 scanner.Initialize(&stream);
92 CHECK_EQ(i::Token::IDENTIFIER, scanner.Next()); 92 CHECK_EQ(i::Token::IDENTIFIER, scanner.Next());
93 CHECK_EQ(i::Token::EOS, scanner.Next()); 93 CHECK_EQ(i::Token::EOS, scanner.Next());
94 } 94 }
95 // Replacing characters will make keyword matching fail. 95 // Replacing characters will make keyword matching fail.
96 { 96 {
97 i::MemMove(buffer, keyword, length); 97 i::OS::MemMove(buffer, keyword, length);
98 buffer[length - 1] = '_'; 98 buffer[length - 1] = '_';
99 i::Utf8ToUtf16CharacterStream stream(buffer, length); 99 i::Utf8ToUtf16CharacterStream stream(buffer, length);
100 i::Scanner scanner(&unicode_cache); 100 i::Scanner scanner(&unicode_cache);
101 scanner.Initialize(&stream); 101 scanner.Initialize(&stream);
102 CHECK_EQ(i::Token::IDENTIFIER, scanner.Next()); 102 CHECK_EQ(i::Token::IDENTIFIER, scanner.Next());
103 CHECK_EQ(i::Token::EOS, scanner.Next()); 103 CHECK_EQ(i::Token::EOS, scanner.Next());
104 } 104 }
105 } 105 }
106 } 106 }
107 107
(...skipping 2342 matching lines...) Expand 10 before | Expand all | Expand 10 after
2450 RunParserSyncTest(assignment_context_data, bad_statement_data_common, kError); 2450 RunParserSyncTest(assignment_context_data, bad_statement_data_common, kError);
2451 RunParserSyncTest(assignment_context_data, bad_statement_data_for_assignment, 2451 RunParserSyncTest(assignment_context_data, bad_statement_data_for_assignment,
2452 kError); 2452 kError);
2453 2453
2454 RunParserSyncTest(prefix_context_data, good_statement_data, kSuccess); 2454 RunParserSyncTest(prefix_context_data, good_statement_data, kSuccess);
2455 RunParserSyncTest(prefix_context_data, bad_statement_data_common, kError); 2455 RunParserSyncTest(prefix_context_data, bad_statement_data_common, kError);
2456 2456
2457 RunParserSyncTest(postfix_context_data, good_statement_data, kSuccess); 2457 RunParserSyncTest(postfix_context_data, good_statement_data, kSuccess);
2458 RunParserSyncTest(postfix_context_data, bad_statement_data_common, kError); 2458 RunParserSyncTest(postfix_context_data, bad_statement_data_common, kError);
2459 } 2459 }
OLDNEW
« no previous file with comments | « test/cctest/test-heap-profiler.cc ('k') | test/cctest/test-utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698