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

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

Issue 11759008: Introduce ENABLE_LATIN_1 compile flag (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix FilterASCII Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/ast.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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 if (cp_offset != 0) { 254 if (cp_offset != 0) {
255 int byte_offset = cp_offset * char_size(); 255 int byte_offset = cp_offset * char_size();
256 __ add(r0, r0, Operand(byte_offset)); 256 __ add(r0, r0, Operand(byte_offset));
257 } 257 }
258 258
259 // r0 : Address of characters to match against str. 259 // r0 : Address of characters to match against str.
260 int stored_high_byte = 0; 260 int stored_high_byte = 0;
261 for (int i = 0; i < str.length(); i++) { 261 for (int i = 0; i < str.length(); i++) {
262 if (mode_ == ASCII) { 262 if (mode_ == ASCII) {
263 __ ldrb(r1, MemOperand(r0, char_size(), PostIndex)); 263 __ ldrb(r1, MemOperand(r0, char_size(), PostIndex));
264 ASSERT(str[i] <= String::kMaxAsciiCharCode); 264 ASSERT(str[i] <= String::kMaxOneByteCharCode);
265 __ cmp(r1, Operand(str[i])); 265 __ cmp(r1, Operand(str[i]));
266 } else { 266 } else {
267 __ ldrh(r1, MemOperand(r0, char_size(), PostIndex)); 267 __ ldrh(r1, MemOperand(r0, char_size(), PostIndex));
268 uc16 match_char = str[i]; 268 uc16 match_char = str[i];
269 int match_high_byte = (match_char >> 8); 269 int match_high_byte = (match_char >> 8);
270 if (match_high_byte == 0) { 270 if (match_high_byte == 0) {
271 __ cmp(r1, Operand(str[i])); 271 __ cmp(r1, Operand(str[i]));
272 } else { 272 } else {
273 if (match_high_byte != stored_high_byte) { 273 if (match_high_byte != stored_high_byte) {
274 __ mov(r2, Operand(match_high_byte)); 274 __ mov(r2, Operand(match_high_byte));
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 __ sub(r0, current_character(), Operand(from)); 501 __ sub(r0, current_character(), Operand(from));
502 __ cmp(r0, Operand(to - from)); 502 __ cmp(r0, Operand(to - from));
503 BranchOrBacktrack(hi, on_not_in_range); // Unsigned higher condition. 503 BranchOrBacktrack(hi, on_not_in_range); // Unsigned higher condition.
504 } 504 }
505 505
506 506
507 void RegExpMacroAssemblerARM::CheckBitInTable( 507 void RegExpMacroAssemblerARM::CheckBitInTable(
508 Handle<ByteArray> table, 508 Handle<ByteArray> table,
509 Label* on_bit_set) { 509 Label* on_bit_set) {
510 __ mov(r0, Operand(table)); 510 __ mov(r0, Operand(table));
511 if (mode_ != ASCII || kTableMask != String::kMaxAsciiCharCode) { 511 if (mode_ != ASCII || kTableMask != String::kMaxOneByteCharCode) {
512 __ and_(r1, current_character(), Operand(kTableSize - 1)); 512 __ and_(r1, current_character(), Operand(kTableSize - 1));
513 __ add(r1, r1, Operand(ByteArray::kHeaderSize - kHeapObjectTag)); 513 __ add(r1, r1, Operand(ByteArray::kHeaderSize - kHeapObjectTag));
514 } else { 514 } else {
515 __ add(r1, 515 __ add(r1,
516 current_character(), 516 current_character(),
517 Operand(ByteArray::kHeaderSize - kHeapObjectTag)); 517 Operand(ByteArray::kHeaderSize - kHeapObjectTag));
518 } 518 }
519 __ ldrb(r0, MemOperand(r0, r1)); 519 __ ldrb(r0, MemOperand(r0, r1));
520 __ cmp(r0, Operand(0)); 520 __ cmp(r0, Operand(0));
521 BranchOrBacktrack(ne, on_bit_set); 521 BranchOrBacktrack(ne, on_bit_set);
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); 1411 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex));
1412 } 1412 }
1413 1413
1414 #undef __ 1414 #undef __
1415 1415
1416 #endif // V8_INTERPRETED_REGEXP 1416 #endif // V8_INTERPRETED_REGEXP
1417 1417
1418 }} // namespace v8::internal 1418 }} // namespace v8::internal
1419 1419
1420 #endif // V8_TARGET_ARCH_ARM 1420 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698