OLD | NEW |
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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 // Start new stack frame. | 604 // Start new stack frame. |
605 // Order here should correspond to order of offset constants in header file. | 605 // Order here should correspond to order of offset constants in header file. |
606 RegList registers_to_retain = r4.bit() | r5.bit() | r6.bit() | | 606 RegList registers_to_retain = r4.bit() | r5.bit() | r6.bit() | |
607 r7.bit() | r8.bit() | r9.bit() | r10.bit() | fp.bit(); | 607 r7.bit() | r8.bit() | r9.bit() | r10.bit() | fp.bit(); |
608 RegList argument_registers = r0.bit() | r1.bit() | r2.bit() | r3.bit(); | 608 RegList argument_registers = r0.bit() | r1.bit() | r2.bit() | r3.bit(); |
609 __ stm(db_w, sp, argument_registers | registers_to_retain | lr.bit()); | 609 __ stm(db_w, sp, argument_registers | registers_to_retain | lr.bit()); |
610 // Set frame pointer just above the arguments. | 610 // Set frame pointer just above the arguments. |
611 __ add(frame_pointer(), sp, Operand(4 * kPointerSize)); | 611 __ add(frame_pointer(), sp, Operand(4 * kPointerSize)); |
612 __ push(r0); // Make room for "position - 1" constant (value is irrelevant). | 612 __ push(r0); // Make room for "position - 1" constant (value is irrelevant). |
613 __ push(r0); // Make room for "at start" constant (value is irrelevant). | 613 __ push(r0); // Make room for "at start" constant (value is irrelevant). |
614 | |
615 // Check if we have space on the stack for registers. | 614 // Check if we have space on the stack for registers. |
616 Label stack_limit_hit; | 615 Label stack_limit_hit; |
617 Label stack_ok; | 616 Label stack_ok; |
618 | 617 |
619 ExternalReference stack_limit = | 618 ExternalReference stack_limit = |
620 ExternalReference::address_of_stack_limit(); | 619 ExternalReference::address_of_stack_limit(); |
621 __ mov(r0, Operand(stack_limit)); | 620 __ mov(r0, Operand(stack_limit)); |
622 __ ldr(r0, MemOperand(r0)); | 621 __ ldr(r0, MemOperand(r0)); |
623 __ sub(r0, sp, r0, SetCC); | 622 __ sub(r0, sp, r0, SetCC); |
624 // Handle it if the stack pointer is already below the stack limit. | 623 // Handle it if the stack pointer is already below the stack limit. |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 Code* re_code, | 993 Code* re_code, |
995 Address re_frame) { | 994 Address re_frame) { |
996 if (StackGuard::IsStackOverflow()) { | 995 if (StackGuard::IsStackOverflow()) { |
997 Top::StackOverflow(); | 996 Top::StackOverflow(); |
998 return EXCEPTION; | 997 return EXCEPTION; |
999 } | 998 } |
1000 | 999 |
1001 // If not real stack overflow the stack guard was used to interrupt | 1000 // If not real stack overflow the stack guard was used to interrupt |
1002 // execution for another purpose. | 1001 // execution for another purpose. |
1003 | 1002 |
| 1003 // If this is a direct call from JavaScript retry the RegExp forcing the call |
| 1004 // through the runtime system. Currently the direct call cannot handle a GC. |
| 1005 if (frame_entry<int>(re_frame, kDirectCall) == 1) { |
| 1006 return RETRY; |
| 1007 } |
| 1008 |
1004 // Prepare for possible GC. | 1009 // Prepare for possible GC. |
1005 HandleScope handles; | 1010 HandleScope handles; |
1006 Handle<Code> code_handle(re_code); | 1011 Handle<Code> code_handle(re_code); |
1007 | 1012 |
1008 Handle<String> subject(frame_entry<String*>(re_frame, kInputString)); | 1013 Handle<String> subject(frame_entry<String*>(re_frame, kInputString)); |
1009 // Current string. | 1014 // Current string. |
1010 bool is_ascii = subject->IsAsciiRepresentation(); | 1015 bool is_ascii = subject->IsAsciiRepresentation(); |
1011 | 1016 |
1012 ASSERT(re_code->instruction_start() <= *return_address); | 1017 ASSERT(re_code->instruction_start() <= *return_address); |
1013 ASSERT(*return_address <= | 1018 ASSERT(*return_address <= |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1226 __ mov(r0, sp); | 1231 __ mov(r0, sp); |
1227 __ Call(r5); | 1232 __ Call(r5); |
1228 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); | 1233 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); |
1229 } | 1234 } |
1230 | 1235 |
1231 #undef __ | 1236 #undef __ |
1232 | 1237 |
1233 #endif // V8_NATIVE_REGEXP | 1238 #endif // V8_NATIVE_REGEXP |
1234 | 1239 |
1235 }} // namespace v8::internal | 1240 }} // namespace v8::internal |
OLD | NEW |