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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 * - r10 : End of input (points to byte after last character in input). | 53 * - r10 : End of input (points to byte after last character in input). |
54 * - r11 : Frame pointer. Used to access arguments, local variables and | 54 * - r11 : Frame pointer. Used to access arguments, local variables and |
55 * RegExp registers. | 55 * RegExp registers. |
56 * - r12 : IP register, used by assembler. Very volatile. | 56 * - r12 : IP register, used by assembler. Very volatile. |
57 * - r13/sp : points to tip of C stack. | 57 * - r13/sp : points to tip of C stack. |
58 * | 58 * |
59 * The remaining registers are free for computations. | 59 * The remaining registers are free for computations. |
60 * Each call to a public method should retain this convention. | 60 * Each call to a public method should retain this convention. |
61 * | 61 * |
62 * The stack will have the following structure: | 62 * The stack will have the following structure: |
| 63 * - fp[52] Isolate* isolate (Address of the current isolate) |
63 * - fp[48] direct_call (if 1, direct call from JavaScript code, | 64 * - fp[48] direct_call (if 1, direct call from JavaScript code, |
64 * if 0, call through the runtime system). | 65 * if 0, call through the runtime system). |
65 * - fp[44] stack_area_base (High end of the memory area to use as | 66 * - fp[44] stack_area_base (High end of the memory area to use as |
66 * backtracking stack). | 67 * backtracking stack). |
67 * - fp[40] int* capture_array (int[num_saved_registers_], for output). | 68 * - fp[40] int* capture_array (int[num_saved_registers_], for output). |
68 * - fp[36] secondary link/return address used by native call. | 69 * - fp[36] secondary link/return address used by native call. |
69 * --- sp when called --- | 70 * --- sp when called --- |
70 * - fp[32] return address (lr). | 71 * - fp[32] return address (lr). |
71 * - fp[28] old frame pointer (r11). | 72 * - fp[28] old frame pointer (r11). |
72 * - fp[0..24] backup of registers r4..r10. | 73 * - fp[0..24] backup of registers r4..r10. |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 if (exit_with_exception.is_linked()) { | 798 if (exit_with_exception.is_linked()) { |
798 // If any of the code above needed to exit with an exception. | 799 // If any of the code above needed to exit with an exception. |
799 __ bind(&exit_with_exception); | 800 __ bind(&exit_with_exception); |
800 // Exit with Result EXCEPTION(-1) to signal thrown exception. | 801 // Exit with Result EXCEPTION(-1) to signal thrown exception. |
801 __ mov(r0, Operand(EXCEPTION)); | 802 __ mov(r0, Operand(EXCEPTION)); |
802 __ jmp(&exit_label_); | 803 __ jmp(&exit_label_); |
803 } | 804 } |
804 | 805 |
805 CodeDesc code_desc; | 806 CodeDesc code_desc; |
806 masm_->GetCode(&code_desc); | 807 masm_->GetCode(&code_desc); |
807 Handle<Code> code = Factory::NewCode(code_desc, | 808 Handle<Code> code = FACTORY->NewCode(code_desc, |
808 Code::ComputeFlags(Code::REGEXP), | 809 Code::ComputeFlags(Code::REGEXP), |
809 masm_->CodeObject()); | 810 masm_->CodeObject()); |
810 PROFILE(RegExpCodeCreateEvent(*code, *source)); | 811 PROFILE(Isolate::Current(), RegExpCodeCreateEvent(*code, *source)); |
811 return Handle<Object>::cast(code); | 812 return Handle<Object>::cast(code); |
812 } | 813 } |
813 | 814 |
814 | 815 |
815 void RegExpMacroAssemblerARM::GoTo(Label* to) { | 816 void RegExpMacroAssemblerARM::GoTo(Label* to) { |
816 BranchOrBacktrack(al, to); | 817 BranchOrBacktrack(al, to); |
817 } | 818 } |
818 | 819 |
819 | 820 |
820 void RegExpMacroAssemblerARM::IfRegisterGE(int reg, | 821 void RegExpMacroAssemblerARM::IfRegisterGE(int reg, |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 // Helper function for reading a value out of a stack frame. | 1007 // Helper function for reading a value out of a stack frame. |
1007 template <typename T> | 1008 template <typename T> |
1008 static T& frame_entry(Address re_frame, int frame_offset) { | 1009 static T& frame_entry(Address re_frame, int frame_offset) { |
1009 return reinterpret_cast<T&>(Memory::int32_at(re_frame + frame_offset)); | 1010 return reinterpret_cast<T&>(Memory::int32_at(re_frame + frame_offset)); |
1010 } | 1011 } |
1011 | 1012 |
1012 | 1013 |
1013 int RegExpMacroAssemblerARM::CheckStackGuardState(Address* return_address, | 1014 int RegExpMacroAssemblerARM::CheckStackGuardState(Address* return_address, |
1014 Code* re_code, | 1015 Code* re_code, |
1015 Address re_frame) { | 1016 Address re_frame) { |
1016 if (StackGuard::IsStackOverflow()) { | 1017 Isolate* isolate = frame_entry<Isolate*>(re_frame, kIsolate); |
1017 Top::StackOverflow(); | 1018 ASSERT(isolate == Isolate::Current()); |
| 1019 if (isolate->stack_guard()->IsStackOverflow()) { |
| 1020 isolate->StackOverflow(); |
1018 return EXCEPTION; | 1021 return EXCEPTION; |
1019 } | 1022 } |
1020 | 1023 |
1021 // If not real stack overflow the stack guard was used to interrupt | 1024 // If not real stack overflow the stack guard was used to interrupt |
1022 // execution for another purpose. | 1025 // execution for another purpose. |
1023 | 1026 |
1024 // If this is a direct call from JavaScript retry the RegExp forcing the call | 1027 // If this is a direct call from JavaScript retry the RegExp forcing the call |
1025 // through the runtime system. Currently the direct call cannot handle a GC. | 1028 // through the runtime system. Currently the direct call cannot handle a GC. |
1026 if (frame_entry<int>(re_frame, kDirectCall) == 1) { | 1029 if (frame_entry<int>(re_frame, kDirectCall) == 1) { |
1027 return RETRY; | 1030 return RETRY; |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); | 1274 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); |
1272 } | 1275 } |
1273 | 1276 |
1274 #undef __ | 1277 #undef __ |
1275 | 1278 |
1276 #endif // V8_INTERPRETED_REGEXP | 1279 #endif // V8_INTERPRETED_REGEXP |
1277 | 1280 |
1278 }} // namespace v8::internal | 1281 }} // namespace v8::internal |
1279 | 1282 |
1280 #endif // V8_TARGET_ARCH_ARM | 1283 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |