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

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

Issue 7084032: Add asserts and state tracking to ensure that we do not call (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 6 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
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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 __ add(r0, r0, Operand(end_of_input_address())); 364 __ add(r0, r0, Operand(end_of_input_address()));
365 // Length of capture. 365 // Length of capture.
366 __ mov(r2, Operand(r1)); 366 __ mov(r2, Operand(r1));
367 // Save length in callee-save register for use on return. 367 // Save length in callee-save register for use on return.
368 __ mov(r4, Operand(r1)); 368 __ mov(r4, Operand(r1));
369 // Address of current input position. 369 // Address of current input position.
370 __ add(r1, current_input_offset(), Operand(end_of_input_address())); 370 __ add(r1, current_input_offset(), Operand(end_of_input_address()));
371 // Isolate. 371 // Isolate.
372 __ mov(r3, Operand(ExternalReference::isolate_address())); 372 __ mov(r3, Operand(ExternalReference::isolate_address()));
373 373
374 ExternalReference function = 374 {
375 ExternalReference::re_case_insensitive_compare_uc16(masm_->isolate()); 375 // The compare function can't cause a GC. Tell the system that it is OK
376 __ CallCFunction(function, argument_count); 376 // to call into C++ without having a stack frame in place.
377 FrameScope scope(masm_, StackFrame::NONE);
378 ExternalReference function =
379 ExternalReference::re_case_insensitive_compare_uc16(masm_->isolate());
380 __ CallCFunction(function, argument_count);
Søren Thygesen Gjesse 2011/05/31 07:51:45 How about having CallCFunctionWithoutFrame or Call
Erik Corry 2011/05/31 11:52:52 This turns out to be messy because there are lots
381 }
377 382
378 // Check if function returned non-zero for success or zero for failure. 383 // Check if function returned non-zero for success or zero for failure.
379 __ cmp(r0, Operand(0, RelocInfo::NONE)); 384 __ cmp(r0, Operand(0, RelocInfo::NONE));
380 BranchOrBacktrack(eq, on_no_match); 385 BranchOrBacktrack(eq, on_no_match);
381 // On success, increment position by length of capture. 386 // On success, increment position by length of capture.
382 __ add(current_input_offset(), current_input_offset(), Operand(r4)); 387 __ add(current_input_offset(), current_input_offset(), Operand(r4));
383 } 388 }
384 389
385 __ bind(&fallthrough); 390 __ bind(&fallthrough);
386 } 391 }
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 __ jmp(&exit_label_); 609 __ jmp(&exit_label_);
605 } 610 }
606 611
607 612
608 Handle<HeapObject> RegExpMacroAssemblerARM::GetCode(Handle<String> source) { 613 Handle<HeapObject> RegExpMacroAssemblerARM::GetCode(Handle<String> source) {
609 // Finalize code - write the entry point code now we know how many 614 // Finalize code - write the entry point code now we know how many
610 // registers we need. 615 // registers we need.
611 616
612 // Entry code: 617 // Entry code:
613 __ bind(&entry_label_); 618 __ bind(&entry_label_);
619
620 // Tell the system that we have a stack frame. Because the type is NONE, no
621 // is generated.
622 FrameScope scope(masm_, StackFrame::NONE);
623
624 // Actually emit code to start a new stack frame.
614 // Push arguments 625 // Push arguments
615 // Save callee-save registers. 626 // Save callee-save registers.
616 // Start new stack frame. 627 // Start new stack frame.
617 // Store link register in existing stack-cell. 628 // Store link register in existing stack-cell.
618 // Order here should correspond to order of offset constants in header file. 629 // Order here should correspond to order of offset constants in header file.
619 RegList registers_to_retain = r4.bit() | r5.bit() | r6.bit() | 630 RegList registers_to_retain = r4.bit() | r5.bit() | r6.bit() |
620 r7.bit() | r8.bit() | r9.bit() | r10.bit() | fp.bit(); 631 r7.bit() | r8.bit() | r9.bit() | r10.bit() | fp.bit();
621 RegList argument_registers = r0.bit() | r1.bit() | r2.bit() | r3.bit(); 632 RegList argument_registers = r0.bit() | r1.bit() | r2.bit() | r3.bit();
622 __ stm(db_w, sp, argument_registers | registers_to_retain | lr.bit()); 633 __ stm(db_w, sp, argument_registers | registers_to_retain | lr.bit());
623 // Set frame pointer in space for it if this is not a direct call 634 // Set frame pointer in space for it if this is not a direct call
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
1278 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); 1289 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex));
1279 } 1290 }
1280 1291
1281 #undef __ 1292 #undef __
1282 1293
1283 #endif // V8_INTERPRETED_REGEXP 1294 #endif // V8_INTERPRETED_REGEXP
1284 1295
1285 }} // namespace v8::internal 1296 }} // namespace v8::internal
1286 1297
1287 #endif // V8_TARGET_ARCH_ARM 1298 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698