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

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

Issue 8139027: Version 3.6.5 (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: '' Created 9 years, 2 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/mips/macro-assembler-mips.cc ('k') | src/mips/stub-cache-mips.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 2006-2010 the V8 project authors. All rights reserved. 1 // Copyright 2006-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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 __ Addu(a0, a0, Operand(end_of_input_address())); 370 __ Addu(a0, a0, Operand(end_of_input_address()));
371 // Length of capture. 371 // Length of capture.
372 __ mov(a2, a1); 372 __ mov(a2, a1);
373 // Save length in callee-save register for use on return. 373 // Save length in callee-save register for use on return.
374 __ mov(s3, a1); 374 __ mov(s3, a1);
375 // Address of current input position. 375 // Address of current input position.
376 __ Addu(a1, current_input_offset(), Operand(end_of_input_address())); 376 __ Addu(a1, current_input_offset(), Operand(end_of_input_address()));
377 // Isolate. 377 // Isolate.
378 __ li(a3, Operand(ExternalReference::isolate_address())); 378 __ li(a3, Operand(ExternalReference::isolate_address()));
379 379
380 ExternalReference function = 380 {
381 ExternalReference::re_case_insensitive_compare_uc16(masm_->isolate()); 381 AllowExternalCallThatCantCauseGC scope(masm_);
382 __ CallCFunction(function, argument_count); 382 ExternalReference function =
383 ExternalReference::re_case_insensitive_compare_uc16(masm_->isolate());
384 __ CallCFunction(function, argument_count);
385 }
383 386
384 // Restore regexp engine registers. 387 // Restore regexp engine registers.
385 __ MultiPop(regexp_registers_to_retain); 388 __ MultiPop(regexp_registers_to_retain);
386 __ li(code_pointer(), Operand(masm_->CodeObject())); 389 __ li(code_pointer(), Operand(masm_->CodeObject()));
387 __ lw(end_of_input_address(), MemOperand(frame_pointer(), kInputEnd)); 390 __ lw(end_of_input_address(), MemOperand(frame_pointer(), kInputEnd));
388 391
389 // Check if function returned non-zero for success or zero for failure. 392 // Check if function returned non-zero for success or zero for failure.
390 BranchOrBacktrack(on_no_match, eq, v0, Operand(zero_reg)); 393 BranchOrBacktrack(on_no_match, eq, v0, Operand(zero_reg));
391 // On success, increment position by length of capture. 394 // On success, increment position by length of capture.
392 __ Addu(current_input_offset(), current_input_offset(), Operand(s3)); 395 __ Addu(current_input_offset(), current_input_offset(), Operand(s3));
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 // If the code gets corrupted due to long regular expressions and lack of 603 // If the code gets corrupted due to long regular expressions and lack of
601 // space on trampolines, an internal exception flag is set. If this case 604 // space on trampolines, an internal exception flag is set. If this case
602 // is detected, we will jump into exit sequence right away. 605 // is detected, we will jump into exit sequence right away.
603 __ bind_to(&entry_label_, internal_failure_label_.pos()); 606 __ bind_to(&entry_label_, internal_failure_label_.pos());
604 } else { 607 } else {
605 // Finalize code - write the entry point code now we know how many 608 // Finalize code - write the entry point code now we know how many
606 // registers we need. 609 // registers we need.
607 610
608 // Entry code: 611 // Entry code:
609 __ bind(&entry_label_); 612 __ bind(&entry_label_);
613
614 // Tell the system that we have a stack frame. Because the type is MANUAL,
615 // no is generated.
616 FrameScope scope(masm_, StackFrame::MANUAL);
617
618 // Actually emit code to start a new stack frame.
610 // Push arguments 619 // Push arguments
611 // Save callee-save registers. 620 // Save callee-save registers.
612 // Start new stack frame. 621 // Start new stack frame.
613 // Store link register in existing stack-cell. 622 // Store link register in existing stack-cell.
614 // Order here should correspond to order of offset constants in header file. 623 // Order here should correspond to order of offset constants in header file.
615 RegList registers_to_retain = s0.bit() | s1.bit() | s2.bit() | 624 RegList registers_to_retain = s0.bit() | s1.bit() | s2.bit() |
616 s3.bit() | s4.bit() | s5.bit() | s6.bit() | s7.bit() | fp.bit(); 625 s3.bit() | s4.bit() | s5.bit() | s6.bit() | s7.bit() | fp.bit();
617 RegList argument_registers = a0.bit() | a1.bit() | a2.bit() | a3.bit(); 626 RegList argument_registers = a0.bit() | a1.bit() | a2.bit() | a3.bit();
618 __ MultiPush(argument_registers | registers_to_retain | ra.bit()); 627 __ MultiPush(argument_registers | registers_to_retain | ra.bit());
619 // Set frame pointer in space for it if this is not a direct call 628 // Set frame pointer in space for it if this is not a direct call
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 __ lhu(current_character(), MemOperand(t5, 0)); 1246 __ lhu(current_character(), MemOperand(t5, 0));
1238 } 1247 }
1239 } 1248 }
1240 1249
1241 1250
1242 void RegExpCEntryStub::Generate(MacroAssembler* masm_) { 1251 void RegExpCEntryStub::Generate(MacroAssembler* masm_) {
1243 int stack_alignment = OS::ActivationFrameAlignment(); 1252 int stack_alignment = OS::ActivationFrameAlignment();
1244 if (stack_alignment < kPointerSize) stack_alignment = kPointerSize; 1253 if (stack_alignment < kPointerSize) stack_alignment = kPointerSize;
1245 // Stack is already aligned for call, so decrement by alignment 1254 // Stack is already aligned for call, so decrement by alignment
1246 // to make room for storing the return address. 1255 // to make room for storing the return address.
1247 __ Subu(sp, sp, Operand(stack_alignment)); 1256 __ Subu(sp, sp, Operand(stack_alignment + kCArgsSlotsSize));
1248 __ sw(ra, MemOperand(sp, 0)); 1257 const int return_address_offset = kCArgsSlotsSize;
1249 __ mov(a0, sp); 1258 __ Addu(a0, sp, return_address_offset);
1259 __ sw(ra, MemOperand(a0, 0));
1250 __ mov(t9, t1); 1260 __ mov(t9, t1);
1251 __ Call(t9); 1261 __ Call(t9);
1252 __ lw(ra, MemOperand(sp, 0)); 1262 __ lw(ra, MemOperand(sp, return_address_offset));
1253 __ Addu(sp, sp, Operand(stack_alignment)); 1263 __ Addu(sp, sp, Operand(stack_alignment + kCArgsSlotsSize));
1254 __ Jump(ra); 1264 __ Jump(ra);
1255 } 1265 }
1256 1266
1257 1267
1258 #undef __ 1268 #undef __
1259 1269
1260 #endif // V8_INTERPRETED_REGEXP 1270 #endif // V8_INTERPRETED_REGEXP
1261 1271
1262 }} // namespace v8::internal 1272 }} // namespace v8::internal
1263 1273
1264 #endif // V8_TARGET_ARCH_MIPS 1274 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | src/mips/stub-cache-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698