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

Side by Side Diff: src/mips/regexp-macro-assembler-mips.cc

Issue 11308066: Rename IsAsciiRepresentation (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/log-utils.cc ('k') | src/objects.h » ('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 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 if (frame_entry<int>(re_frame, kDirectCall) == 1) { 1148 if (frame_entry<int>(re_frame, kDirectCall) == 1) {
1149 return RETRY; 1149 return RETRY;
1150 } 1150 }
1151 1151
1152 // Prepare for possible GC. 1152 // Prepare for possible GC.
1153 HandleScope handles(isolate); 1153 HandleScope handles(isolate);
1154 Handle<Code> code_handle(re_code); 1154 Handle<Code> code_handle(re_code);
1155 1155
1156 Handle<String> subject(frame_entry<String*>(re_frame, kInputString)); 1156 Handle<String> subject(frame_entry<String*>(re_frame, kInputString));
1157 // Current string. 1157 // Current string.
1158 bool is_ascii = subject->IsAsciiRepresentationUnderneath(); 1158 bool is_ascii = subject->IsOneByteRepresentationUnderneath();
1159 1159
1160 ASSERT(re_code->instruction_start() <= *return_address); 1160 ASSERT(re_code->instruction_start() <= *return_address);
1161 ASSERT(*return_address <= 1161 ASSERT(*return_address <=
1162 re_code->instruction_start() + re_code->instruction_size()); 1162 re_code->instruction_start() + re_code->instruction_size());
1163 1163
1164 MaybeObject* result = Execution::HandleStackGuardInterrupt(isolate); 1164 MaybeObject* result = Execution::HandleStackGuardInterrupt(isolate);
1165 1165
1166 if (*code_handle != re_code) { // Return address no longer valid. 1166 if (*code_handle != re_code) { // Return address no longer valid.
1167 int delta = code_handle->address() - re_code->address(); 1167 int delta = code_handle->address() - re_code->address();
1168 // Overwrite the return address on the stack. 1168 // Overwrite the return address on the stack.
(...skipping 10 matching lines...) Expand all
1179 // Extract the underlying string and the slice offset. 1179 // Extract the underlying string and the slice offset.
1180 if (StringShape(*subject_tmp).IsCons()) { 1180 if (StringShape(*subject_tmp).IsCons()) {
1181 subject_tmp = Handle<String>(ConsString::cast(*subject_tmp)->first()); 1181 subject_tmp = Handle<String>(ConsString::cast(*subject_tmp)->first());
1182 } else if (StringShape(*subject_tmp).IsSliced()) { 1182 } else if (StringShape(*subject_tmp).IsSliced()) {
1183 SlicedString* slice = SlicedString::cast(*subject_tmp); 1183 SlicedString* slice = SlicedString::cast(*subject_tmp);
1184 subject_tmp = Handle<String>(slice->parent()); 1184 subject_tmp = Handle<String>(slice->parent());
1185 slice_offset = slice->offset(); 1185 slice_offset = slice->offset();
1186 } 1186 }
1187 1187
1188 // String might have changed. 1188 // String might have changed.
1189 if (subject_tmp->IsAsciiRepresentation() != is_ascii) { 1189 if (subject_tmp->IsOneByteRepresentation() != is_ascii) {
1190 // If we changed between an ASCII and an UC16 string, the specialized 1190 // If we changed between an ASCII and an UC16 string, the specialized
1191 // code cannot be used, and we need to restart regexp matching from 1191 // code cannot be used, and we need to restart regexp matching from
1192 // scratch (including, potentially, compiling a new version of the code). 1192 // scratch (including, potentially, compiling a new version of the code).
1193 return RETRY; 1193 return RETRY;
1194 } 1194 }
1195 1195
1196 // Otherwise, the content of the string might have moved. It must still 1196 // Otherwise, the content of the string might have moved. It must still
1197 // be a sequential or external string with the same content. 1197 // be a sequential or external string with the same content.
1198 // Update the start and end pointers in the stack frame to the current 1198 // Update the start and end pointers in the stack frame to the current
1199 // location (whether it has actually moved or not). 1199 // location (whether it has actually moved or not).
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 } 1378 }
1379 1379
1380 1380
1381 #undef __ 1381 #undef __
1382 1382
1383 #endif // V8_INTERPRETED_REGEXP 1383 #endif // V8_INTERPRETED_REGEXP
1384 1384
1385 }} // namespace v8::internal 1385 }} // namespace v8::internal
1386 1386
1387 #endif // V8_TARGET_ARCH_MIPS 1387 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/log-utils.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698