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

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

Issue 6794050: Revert "[Arguments] Merge (7442,7496] from bleeding_edge." (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/arguments
Patch Set: Created 9 years, 8 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/macro-assembler-arm.cc ('k') | src/arm/stub-cache-arm.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 * area is overwritten with the LR register by the RegExp code. When doing a 109 * area is overwritten with the LR register by the RegExp code. When doing a
110 * direct call from generated code, the return address is placed there by 110 * direct call from generated code, the return address is placed there by
111 * the calling code, as in a normal exit frame. 111 * the calling code, as in a normal exit frame.
112 */ 112 */
113 113
114 #define __ ACCESS_MASM(masm_) 114 #define __ ACCESS_MASM(masm_)
115 115
116 RegExpMacroAssemblerARM::RegExpMacroAssemblerARM( 116 RegExpMacroAssemblerARM::RegExpMacroAssemblerARM(
117 Mode mode, 117 Mode mode,
118 int registers_to_save) 118 int registers_to_save)
119 : masm_(new MacroAssembler(Isolate::Current(), NULL, kRegExpCodeSize)), 119 : masm_(new MacroAssembler(NULL, kRegExpCodeSize)),
120 mode_(mode), 120 mode_(mode),
121 num_registers_(registers_to_save), 121 num_registers_(registers_to_save),
122 num_saved_registers_(registers_to_save), 122 num_saved_registers_(registers_to_save),
123 entry_label_(), 123 entry_label_(),
124 start_label_(), 124 start_label_(),
125 success_label_(), 125 success_label_(),
126 backtrack_label_(), 126 backtrack_label_(),
127 exit_label_() { 127 exit_label_() {
128 ASSERT_EQ(0, registers_to_save % 2); 128 ASSERT_EQ(0, registers_to_save % 2);
129 __ jmp(&entry_label_); // We'll write the entry code later. 129 __ jmp(&entry_label_); // We'll write the entry code later.
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 __ jmp(&success); 340 __ jmp(&success);
341 341
342 __ bind(&fail); 342 __ bind(&fail);
343 BranchOrBacktrack(al, on_no_match); 343 BranchOrBacktrack(al, on_no_match);
344 344
345 __ bind(&success); 345 __ bind(&success);
346 // Compute new value of character position after the matched part. 346 // Compute new value of character position after the matched part.
347 __ sub(current_input_offset(), r2, end_of_input_address()); 347 __ sub(current_input_offset(), r2, end_of_input_address());
348 } else { 348 } else {
349 ASSERT(mode_ == UC16); 349 ASSERT(mode_ == UC16);
350 int argument_count = 4; 350 int argument_count = 3;
351 __ PrepareCallCFunction(argument_count, r2); 351 __ PrepareCallCFunction(argument_count, r2);
352 352
353 // r0 - offset of start of capture 353 // r0 - offset of start of capture
354 // r1 - length of capture 354 // r1 - length of capture
355 355
356 // Put arguments into arguments registers. 356 // Put arguments into arguments registers.
357 // Parameters are 357 // Parameters are
358 // r0: Address byte_offset1 - Address captured substring's start. 358 // r0: Address byte_offset1 - Address captured substring's start.
359 // r1: Address byte_offset2 - Address of current character position. 359 // r1: Address byte_offset2 - Address of current character position.
360 // r2: size_t byte_length - length of capture in bytes(!) 360 // r2: size_t byte_length - length of capture in bytes(!)
361 // r3: Isolate* isolate
362 361
363 // Address of start of capture. 362 // Address of start of capture.
364 __ add(r0, r0, Operand(end_of_input_address())); 363 __ add(r0, r0, Operand(end_of_input_address()));
365 // Length of capture. 364 // Length of capture.
366 __ mov(r2, Operand(r1)); 365 __ mov(r2, Operand(r1));
367 // Save length in callee-save register for use on return. 366 // Save length in callee-save register for use on return.
368 __ mov(r4, Operand(r1)); 367 __ mov(r4, Operand(r1));
369 // Address of current input position. 368 // Address of current input position.
370 __ add(r1, current_input_offset(), Operand(end_of_input_address())); 369 __ add(r1, current_input_offset(), Operand(end_of_input_address()));
371 // Isolate.
372 __ mov(r3, Operand(ExternalReference::isolate_address()));
373 370
374 ExternalReference function = 371 ExternalReference function =
375 ExternalReference::re_case_insensitive_compare_uc16(masm_->isolate()); 372 ExternalReference::re_case_insensitive_compare_uc16(masm_->isolate());
376 __ CallCFunction(function, argument_count); 373 __ CallCFunction(function, argument_count);
377 374
378 // Check if function returned non-zero for success or zero for failure. 375 // Check if function returned non-zero for success or zero for failure.
379 __ cmp(r0, Operand(0, RelocInfo::NONE)); 376 __ cmp(r0, Operand(0, RelocInfo::NONE));
380 BranchOrBacktrack(eq, on_no_match); 377 BranchOrBacktrack(eq, on_no_match);
381 // On success, increment position by length of capture. 378 // On success, increment position by length of capture.
382 __ add(current_input_offset(), current_input_offset(), Operand(r4)); 379 __ add(current_input_offset(), current_input_offset(), Operand(r4));
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 SafeReturn(); 771 SafeReturn();
775 } 772 }
776 773
777 // Backtrack stack overflow code. 774 // Backtrack stack overflow code.
778 if (stack_overflow_label_.is_linked()) { 775 if (stack_overflow_label_.is_linked()) {
779 SafeCallTarget(&stack_overflow_label_); 776 SafeCallTarget(&stack_overflow_label_);
780 // Reached if the backtrack-stack limit has been hit. 777 // Reached if the backtrack-stack limit has been hit.
781 Label grow_failed; 778 Label grow_failed;
782 779
783 // Call GrowStack(backtrack_stackpointer(), &stack_base) 780 // Call GrowStack(backtrack_stackpointer(), &stack_base)
784 static const int num_arguments = 3; 781 static const int num_arguments = 2;
785 __ PrepareCallCFunction(num_arguments, r0); 782 __ PrepareCallCFunction(num_arguments, r0);
786 __ mov(r0, backtrack_stackpointer()); 783 __ mov(r0, backtrack_stackpointer());
787 __ add(r1, frame_pointer(), Operand(kStackHighEnd)); 784 __ add(r1, frame_pointer(), Operand(kStackHighEnd));
788 __ mov(r2, Operand(ExternalReference::isolate_address()));
789 ExternalReference grow_stack = 785 ExternalReference grow_stack =
790 ExternalReference::re_grow_stack(masm_->isolate()); 786 ExternalReference::re_grow_stack(masm_->isolate());
791 __ CallCFunction(grow_stack, num_arguments); 787 __ CallCFunction(grow_stack, num_arguments);
792 // If return NULL, we have failed to grow the stack, and 788 // If return NULL, we have failed to grow the stack, and
793 // must exit with a stack-overflow exception. 789 // must exit with a stack-overflow exception.
794 __ cmp(r0, Operand(0, RelocInfo::NONE)); 790 __ cmp(r0, Operand(0, RelocInfo::NONE));
795 __ b(eq, &exit_with_exception); 791 __ b(eq, &exit_with_exception);
796 // Otherwise use return value as new stack pointer. 792 // Otherwise use return value as new stack pointer.
797 __ mov(backtrack_stackpointer(), r0); 793 __ mov(backtrack_stackpointer(), r0);
798 // Restore saved registers and continue. 794 // Restore saved registers and continue.
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1278 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); 1274 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex));
1279 } 1275 }
1280 1276
1281 #undef __ 1277 #undef __
1282 1278
1283 #endif // V8_INTERPRETED_REGEXP 1279 #endif // V8_INTERPRETED_REGEXP
1284 1280
1285 }} // namespace v8::internal 1281 }} // namespace v8::internal
1286 1282
1287 #endif // V8_TARGET_ARCH_ARM 1283 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/arm/stub-cache-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698