| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 if (c1 != c2) { | 1039 if (c1 != c2) { |
| 1040 return 0; | 1040 return 0; |
| 1041 } | 1041 } |
| 1042 } | 1042 } |
| 1043 } | 1043 } |
| 1044 } | 1044 } |
| 1045 return 1; | 1045 return 1; |
| 1046 } | 1046 } |
| 1047 | 1047 |
| 1048 | 1048 |
| 1049 int RegExpMacroAssemblerIA32::CheckStackGuardState(Address return_address, | 1049 int RegExpMacroAssemblerIA32::CheckStackGuardState(Address* return_address, |
| 1050 Code* re_code) { | 1050 Code* re_code) { |
| 1051 if (StackGuard::IsStackOverflow()) { | 1051 if (StackGuard::IsStackOverflow()) { |
| 1052 Top::StackOverflow(); | 1052 Top::StackOverflow(); |
| 1053 return 1; | 1053 return 1; |
| 1054 } | 1054 } |
| 1055 | 1055 |
| 1056 // If not real stack overflow the stack guard was used to interrupt | 1056 // If not real stack overflow the stack guard was used to interrupt |
| 1057 // execution for another purpose. | 1057 // execution for another purpose. |
| 1058 | 1058 |
| 1059 // Prepare for possible GC. | 1059 // Prepare for possible GC. |
| 1060 Handle<Code> code_handle(re_code); | 1060 Handle<Code> code_handle(re_code); |
| 1061 | 1061 |
| 1062 ASSERT(re_code->instruction_start() <= return_address); | 1062 ASSERT(re_code->instruction_start() <= *return_address); |
| 1063 ASSERT(return_address <= | 1063 ASSERT(*return_address <= |
| 1064 re_code->instruction_start() + re_code->instruction_size()); | 1064 re_code->instruction_start() + re_code->instruction_size()); |
| 1065 | 1065 |
| 1066 Object* result = Execution::HandleStackGuardInterrupt(); | 1066 Object* result = Execution::HandleStackGuardInterrupt(); |
| 1067 | 1067 |
| 1068 if (*code_handle != re_code) { // Return address no longer valid | 1068 if (*code_handle != re_code) { // Return address no longer valid |
| 1069 int delta = *code_handle - re_code; | 1069 int delta = *code_handle - re_code; |
| 1070 *reinterpret_cast<int32_t*>(return_address) += delta; | 1070 // Overwrite the return address on the stack. |
| 1071 *return_address += delta; |
| 1071 } | 1072 } |
| 1072 | 1073 |
| 1073 if (result->IsException()) { | 1074 if (result->IsException()) { |
| 1074 return 1; | 1075 return 1; |
| 1075 } | 1076 } |
| 1076 return 0; | 1077 return 0; |
| 1077 } | 1078 } |
| 1078 | 1079 |
| 1079 | 1080 |
| 1080 Address RegExpMacroAssemblerIA32::GrowStack(Address stack_pointer, | 1081 Address RegExpMacroAssemblerIA32::GrowStack(Address stack_pointer, |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1252 | 1253 |
| 1253 | 1254 |
| 1254 void RegExpMacroAssemblerIA32::LoadConstantBufferAddress(Register reg, | 1255 void RegExpMacroAssemblerIA32::LoadConstantBufferAddress(Register reg, |
| 1255 ArraySlice* buffer) { | 1256 ArraySlice* buffer) { |
| 1256 __ mov(reg, buffer->array()); | 1257 __ mov(reg, buffer->array()); |
| 1257 __ add(Operand(reg), Immediate(buffer->base_offset())); | 1258 __ add(Operand(reg), Immediate(buffer->base_offset())); |
| 1258 } | 1259 } |
| 1259 | 1260 |
| 1260 #undef __ | 1261 #undef __ |
| 1261 }} // namespace v8::internal | 1262 }} // namespace v8::internal |
| OLD | NEW |