OLD | NEW |
1 // Copyright 2008-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2008-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 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 } | 1095 } |
1096 if (to == NULL) { | 1096 if (to == NULL) { |
1097 __ j(condition, &backtrack_label_, hint); | 1097 __ j(condition, &backtrack_label_, hint); |
1098 return; | 1098 return; |
1099 } | 1099 } |
1100 __ j(condition, to, hint); | 1100 __ j(condition, to, hint); |
1101 } | 1101 } |
1102 | 1102 |
1103 | 1103 |
1104 void RegExpMacroAssemblerIA32::SafeCall(Label* to) { | 1104 void RegExpMacroAssemblerIA32::SafeCall(Label* to) { |
1105 __ call(to); | 1105 Label return_to; |
| 1106 __ push(Immediate::CodeRelativeOffset(&return_to)); |
| 1107 __ jmp(to); |
| 1108 __ bind(&return_to); |
1106 } | 1109 } |
1107 | 1110 |
1108 | 1111 |
1109 void RegExpMacroAssemblerIA32::SafeReturn() { | 1112 void RegExpMacroAssemblerIA32::SafeReturn() { |
1110 __ add(Operand(esp, 0), Immediate(masm_->CodeObject())); | 1113 __ pop(ebx); |
1111 __ ret(0); | 1114 __ add(Operand(ebx), Immediate(masm_->CodeObject())); |
| 1115 __ jmp(Operand(ebx)); |
1112 } | 1116 } |
1113 | 1117 |
1114 | 1118 |
1115 void RegExpMacroAssemblerIA32::SafeCallTarget(Label* name) { | 1119 void RegExpMacroAssemblerIA32::SafeCallTarget(Label* name) { |
1116 __ bind(name); | 1120 __ bind(name); |
1117 __ sub(Operand(esp, 0), Immediate(masm_->CodeObject())); | |
1118 } | 1121 } |
1119 | 1122 |
1120 | 1123 |
1121 void RegExpMacroAssemblerIA32::Push(Register source) { | 1124 void RegExpMacroAssemblerIA32::Push(Register source) { |
1122 ASSERT(!source.is(backtrack_stackpointer())); | 1125 ASSERT(!source.is(backtrack_stackpointer())); |
1123 // Notice: This updates flags, unlike normal Push. | 1126 // Notice: This updates flags, unlike normal Push. |
1124 __ sub(Operand(backtrack_stackpointer()), Immediate(kPointerSize)); | 1127 __ sub(Operand(backtrack_stackpointer()), Immediate(kPointerSize)); |
1125 __ mov(Operand(backtrack_stackpointer(), 0), source); | 1128 __ mov(Operand(backtrack_stackpointer(), 0), source); |
1126 } | 1129 } |
1127 | 1130 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 } | 1194 } |
1192 } | 1195 } |
1193 } | 1196 } |
1194 | 1197 |
1195 | 1198 |
1196 #undef __ | 1199 #undef __ |
1197 | 1200 |
1198 #endif // V8_INTERPRETED_REGEXP | 1201 #endif // V8_INTERPRETED_REGEXP |
1199 | 1202 |
1200 }} // namespace v8::internal | 1203 }} // namespace v8::internal |
OLD | NEW |