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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 * - r10 : End of input (points to byte after last character in input). | 52 * - r10 : End of input (points to byte after last character in input). |
53 * - r11 : Frame pointer. Used to access arguments, local variables and | 53 * - r11 : Frame pointer. Used to access arguments, local variables and |
54 * RegExp registers. | 54 * RegExp registers. |
55 * - r12 : IP register, used by assembler. Very volatile. | 55 * - r12 : IP register, used by assembler. Very volatile. |
56 * - r13/sp : points to tip of C stack. | 56 * - r13/sp : points to tip of C stack. |
57 * | 57 * |
58 * The remaining registers are free for computations. | 58 * The remaining registers are free for computations. |
59 * | 59 * |
60 * Each call to a public method should retain this convention. | 60 * Each call to a public method should retain this convention. |
61 * The stack will have the following structure: | 61 * The stack will have the following structure: |
| 62 * - direct_call (if 1, direct call from JavaScript code, if 0 call |
| 63 * through the runtime system) |
62 * - stack_area_base (High end of the memory area to use as | 64 * - stack_area_base (High end of the memory area to use as |
63 * backtracking stack) | 65 * backtracking stack) |
64 * - at_start (if 1, start at start of string, if 0, don't) | 66 * - at_start (if 1, we are starting at the start of the |
| 67 * string, otherwise 0) |
| 68 * - int* capture_array (int[num_saved_registers_], for output). |
65 * --- sp when called --- | 69 * --- sp when called --- |
66 * - link address | 70 * - link address |
67 * - backup of registers r4..r11 | 71 * - backup of registers r4..r11 |
68 * - int* capture_array (int[num_saved_registers_], for output). | |
69 * - end of input (Address of end of string) | 72 * - end of input (Address of end of string) |
70 * - start of input (Address of first character in string) | 73 * - start of input (Address of first character in string) |
| 74 * - start index (character index of start) |
71 * --- frame pointer ---- | 75 * --- frame pointer ---- |
72 * - void* input_string (location of a handle containing the string) | 76 * - void* input_string (location of a handle containing the string) |
73 * - Offset of location before start of input (effectively character | 77 * - Offset of location before start of input (effectively character |
74 * position -1). Used to initialize capture registers to a non-position. | 78 * position -1). Used to initialize capture registers to a non-position. |
75 * - register 0 (Only positions must be stored in the first | 79 * - register 0 (Only positions must be stored in the first |
76 * - register 1 num_saved_registers_ registers) | 80 * - register 1 num_saved_registers_ registers) |
77 * - ... | 81 * - ... |
78 * - register num_registers-1 | 82 * - register num_registers-1 |
79 * --- sp --- | 83 * --- sp --- |
80 * | 84 * |
81 * The first num_saved_registers_ registers are initialized to point to | 85 * The first num_saved_registers_ registers are initialized to point to |
82 * "character -1" in the string (i.e., char_size() bytes before the first | 86 * "character -1" in the string (i.e., char_size() bytes before the first |
83 * character of the string). The remaining registers start out as garbage. | 87 * character of the string). The remaining registers start out as garbage. |
84 * | 88 * |
85 * The data up to the return address must be placed there by the calling | 89 * The data up to the return address must be placed there by the calling |
86 * code, by calling the code entry as cast to a function with the signature: | 90 * code, by calling the code entry as cast to a function with the signature: |
87 * int (*match)(String* input_string, | 91 * int (*match)(String* input_string, |
| 92 * int start_index, |
88 * Address start, | 93 * Address start, |
89 * Address end, | 94 * Address end, |
90 * int* capture_output_array, | 95 * int* capture_output_array, |
91 * bool at_start, | 96 * bool at_start, |
92 * byte* stack_area_base) | 97 * byte* stack_area_base, |
| 98 * bool direct_call) |
93 * The call is performed by NativeRegExpMacroAssembler::Execute() | 99 * The call is performed by NativeRegExpMacroAssembler::Execute() |
94 * (in regexp-macro-assembler.cc). | 100 * (in regexp-macro-assembler.cc). |
95 */ | 101 */ |
96 | 102 |
97 #define __ ACCESS_MASM(masm_) | 103 #define __ ACCESS_MASM(masm_) |
98 | 104 |
99 RegExpMacroAssemblerARM::RegExpMacroAssemblerARM( | 105 RegExpMacroAssemblerARM::RegExpMacroAssemblerARM( |
100 Mode mode, | 106 Mode mode, |
101 int registers_to_save) | 107 int registers_to_save) |
102 : masm_(new MacroAssembler(NULL, kRegExpCodeSize)), | 108 : masm_(new MacroAssembler(NULL, kRegExpCodeSize)), |
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1220 __ mov(r0, sp); | 1226 __ mov(r0, sp); |
1221 __ Call(r5); | 1227 __ Call(r5); |
1222 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); | 1228 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); |
1223 } | 1229 } |
1224 | 1230 |
1225 #undef __ | 1231 #undef __ |
1226 | 1232 |
1227 #endif // V8_NATIVE_REGEXP | 1233 #endif // V8_NATIVE_REGEXP |
1228 | 1234 |
1229 }} // namespace v8::internal | 1235 }} // namespace v8::internal |
OLD | NEW |