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

Side by Side Diff: src/ia32/codegen-ia32.cc

Issue 1114001: Refactoring of RegExp interface to better support calling several times in a row. (Closed)
Patch Set: Fix type that snuck into the commit. Created 10 years, 9 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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 10530 matching lines...) Expand 10 before | Expand all | Expand 10 after
10541 // ecx: offsets vector 10541 // ecx: offsets vector
10542 // edx: number of capture registers 10542 // edx: number of capture registers
10543 Label next_capture, done; 10543 Label next_capture, done;
10544 __ mov(eax, Operand(esp, kPreviousIndexOffset)); 10544 __ mov(eax, Operand(esp, kPreviousIndexOffset));
10545 // Capture register counter starts from number of capture registers and 10545 // Capture register counter starts from number of capture registers and
10546 // counts down until wraping after zero. 10546 // counts down until wraping after zero.
10547 __ bind(&next_capture); 10547 __ bind(&next_capture);
10548 __ sub(Operand(edx), Immediate(1)); 10548 __ sub(Operand(edx), Immediate(1));
10549 __ j(negative, &done); 10549 __ j(negative, &done);
10550 // Read the value from the static offsets vector buffer. 10550 // Read the value from the static offsets vector buffer.
10551 __ mov(edi, Operand(ecx, edx, times_int_size, 0)); 10551 __ mov(edi, Operand(ecx, edx, times_int_size, 0));
Søren Thygesen Gjesse 2010/03/18 13:54:50 Drive by - you should probably remove the comment
Lasse Reichstein 2010/03/19 11:25:42 Done.
10552 // Perform explicit shift 10552 // Perform explicit shift
10553 ASSERT_EQ(0, kSmiTag); 10553 ASSERT_EQ(0, kSmiTag);
10554 __ shl(edi, kSmiTagSize); 10554 __ SmiTag(edi);
10555 // Add previous index (from its stack slot) if value is not negative.
10556 Label capture_negative;
10557 // Carry flag set by shift above.
10558 __ j(negative, &capture_negative, not_taken);
10559 __ add(edi, Operand(eax)); // Add previous index (adding smi to smi).
10560 __ bind(&capture_negative);
10561 // Store the smi value in the last match info. 10555 // Store the smi value in the last match info.
10562 __ mov(FieldOperand(ebx, 10556 __ mov(FieldOperand(ebx,
10563 edx, 10557 edx,
10564 times_pointer_size, 10558 times_pointer_size,
10565 RegExpImpl::kFirstCaptureOffset), 10559 RegExpImpl::kFirstCaptureOffset),
10566 edi); 10560 edi);
10567 __ jmp(&next_capture); 10561 __ jmp(&next_capture);
10568 __ bind(&done); 10562 __ bind(&done);
10569 10563
10570 // Return last match info. 10564 // Return last match info.
(...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after
12243 12237
12244 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) 12238 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
12245 // tagged as a small integer. 12239 // tagged as a small integer.
12246 __ bind(&runtime); 12240 __ bind(&runtime);
12247 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); 12241 __ TailCallRuntime(Runtime::kStringCompare, 2, 1);
12248 } 12242 }
12249 12243
12250 #undef __ 12244 #undef __
12251 12245
12252 } } // namespace v8::internal 12246 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698