OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 5272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5283 // the unmodified JSRegExpResult map is returned unmodified. | 5283 // the unmodified JSRegExpResult map is returned unmodified. |
5284 // This also ensures that elements are fast. | 5284 // This also ensures that elements are fast. |
5285 | 5285 |
5286 __ ldr(r1, ContextOperand(cp, Context::GLOBAL_INDEX)); | 5286 __ ldr(r1, ContextOperand(cp, Context::GLOBAL_INDEX)); |
5287 __ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalContextOffset)); | 5287 __ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalContextOffset)); |
5288 __ ldr(r1, ContextOperand(r1, Context::REGEXP_RESULT_MAP_INDEX)); | 5288 __ ldr(r1, ContextOperand(r1, Context::REGEXP_RESULT_MAP_INDEX)); |
5289 __ ldr(ip, FieldMemOperand(r0, HeapObject::kMapOffset)); | 5289 __ ldr(ip, FieldMemOperand(r0, HeapObject::kMapOffset)); |
5290 __ cmp(r1, Operand(ip)); | 5290 __ cmp(r1, Operand(ip)); |
5291 __ b(ne, &done); | 5291 __ b(ne, &done); |
5292 | 5292 |
| 5293 if (FLAG_debug_code) { |
| 5294 __ LoadRoot(r2, Heap::kEmptyFixedArrayRootIndex); |
| 5295 __ ldr(ip, FieldMemOperand(r0, JSObject::kPropertiesOffset)); |
| 5296 __ cmp(ip, r2); |
| 5297 __ Check(eq, "JSRegExpResult: default map but non-empty properties."); |
| 5298 } |
| 5299 |
5293 // All set, copy the contents to a new object. | 5300 // All set, copy the contents to a new object. |
5294 __ AllocateInNewSpace(JSRegExpResult::kSize, | 5301 __ AllocateInNewSpace(JSRegExpResult::kSize, |
5295 r2, | 5302 r2, |
5296 r3, | 5303 r3, |
5297 r4, | 5304 r4, |
5298 &call_runtime, | 5305 &call_runtime, |
5299 NO_ALLOCATION_FLAGS); | 5306 NO_ALLOCATION_FLAGS); |
5300 // Store RegExpResult map as map of allocated object. | 5307 // Store RegExpResult map as map of allocated object. |
5301 ASSERT(JSRegExpResult::kSize == 6 * kPointerSize); | 5308 ASSERT(JSRegExpResult::kSize == 6 * kPointerSize); |
5302 // Copy all fields (map is already in r1) from (untagged) r0 to r2. | 5309 // Copy all fields (map is already in r1) from (untagged) r0 to r2. |
5303 // Change map of elements array (ends up in r4) to be a FixedCOWArray. | 5310 // Change map of elements array (ends up in r4) to be a FixedCOWArray. |
5304 __ bic(r0, r0, Operand(kHeapObjectTagMask)); | 5311 __ bic(r0, r0, Operand(kHeapObjectTagMask)); |
5305 __ ldm(ib, r0, r3.bit() | r4.bit() | r5.bit() | r6.bit() | r7.bit()); | 5312 __ ldm(ib, r0, r3.bit() | r4.bit() | r5.bit() | r6.bit() | r7.bit()); |
5306 __ stm(ia, r2, | 5313 __ stm(ia, r2, |
5307 r1.bit() | r3.bit() | r4.bit() | r5.bit() | r6.bit() | r7.bit()); | 5314 r1.bit() | r3.bit() | r4.bit() | r5.bit() | r6.bit() | r7.bit()); |
5308 ASSERT(!Heap::InNewSpace(Heap::fixed_cow_array_map())); | |
5309 ASSERT(JSRegExp::kElementsOffset == 2 * kPointerSize); | 5315 ASSERT(JSRegExp::kElementsOffset == 2 * kPointerSize); |
5310 // Check whether elements array is empty fixed array, and otherwise make | 5316 // Check whether elements array is empty fixed array, and otherwise make |
5311 // it copy-on-write (it never should be empty unless someone is messing | 5317 // it copy-on-write (it never should be empty unless someone is messing |
5312 // with the arguments to the runtime function). | 5318 // with the arguments to the runtime function). |
5313 __ LoadRoot(ip, Heap::kEmptyFixedArrayRootIndex); | 5319 __ LoadRoot(ip, Heap::kEmptyFixedArrayRootIndex); |
5314 __ add(r0, r2, Operand(kHeapObjectTag)); // Tag result and move it to r0. | 5320 __ add(r0, r2, Operand(kHeapObjectTag)); // Tag result and move it to r0. |
5315 __ cmp(r4, ip); | 5321 __ cmp(r4, ip); |
5316 __ b(eq, &done); | 5322 __ b(eq, &done); |
5317 __ LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex); | 5323 __ LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex); |
5318 __ str(ip, FieldMemOperand(r4, HeapObject::kMapOffset)); | 5324 __ str(ip, FieldMemOperand(r4, HeapObject::kMapOffset)); |
(...skipping 6442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11761 __ bind(&string_add_runtime); | 11767 __ bind(&string_add_runtime); |
11762 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); | 11768 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); |
11763 } | 11769 } |
11764 | 11770 |
11765 | 11771 |
11766 #undef __ | 11772 #undef __ |
11767 | 11773 |
11768 } } // namespace v8::internal | 11774 } } // namespace v8::internal |
11769 | 11775 |
11770 #endif // V8_TARGET_ARCH_ARM | 11776 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |