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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 * - r8 : code object pointer. Used to convert between absolute and | 60 * - r8 : code object pointer. Used to convert between absolute and |
61 * code-object-relative addresses. | 61 * code-object-relative addresses. |
62 * | 62 * |
63 * The registers rax, rbx, rcx, r9 and r11 are free to use for computations. | 63 * The registers rax, rbx, rcx, r9 and r11 are free to use for computations. |
64 * If changed to use r12+, they should be saved as callee-save registers. | 64 * If changed to use r12+, they should be saved as callee-save registers. |
65 * | 65 * |
66 * Each call to a C++ method should retain these registers. | 66 * Each call to a C++ method should retain these registers. |
67 * | 67 * |
68 * The stack will have the following content, in some order, indexable from the | 68 * The stack will have the following content, in some order, indexable from the |
69 * frame pointer (see, e.g., kStackHighEnd): | 69 * frame pointer (see, e.g., kStackHighEnd): |
70 * - stack_area_base (High end of the memory area to use as | 70 * - direct_call (if 1, direct call from JavaScript code, if 0 call |
71 * backtracking stack) | 71 * through the runtime system) |
72 * - at_start (if 1, start at start of string, if 0, don't) | 72 * - stack_area_base (High end of the memory area to use as |
73 * - int* capture_array (int[num_saved_registers_], for output). | 73 * backtracking stack) |
74 * - end of input (Address of end of string) | 74 * - at_start (if 1, we are starting at the start of the |
75 * - start of input (Address of first character in string) | 75 * string, otherwise 0) |
76 * - String** input_string (location of a handle containing the string) | 76 * - int* capture_array (int[num_saved_registers_], for output). |
| 77 * - end of input (Address of end of string) |
| 78 * - start of input (Address of first character in string) |
| 79 * - start index (character index of start) |
| 80 * - String* input_string (input string) |
77 * - return address | 81 * - return address |
78 * - backup of callee save registers (rbx, possibly rsi and rdi). | 82 * - backup of callee save registers (rbx, possibly rsi and rdi). |
79 * - Offset of location before start of input (effectively character | 83 * - Offset of location before start of input (effectively character |
80 * position -1). Used to initialize capture registers to a non-position. | 84 * position -1). Used to initialize capture registers to a non-position. |
81 * - register 0 rbp[-n] (Only positions must be stored in the first | 85 * - register 0 rbp[-n] (Only positions must be stored in the first |
82 * - register 1 rbp[-n-8] num_saved_registers_ registers) | 86 * - register 1 rbp[-n-8] num_saved_registers_ registers) |
83 * - ... | 87 * - ... |
84 * | 88 * |
85 * The first num_saved_registers_ registers are initialized to point to | 89 * The first num_saved_registers_ registers are initialized to point to |
86 * "character -1" in the string (i.e., char_size() bytes before the first | 90 * "character -1" in the string (i.e., char_size() bytes before the first |
87 * character of the string). The remaining registers starts out uninitialized. | 91 * character of the string). The remaining registers starts out uninitialized. |
88 * | 92 * |
89 * The first seven values must be provided by the calling code by | 93 * The first seven values must be provided by the calling code by |
90 * calling the code's entry address cast to a function pointer with the | 94 * calling the code's entry address cast to a function pointer with the |
91 * following signature: | 95 * following signature: |
92 * int (*match)(String* input_string, | 96 * int (*match)(String* input_string, |
| 97 * int start_index, |
93 * Address start, | 98 * Address start, |
94 * Address end, | 99 * Address end, |
95 * int* capture_output_array, | 100 * int* capture_output_array, |
96 * bool at_start, | 101 * bool at_start, |
97 * byte* stack_area_base) | 102 * byte* stack_area_base, |
| 103 * bool direct_call) |
98 */ | 104 */ |
99 | 105 |
100 #define __ ACCESS_MASM(masm_) | 106 #define __ ACCESS_MASM(masm_) |
101 | 107 |
102 RegExpMacroAssemblerX64::RegExpMacroAssemblerX64( | 108 RegExpMacroAssemblerX64::RegExpMacroAssemblerX64( |
103 Mode mode, | 109 Mode mode, |
104 int registers_to_save) | 110 int registers_to_save) |
105 : masm_(new MacroAssembler(NULL, kRegExpCodeSize)), | 111 : masm_(new MacroAssembler(NULL, kRegExpCodeSize)), |
106 code_relative_fixup_positions_(4), | 112 code_relative_fixup_positions_(4), |
107 mode_(mode), | 113 mode_(mode), |
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1283 Operand(rsi, rdi, times_1, cp_offset * sizeof(uc16))); | 1289 Operand(rsi, rdi, times_1, cp_offset * sizeof(uc16))); |
1284 } | 1290 } |
1285 } | 1291 } |
1286 } | 1292 } |
1287 | 1293 |
1288 #undef __ | 1294 #undef __ |
1289 | 1295 |
1290 #endif // V8_NATIVE_REGEXP | 1296 #endif // V8_NATIVE_REGEXP |
1291 | 1297 |
1292 }} // namespace v8::internal | 1298 }} // namespace v8::internal |
OLD | NEW |