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

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

Issue 402012: Accelerate charCodeAt on ARM. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 1 month 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
OLDNEW
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 3727 matching lines...) Expand 10 before | Expand all | Expand 10 after
3738 __ movl(temp.reg(), FieldOperand(object.reg(), String::kLengthOffset)); 3738 __ movl(temp.reg(), FieldOperand(object.reg(), String::kLengthOffset));
3739 __ shrl_cl(temp.reg()); 3739 __ shrl_cl(temp.reg());
3740 // Check for index out of range. 3740 // Check for index out of range.
3741 __ cmpl(index.reg(), temp.reg()); 3741 __ cmpl(index.reg(), temp.reg());
3742 __ j(greater_equal, &slow_case); 3742 __ j(greater_equal, &slow_case);
3743 // Reload the instance type (into the temp register this time).. 3743 // Reload the instance type (into the temp register this time)..
3744 __ movq(temp.reg(), FieldOperand(object.reg(), HeapObject::kMapOffset)); 3744 __ movq(temp.reg(), FieldOperand(object.reg(), HeapObject::kMapOffset));
3745 __ movzxbl(temp.reg(), FieldOperand(temp.reg(), Map::kInstanceTypeOffset)); 3745 __ movzxbl(temp.reg(), FieldOperand(temp.reg(), Map::kInstanceTypeOffset));
3746 3746
3747 // We need special handling for non-flat strings. 3747 // We need special handling for non-flat strings.
3748 ASSERT(kSeqStringTag == 0); 3748 ASSERT_EQ(0, kSeqStringTag);
3749 __ testb(temp.reg(), Immediate(kStringRepresentationMask)); 3749 __ testb(temp.reg(), Immediate(kStringRepresentationMask));
3750 __ j(not_zero, &not_a_flat_string); 3750 __ j(not_zero, &not_a_flat_string);
3751 // Check for 1-byte or 2-byte string. 3751 // Check for 1-byte or 2-byte string.
3752 ASSERT_EQ(0, kTwoByteStringTag);
3752 __ testb(temp.reg(), Immediate(kStringEncodingMask)); 3753 __ testb(temp.reg(), Immediate(kStringEncodingMask));
3753 __ j(not_zero, &ascii_string); 3754 __ j(not_zero, &ascii_string);
3754 3755
3755 // 2-byte string. 3756 // 2-byte string.
3756 // Load the 2-byte character code into the temp register. 3757 // Load the 2-byte character code into the temp register.
3757 __ movzxwl(temp.reg(), FieldOperand(object.reg(), 3758 __ movzxwl(temp.reg(), FieldOperand(object.reg(),
3758 index.reg(), 3759 index.reg(),
3759 times_2, 3760 times_2,
3760 SeqTwoByteString::kHeaderSize)); 3761 SeqTwoByteString::kHeaderSize));
3761 __ jmp(&got_char_code); 3762 __ jmp(&got_char_code);
(...skipping 4081 matching lines...) Expand 10 before | Expand all | Expand 10 after
7843 masm.GetCode(&desc); 7844 masm.GetCode(&desc);
7844 // Call the function from C++. 7845 // Call the function from C++.
7845 return FUNCTION_CAST<ModuloFunction>(buffer); 7846 return FUNCTION_CAST<ModuloFunction>(buffer);
7846 } 7847 }
7847 7848
7848 #endif 7849 #endif
7849 7850
7850 #undef __ 7851 #undef __
7851 7852
7852 } } // namespace v8::internal 7853 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698