OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
6 | 6 |
7 #include "src/regexp/mips/regexp-macro-assembler-mips.h" | 7 #include "src/regexp/mips/regexp-macro-assembler-mips.h" |
8 | 8 |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/log.h" | 10 #include "src/log.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 * - t6 : End of input (points to byte after last character in input). | 31 * - t6 : End of input (points to byte after last character in input). |
32 * - fp : Frame pointer. Used to access arguments, local variables and | 32 * - fp : Frame pointer. Used to access arguments, local variables and |
33 * RegExp registers. | 33 * RegExp registers. |
34 * - sp : Points to tip of C stack. | 34 * - sp : Points to tip of C stack. |
35 * | 35 * |
36 * The remaining registers are free for computations. | 36 * The remaining registers are free for computations. |
37 * Each call to a public method should retain this convention. | 37 * Each call to a public method should retain this convention. |
38 * | 38 * |
39 * The stack will have the following structure: | 39 * The stack will have the following structure: |
40 * | 40 * |
41 * - fp[64] Isolate* isolate (address of the current isolate) | 41 * - fp[60] Isolate* isolate (address of the current isolate) |
42 * - fp[60] direct_call (if 1, direct call from JavaScript code, | 42 * - fp[56] direct_call (if 1, direct call from JavaScript code, |
43 * if 0, call through the runtime system). | 43 * if 0, call through the runtime system). |
44 * - fp[56] stack_area_base (High end of the memory area to use as | 44 * - fp[52] stack_area_base (High end of the memory area to use as |
45 * backtracking stack). | 45 * backtracking stack). |
46 * - fp[52] capture array size (may fit multiple sets of matches) | 46 * - fp[48] capture array size (may fit multiple sets of matches) |
47 * - fp[48] int* capture_array (int[num_saved_registers_], for output). | 47 * - fp[44] int* capture_array (int[num_saved_registers_], for output). |
48 * - fp[44] secondary link/return address used by native call. | |
49 * --- sp when called --- | 48 * --- sp when called --- |
50 * - fp[40] return address (lr). | 49 * - fp[40] return address (lr). |
51 * - fp[36] old frame pointer (r11). | 50 * - fp[36] old frame pointer (r11). |
52 * - fp[0..32] backup of registers s0..s7. | 51 * - fp[0..32] backup of registers s0..s7. |
53 * --- frame pointer ---- | 52 * --- frame pointer ---- |
54 * - fp[-4] end of input (address of end of string). | 53 * - fp[-4] end of input (address of end of string). |
55 * - fp[-8] start of input (address of first character in string). | 54 * - fp[-8] start of input (address of first character in string). |
56 * - fp[-12] start index (character index of start). | 55 * - fp[-12] start index (character index of start). |
57 * - fp[-16] void* input_string (location of a handle containing the string). | 56 * - fp[-16] void* input_string (location of a handle containing the string). |
58 * - fp[-20] success counter (only for global regexps to count matches). | 57 * - fp[-20] success counter (only for global regexps to count matches). |
(...skipping 12 matching lines...) Expand all Loading... |
71 * "character -1" in the string (i.e., char_size() bytes before the first | 70 * "character -1" in the string (i.e., char_size() bytes before the first |
72 * character of the string). The remaining registers start out as garbage. | 71 * character of the string). The remaining registers start out as garbage. |
73 * | 72 * |
74 * The data up to the return address must be placed there by the calling | 73 * The data up to the return address must be placed there by the calling |
75 * code and the remaining arguments are passed in registers, e.g. by calling the | 74 * code and the remaining arguments are passed in registers, e.g. by calling the |
76 * code entry as cast to a function with the signature: | 75 * code entry as cast to a function with the signature: |
77 * int (*match)(String* input_string, | 76 * int (*match)(String* input_string, |
78 * int start_index, | 77 * int start_index, |
79 * Address start, | 78 * Address start, |
80 * Address end, | 79 * Address end, |
81 * Address secondary_return_address, // Only used by native call. | |
82 * int* capture_output_array, | 80 * int* capture_output_array, |
| 81 * int num_capture_registers, |
83 * byte* stack_area_base, | 82 * byte* stack_area_base, |
84 * bool direct_call = false) | 83 * bool direct_call = false, |
| 84 * Isolate* isolate); |
85 * The call is performed by NativeRegExpMacroAssembler::Execute() | 85 * The call is performed by NativeRegExpMacroAssembler::Execute() |
86 * (in regexp-macro-assembler.cc) via the CALL_GENERATED_REGEXP_CODE macro | 86 * (in regexp-macro-assembler.cc) via the CALL_GENERATED_REGEXP_CODE macro |
87 * in mips/simulator-mips.h. | 87 * in mips/simulator-mips.h. |
88 * When calling as a non-direct call (i.e., from C++ code), the return address | |
89 * area is overwritten with the ra register by the RegExp code. When doing a | |
90 * direct call from generated code, the return address is placed there by | |
91 * the calling code, as in a normal exit frame. | |
92 */ | 88 */ |
93 | 89 |
94 #define __ ACCESS_MASM(masm_) | 90 #define __ ACCESS_MASM(masm_) |
95 | 91 |
96 RegExpMacroAssemblerMIPS::RegExpMacroAssemblerMIPS(Isolate* isolate, Zone* zone, | 92 RegExpMacroAssemblerMIPS::RegExpMacroAssemblerMIPS(Isolate* isolate, Zone* zone, |
97 Mode mode, | 93 Mode mode, |
98 int registers_to_save) | 94 int registers_to_save) |
99 : NativeRegExpMacroAssembler(isolate, zone), | 95 : NativeRegExpMacroAssembler(isolate, zone), |
100 masm_(new MacroAssembler(isolate, NULL, kRegExpCodeSize, | 96 masm_(new MacroAssembler(isolate, NULL, kRegExpCodeSize, |
101 CodeObjectRequired::kYes)), | 97 CodeObjectRequired::kYes)), |
(...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1292 | 1288 |
1293 | 1289 |
1294 #undef __ | 1290 #undef __ |
1295 | 1291 |
1296 #endif // V8_INTERPRETED_REGEXP | 1292 #endif // V8_INTERPRETED_REGEXP |
1297 | 1293 |
1298 } // namespace internal | 1294 } // namespace internal |
1299 } // namespace v8 | 1295 } // namespace v8 |
1300 | 1296 |
1301 #endif // V8_TARGET_ARCH_MIPS | 1297 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |