| 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 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 int constant_offset = GetBacktrackConstantPoolEntry(); | 947 int constant_offset = GetBacktrackConstantPoolEntry(); |
| 948 masm_->label_at_put(label, constant_offset); | 948 masm_->label_at_put(label, constant_offset); |
| 949 // Reading pc-relative is based on the address 8 bytes ahead of | 949 // Reading pc-relative is based on the address 8 bytes ahead of |
| 950 // the current opcode. | 950 // the current opcode. |
| 951 unsigned int offset_of_pc_register_read = | 951 unsigned int offset_of_pc_register_read = |
| 952 masm_->pc_offset() + Assembler::kPcLoadDelta; | 952 masm_->pc_offset() + Assembler::kPcLoadDelta; |
| 953 int pc_offset_of_constant = | 953 int pc_offset_of_constant = |
| 954 constant_offset - offset_of_pc_register_read; | 954 constant_offset - offset_of_pc_register_read; |
| 955 ASSERT(pc_offset_of_constant < 0); | 955 ASSERT(pc_offset_of_constant < 0); |
| 956 if (is_valid_memory_offset(pc_offset_of_constant)) { | 956 if (is_valid_memory_offset(pc_offset_of_constant)) { |
| 957 Assembler::BlockConstPoolScope block_const_pool(masm_); | 957 masm_->BlockConstPoolBefore(masm_->pc_offset() + Assembler::kInstrSize); |
| 958 __ ldr(r0, MemOperand(pc, pc_offset_of_constant)); | 958 __ ldr(r0, MemOperand(pc, pc_offset_of_constant)); |
| 959 } else { | 959 } else { |
| 960 // Not a 12-bit offset, so it needs to be loaded from the constant | 960 // Not a 12-bit offset, so it needs to be loaded from the constant |
| 961 // pool. | 961 // pool. |
| 962 Assembler::BlockConstPoolScope block_const_pool(masm_); | 962 masm_->BlockConstPoolBefore( |
| 963 masm_->pc_offset() + 2 * Assembler::kInstrSize); |
| 963 __ mov(r0, Operand(pc_offset_of_constant + Assembler::kInstrSize)); | 964 __ mov(r0, Operand(pc_offset_of_constant + Assembler::kInstrSize)); |
| 964 __ ldr(r0, MemOperand(pc, r0)); | 965 __ ldr(r0, MemOperand(pc, r0)); |
| 965 } | 966 } |
| 966 } | 967 } |
| 967 Push(r0); | 968 Push(r0); |
| 968 CheckStackLimit(); | 969 CheckStackLimit(); |
| 969 } | 970 } |
| 970 | 971 |
| 971 | 972 |
| 972 void RegExpMacroAssemblerARM::PushCurrentPosition() { | 973 void RegExpMacroAssemblerARM::PushCurrentPosition() { |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1251 ExternalReference::address_of_regexp_stack_limit(masm_->isolate()); | 1252 ExternalReference::address_of_regexp_stack_limit(masm_->isolate()); |
| 1252 __ mov(r0, Operand(stack_limit)); | 1253 __ mov(r0, Operand(stack_limit)); |
| 1253 __ ldr(r0, MemOperand(r0)); | 1254 __ ldr(r0, MemOperand(r0)); |
| 1254 __ cmp(backtrack_stackpointer(), Operand(r0)); | 1255 __ cmp(backtrack_stackpointer(), Operand(r0)); |
| 1255 SafeCall(&stack_overflow_label_, ls); | 1256 SafeCall(&stack_overflow_label_, ls); |
| 1256 } | 1257 } |
| 1257 | 1258 |
| 1258 | 1259 |
| 1259 void RegExpMacroAssemblerARM::EmitBacktrackConstantPool() { | 1260 void RegExpMacroAssemblerARM::EmitBacktrackConstantPool() { |
| 1260 __ CheckConstPool(false, false); | 1261 __ CheckConstPool(false, false); |
| 1261 Assembler::BlockConstPoolScope block_const_pool(masm_); | 1262 __ BlockConstPoolBefore( |
| 1263 masm_->pc_offset() + kBacktrackConstantPoolSize * Assembler::kInstrSize); |
| 1262 backtrack_constant_pool_offset_ = masm_->pc_offset(); | 1264 backtrack_constant_pool_offset_ = masm_->pc_offset(); |
| 1263 for (int i = 0; i < kBacktrackConstantPoolSize; i++) { | 1265 for (int i = 0; i < kBacktrackConstantPoolSize; i++) { |
| 1264 __ emit(0); | 1266 __ emit(0); |
| 1265 } | 1267 } |
| 1266 | 1268 |
| 1267 backtrack_constant_pool_capacity_ = kBacktrackConstantPoolSize; | 1269 backtrack_constant_pool_capacity_ = kBacktrackConstantPoolSize; |
| 1268 } | 1270 } |
| 1269 | 1271 |
| 1270 | 1272 |
| 1271 int RegExpMacroAssemblerARM::GetBacktrackConstantPoolEntry() { | 1273 int RegExpMacroAssemblerARM::GetBacktrackConstantPoolEntry() { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1350 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); | 1352 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); |
| 1351 } | 1353 } |
| 1352 | 1354 |
| 1353 #undef __ | 1355 #undef __ |
| 1354 | 1356 |
| 1355 #endif // V8_INTERPRETED_REGEXP | 1357 #endif // V8_INTERPRETED_REGEXP |
| 1356 | 1358 |
| 1357 }} // namespace v8::internal | 1359 }} // namespace v8::internal |
| 1358 | 1360 |
| 1359 #endif // V8_TARGET_ARCH_ARM | 1361 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |