Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Side by Side Diff: src/arm/codegen-arm.cc

Issue 2073018: Reverting r4703. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/arm/ic-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2258 matching lines...) Expand 10 before | Expand all | Expand 10 after
2269 // the object) 2269 // the object)
2270 __ mov(r1, Operand(r0)); 2270 __ mov(r1, Operand(r0));
2271 __ ldr(r1, FieldMemOperand(r1, Map::kInstanceDescriptorsOffset)); 2271 __ ldr(r1, FieldMemOperand(r1, Map::kInstanceDescriptorsOffset));
2272 __ ldr(r1, FieldMemOperand(r1, DescriptorArray::kEnumerationIndexOffset)); 2272 __ ldr(r1, FieldMemOperand(r1, DescriptorArray::kEnumerationIndexOffset));
2273 __ ldr(r2, 2273 __ ldr(r2,
2274 FieldMemOperand(r1, DescriptorArray::kEnumCacheBridgeCacheOffset)); 2274 FieldMemOperand(r1, DescriptorArray::kEnumCacheBridgeCacheOffset));
2275 2275
2276 frame_->EmitPush(r0); // map 2276 frame_->EmitPush(r0); // map
2277 frame_->EmitPush(r2); // enum cache bridge cache 2277 frame_->EmitPush(r2); // enum cache bridge cache
2278 __ ldr(r0, FieldMemOperand(r2, FixedArray::kLengthOffset)); 2278 __ ldr(r0, FieldMemOperand(r2, FixedArray::kLengthOffset));
2279 __ mov(r0, Operand(r0, LSL, kSmiTagSize));
2279 frame_->EmitPush(r0); 2280 frame_->EmitPush(r0);
2280 __ mov(r0, Operand(Smi::FromInt(0))); 2281 __ mov(r0, Operand(Smi::FromInt(0)));
2281 frame_->EmitPush(r0); 2282 frame_->EmitPush(r0);
2282 entry.Jump(); 2283 entry.Jump();
2283 2284
2284 fixed_array.Bind(); 2285 fixed_array.Bind();
2285 __ mov(r1, Operand(Smi::FromInt(0))); 2286 __ mov(r1, Operand(Smi::FromInt(0)));
2286 frame_->EmitPush(r1); // insert 0 in place of Map 2287 frame_->EmitPush(r1); // insert 0 in place of Map
2287 frame_->EmitPush(r0); 2288 frame_->EmitPush(r0);
2288 2289
2289 // Push the length of the array and the initial index onto the stack. 2290 // Push the length of the array and the initial index onto the stack.
2290 __ ldr(r0, FieldMemOperand(r0, FixedArray::kLengthOffset)); 2291 __ ldr(r0, FieldMemOperand(r0, FixedArray::kLengthOffset));
2292 __ mov(r0, Operand(r0, LSL, kSmiTagSize));
2291 frame_->EmitPush(r0); 2293 frame_->EmitPush(r0);
2292 __ mov(r0, Operand(Smi::FromInt(0))); // init index 2294 __ mov(r0, Operand(Smi::FromInt(0))); // init index
2293 frame_->EmitPush(r0); 2295 frame_->EmitPush(r0);
2294 2296
2295 // Condition. 2297 // Condition.
2296 entry.Bind(); 2298 entry.Bind();
2297 // sp[0] : index 2299 // sp[0] : index
2298 // sp[1] : array/enum cache length 2300 // sp[1] : array/enum cache length
2299 // sp[2] : array or enum cache 2301 // sp[2] : array or enum cache
2300 // sp[3] : 0 or map 2302 // sp[3] : 0 or map
(...skipping 2180 matching lines...) Expand 10 before | Expand all | Expand 10 after
4481 4483
4482 // Fill out the elements FixedArray. 4484 // Fill out the elements FixedArray.
4483 // r0: JSArray, tagged. 4485 // r0: JSArray, tagged.
4484 // r3: FixedArray, tagged. 4486 // r3: FixedArray, tagged.
4485 // r5: Number of elements in array, untagged. 4487 // r5: Number of elements in array, untagged.
4486 4488
4487 // Set map. 4489 // Set map.
4488 __ mov(r2, Operand(Factory::fixed_array_map())); 4490 __ mov(r2, Operand(Factory::fixed_array_map()));
4489 __ str(r2, FieldMemOperand(r3, HeapObject::kMapOffset)); 4491 __ str(r2, FieldMemOperand(r3, HeapObject::kMapOffset));
4490 // Set FixedArray length. 4492 // Set FixedArray length.
4491 __ mov(r6, Operand(r5, LSL, kSmiTagSize)); 4493 __ str(r5, FieldMemOperand(r3, FixedArray::kLengthOffset));
4492 __ str(r6, FieldMemOperand(r3, FixedArray::kLengthOffset));
4493 // Fill contents of fixed-array with the-hole. 4494 // Fill contents of fixed-array with the-hole.
4494 __ mov(r2, Operand(Factory::the_hole_value())); 4495 __ mov(r2, Operand(Factory::the_hole_value()));
4495 __ add(r3, r3, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 4496 __ add(r3, r3, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
4496 // Fill fixed array elements with hole. 4497 // Fill fixed array elements with hole.
4497 // r0: JSArray, tagged. 4498 // r0: JSArray, tagged.
4498 // r2: the hole. 4499 // r2: the hole.
4499 // r3: Start of elements in FixedArray. 4500 // r3: Start of elements in FixedArray.
4500 // r5: Number of elements to fill. 4501 // r5: Number of elements to fill.
4501 Label loop; 4502 Label loop;
4502 __ tst(r5, Operand(r5)); 4503 __ tst(r5, Operand(r5));
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after
5689 // is not a dictionary. 5690 // is not a dictionary.
5690 __ ldr(scratch1, FieldMemOperand(receiver, JSObject::kElementsOffset)); 5691 __ ldr(scratch1, FieldMemOperand(receiver, JSObject::kElementsOffset));
5691 __ ldr(scratch2, FieldMemOperand(scratch1, JSObject::kMapOffset)); 5692 __ ldr(scratch2, FieldMemOperand(scratch1, JSObject::kMapOffset));
5692 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex); 5693 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex);
5693 __ cmp(scratch2, ip); 5694 __ cmp(scratch2, ip);
5694 deferred->Branch(ne); 5695 deferred->Branch(ne);
5695 5696
5696 // Check that key is within bounds. Use unsigned comparison to handle 5697 // Check that key is within bounds. Use unsigned comparison to handle
5697 // negative keys. 5698 // negative keys.
5698 __ ldr(scratch2, FieldMemOperand(scratch1, FixedArray::kLengthOffset)); 5699 __ ldr(scratch2, FieldMemOperand(scratch1, FixedArray::kLengthOffset));
5699 __ cmp(scratch2, key); 5700 __ cmp(scratch2, Operand(key, ASR, kSmiTagSize));
5700 deferred->Branch(ls); // Unsigned less equal. 5701 deferred->Branch(ls); // Unsigned less equal.
5701 5702
5702 // Load and check that the result is not the hole (key is a smi). 5703 // Load and check that the result is not the hole (key is a smi).
5703 __ LoadRoot(scratch2, Heap::kTheHoleValueRootIndex); 5704 __ LoadRoot(scratch2, Heap::kTheHoleValueRootIndex);
5704 __ add(scratch1, 5705 __ add(scratch1,
5705 scratch1, 5706 scratch1,
5706 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 5707 Operand(FixedArray::kHeaderSize - kHeapObjectTag));
5707 __ ldr(scratch1, 5708 __ ldr(scratch1,
5708 MemOperand(scratch1, key, LSL, 5709 MemOperand(scratch1, key, LSL,
5709 kPointerSizeLog2 - (kSmiTagSize + kSmiShiftSize))); 5710 kPointerSizeLog2 - (kSmiTagSize + kSmiShiftSize)));
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
5990 r2, 5991 r2,
5991 &gc, 5992 &gc,
5992 TAG_OBJECT); 5993 TAG_OBJECT);
5993 5994
5994 // Load the function from the stack. 5995 // Load the function from the stack.
5995 __ ldr(r3, MemOperand(sp, 0)); 5996 __ ldr(r3, MemOperand(sp, 0));
5996 5997
5997 // Setup the object header. 5998 // Setup the object header.
5998 __ LoadRoot(r2, Heap::kContextMapRootIndex); 5999 __ LoadRoot(r2, Heap::kContextMapRootIndex);
5999 __ str(r2, FieldMemOperand(r0, HeapObject::kMapOffset)); 6000 __ str(r2, FieldMemOperand(r0, HeapObject::kMapOffset));
6000 __ mov(r2, Operand(Smi::FromInt(length))); 6001 __ mov(r2, Operand(length));
6001 __ str(r2, FieldMemOperand(r0, FixedArray::kLengthOffset)); 6002 __ str(r2, FieldMemOperand(r0, Array::kLengthOffset));
6002 6003
6003 // Setup the fixed slots. 6004 // Setup the fixed slots.
6004 __ mov(r1, Operand(Smi::FromInt(0))); 6005 __ mov(r1, Operand(Smi::FromInt(0)));
6005 __ str(r3, MemOperand(r0, Context::SlotOffset(Context::CLOSURE_INDEX))); 6006 __ str(r3, MemOperand(r0, Context::SlotOffset(Context::CLOSURE_INDEX)));
6006 __ str(r0, MemOperand(r0, Context::SlotOffset(Context::FCONTEXT_INDEX))); 6007 __ str(r0, MemOperand(r0, Context::SlotOffset(Context::FCONTEXT_INDEX)));
6007 __ str(r1, MemOperand(r0, Context::SlotOffset(Context::PREVIOUS_INDEX))); 6008 __ str(r1, MemOperand(r0, Context::SlotOffset(Context::PREVIOUS_INDEX)));
6008 __ str(r1, MemOperand(r0, Context::SlotOffset(Context::EXTENSION_INDEX))); 6009 __ str(r1, MemOperand(r0, Context::SlotOffset(Context::EXTENSION_INDEX)));
6009 6010
6010 // Copy the global object from the surrounding context. 6011 // Copy the global object from the surrounding context.
6011 __ ldr(r1, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); 6012 __ ldr(r1, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
6622 // Use of registers. Register result is used as a temporary. 6623 // Use of registers. Register result is used as a temporary.
6623 Register number_string_cache = result; 6624 Register number_string_cache = result;
6624 Register mask = scratch3; 6625 Register mask = scratch3;
6625 6626
6626 // Load the number string cache. 6627 // Load the number string cache.
6627 __ LoadRoot(number_string_cache, Heap::kNumberStringCacheRootIndex); 6628 __ LoadRoot(number_string_cache, Heap::kNumberStringCacheRootIndex);
6628 6629
6629 // Make the hash mask from the length of the number string cache. It 6630 // Make the hash mask from the length of the number string cache. It
6630 // contains two elements (number and string) for each cache entry. 6631 // contains two elements (number and string) for each cache entry.
6631 __ ldr(mask, FieldMemOperand(number_string_cache, FixedArray::kLengthOffset)); 6632 __ ldr(mask, FieldMemOperand(number_string_cache, FixedArray::kLengthOffset));
6632 // Divide length by two (length is a smi). 6633 // Divide length by two (length is not a smi).
6633 __ mov(mask, Operand(mask, ASR, kSmiTagSize + 1)); 6634 __ mov(mask, Operand(mask, ASR, 1));
6634 __ sub(mask, mask, Operand(1)); // Make mask. 6635 __ sub(mask, mask, Operand(1)); // Make mask.
6635 6636
6636 // Calculate the entry in the number string cache. The hash value in the 6637 // Calculate the entry in the number string cache. The hash value in the
6637 // number string cache for smis is just the smi value, and the hash for 6638 // number string cache for smis is just the smi value, and the hash for
6638 // doubles is the xor of the upper and lower words. See 6639 // doubles is the xor of the upper and lower words. See
6639 // Heap::GetNumberStringCache. 6640 // Heap::GetNumberStringCache.
6640 Label is_smi; 6641 Label is_smi;
6641 Label load_result_from_cache; 6642 Label load_result_from_cache;
6642 if (!object_is_smi) { 6643 if (!object_is_smi) {
6643 __ BranchOnSmi(object, &is_smi); 6644 __ BranchOnSmi(object, &is_smi);
(...skipping 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after
8514 // Get the length (smi tagged) and set that as an in-object property too. 8515 // Get the length (smi tagged) and set that as an in-object property too.
8515 ASSERT(Heap::arguments_length_index == 1); 8516 ASSERT(Heap::arguments_length_index == 1);
8516 __ ldr(r1, MemOperand(sp, 0 * kPointerSize)); 8517 __ ldr(r1, MemOperand(sp, 0 * kPointerSize));
8517 __ str(r1, FieldMemOperand(r0, JSObject::kHeaderSize + kPointerSize)); 8518 __ str(r1, FieldMemOperand(r0, JSObject::kHeaderSize + kPointerSize));
8518 8519
8519 // If there are no actual arguments, we're done. 8520 // If there are no actual arguments, we're done.
8520 Label done; 8521 Label done;
8521 __ cmp(r1, Operand(0)); 8522 __ cmp(r1, Operand(0));
8522 __ b(eq, &done); 8523 __ b(eq, &done);
8523 8524
8524 // Get the parameters pointer from the stack. 8525 // Get the parameters pointer from the stack and untag the length.
8525 __ ldr(r2, MemOperand(sp, 1 * kPointerSize)); 8526 __ ldr(r2, MemOperand(sp, 1 * kPointerSize));
8527 __ mov(r1, Operand(r1, LSR, kSmiTagSize));
8526 8528
8527 // Setup the elements pointer in the allocated arguments object and 8529 // Setup the elements pointer in the allocated arguments object and
8528 // initialize the header in the elements fixed array. 8530 // initialize the header in the elements fixed array.
8529 __ add(r4, r0, Operand(Heap::kArgumentsObjectSize)); 8531 __ add(r4, r0, Operand(Heap::kArgumentsObjectSize));
8530 __ str(r4, FieldMemOperand(r0, JSObject::kElementsOffset)); 8532 __ str(r4, FieldMemOperand(r0, JSObject::kElementsOffset));
8531 __ LoadRoot(r3, Heap::kFixedArrayMapRootIndex); 8533 __ LoadRoot(r3, Heap::kFixedArrayMapRootIndex);
8532 __ str(r3, FieldMemOperand(r4, FixedArray::kMapOffset)); 8534 __ str(r3, FieldMemOperand(r4, FixedArray::kMapOffset));
8533 __ str(r1, FieldMemOperand(r4, FixedArray::kLengthOffset)); 8535 __ str(r1, FieldMemOperand(r4, FixedArray::kLengthOffset));
8534 __ mov(r1, Operand(r1, LSR, kSmiTagSize)); // Untag the length for the loop.
8535 8536
8536 // Copy the fixed array slots. 8537 // Copy the fixed array slots.
8537 Label loop; 8538 Label loop;
8538 // Setup r4 to point to the first array slot. 8539 // Setup r4 to point to the first array slot.
8539 __ add(r4, r4, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 8540 __ add(r4, r4, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
8540 __ bind(&loop); 8541 __ bind(&loop);
8541 // Pre-decrement r2 with kPointerSize on each iteration. 8542 // Pre-decrement r2 with kPointerSize on each iteration.
8542 // Pre-decrement in order to skip receiver. 8543 // Pre-decrement in order to skip receiver.
8543 __ ldr(r3, MemOperand(r2, kPointerSize, NegPreIndex)); 8544 __ ldr(r3, MemOperand(r2, kPointerSize, NegPreIndex));
8544 // Post-increment r4 with kPointerSize on each iteration. 8545 // Post-increment r4 with kPointerSize on each iteration.
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
8675 FieldMemOperand(r0, JSArray::kElementsOffset)); 8676 FieldMemOperand(r0, JSArray::kElementsOffset));
8676 __ ldr(r0, FieldMemOperand(last_match_info_elements, HeapObject::kMapOffset)); 8677 __ ldr(r0, FieldMemOperand(last_match_info_elements, HeapObject::kMapOffset));
8677 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex); 8678 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex);
8678 __ cmp(r0, ip); 8679 __ cmp(r0, ip);
8679 __ b(ne, &runtime); 8680 __ b(ne, &runtime);
8680 // Check that the last match info has space for the capture registers and the 8681 // Check that the last match info has space for the capture registers and the
8681 // additional information. 8682 // additional information.
8682 __ ldr(r0, 8683 __ ldr(r0,
8683 FieldMemOperand(last_match_info_elements, FixedArray::kLengthOffset)); 8684 FieldMemOperand(last_match_info_elements, FixedArray::kLengthOffset));
8684 __ add(r2, r2, Operand(RegExpImpl::kLastMatchOverhead)); 8685 __ add(r2, r2, Operand(RegExpImpl::kLastMatchOverhead));
8685 __ cmp(r2, Operand(r0, ASR, kSmiTagSize)); 8686 __ cmp(r2, r0);
8686 __ b(gt, &runtime); 8687 __ b(gt, &runtime);
8687 8688
8688 // subject: Subject string 8689 // subject: Subject string
8689 // regexp_data: RegExp data (FixedArray) 8690 // regexp_data: RegExp data (FixedArray)
8690 // Check the representation and encoding of the subject string. 8691 // Check the representation and encoding of the subject string.
8691 Label seq_string; 8692 Label seq_string;
8692 const int kStringRepresentationEncodingMask = 8693 const int kStringRepresentationEncodingMask =
8693 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; 8694 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask;
8694 __ ldr(r0, FieldMemOperand(subject, HeapObject::kMapOffset)); 8695 __ ldr(r0, FieldMemOperand(subject, HeapObject::kMapOffset));
8695 __ ldrb(r0, FieldMemOperand(r0, Map::kInstanceTypeOffset)); 8696 __ ldrb(r0, FieldMemOperand(r0, Map::kInstanceTypeOffset));
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after
10038 __ bind(&string_add_runtime); 10039 __ bind(&string_add_runtime);
10039 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); 10040 __ TailCallRuntime(Runtime::kStringAdd, 2, 1);
10040 } 10041 }
10041 10042
10042 10043
10043 #undef __ 10044 #undef __
10044 10045
10045 } } // namespace v8::internal 10046 } } // namespace v8::internal
10046 10047
10047 #endif // V8_TARGET_ARCH_ARM 10048 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/arm/ic-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698