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

Side by Side Diff: src/a64/full-codegen-a64.cc

Issue 169543002: A64: Optimize a loop by using post-indexing. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 2787 matching lines...) Expand 10 before | Expand all | Expand 10 after
2798 __ Mul(descriptors_length, descriptors_length, x15); 2798 __ Mul(descriptors_length, descriptors_length, x15);
2799 // Calculate location of the first key name. 2799 // Calculate location of the first key name.
2800 __ Add(descriptors, descriptors, 2800 __ Add(descriptors, descriptors,
2801 DescriptorArray::kFirstOffset - kHeapObjectTag); 2801 DescriptorArray::kFirstOffset - kHeapObjectTag);
2802 // Calculate the end of the descriptor array. 2802 // Calculate the end of the descriptor array.
2803 __ Add(descriptors_end, descriptors, 2803 __ Add(descriptors_end, descriptors,
2804 Operand(descriptors_length, LSL, kPointerSizeLog2)); 2804 Operand(descriptors_length, LSL, kPointerSizeLog2));
2805 2805
2806 // Loop through all the keys in the descriptor array. If one of these is the 2806 // Loop through all the keys in the descriptor array. If one of these is the
2807 // string "valueOf" the result is false. 2807 // string "valueOf" the result is false.
2808 // TODO(all): optimise this loop to combine the add and ldr into an
2809 // addressing mode.
2810 Register valueof_string = x1; 2808 Register valueof_string = x1;
2809 int descriptor_size = DescriptorArray::kDescriptorSize * kPointerSize;
2811 __ Mov(valueof_string, Operand(isolate()->factory()->value_of_string())); 2810 __ Mov(valueof_string, Operand(isolate()->factory()->value_of_string()));
2812 __ Bind(&loop); 2811 __ Bind(&loop);
2813 __ Ldr(x15, MemOperand(descriptors)); 2812 __ Ldr(x15, MemOperand(descriptors, descriptor_size, PostIndex));
2814 __ Cmp(x15, valueof_string); 2813 __ Cmp(x15, valueof_string);
2815 __ B(eq, if_false); 2814 __ B(eq, if_false);
2816 __ Add(descriptors, descriptors,
2817 DescriptorArray::kDescriptorSize * kPointerSize);
2818 __ Cmp(descriptors, descriptors_end); 2815 __ Cmp(descriptors, descriptors_end);
2819 __ B(ne, &loop); 2816 __ B(ne, &loop);
2820 2817
2821 __ Bind(&done); 2818 __ Bind(&done);
2822 2819
2823 // Set the bit in the map to indicate that there is no local valueOf field. 2820 // Set the bit in the map to indicate that there is no local valueOf field.
2824 __ Ldrb(x2, FieldMemOperand(map, Map::kBitField2Offset)); 2821 __ Ldrb(x2, FieldMemOperand(map, Map::kBitField2Offset));
2825 __ Orr(x2, x2, 1 << Map::kStringWrapperSafeForDefaultValueOf); 2822 __ Orr(x2, x2, 1 << Map::kStringWrapperSafeForDefaultValueOf);
2826 __ Strb(x2, FieldMemOperand(map, Map::kBitField2Offset)); 2823 __ Strb(x2, FieldMemOperand(map, Map::kBitField2Offset));
2827 2824
(...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after
5004 return previous_; 5001 return previous_;
5005 } 5002 }
5006 5003
5007 5004
5008 #undef __ 5005 #undef __
5009 5006
5010 5007
5011 } } // namespace v8::internal 5008 } } // namespace v8::internal
5012 5009
5013 #endif // V8_TARGET_ARCH_A64 5010 #endif // V8_TARGET_ARCH_A64
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698