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

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

Issue 402008: Speed up charCodeAt on very large cons strings, by insisting on... (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
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | src/x64/codegen-x64.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-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 4813 matching lines...) Expand 10 before | Expand all | Expand 10 after
4824 __ shl(temp.reg(), kSmiTagSize); 4824 __ shl(temp.reg(), kSmiTagSize);
4825 __ jmp(&end); 4825 __ jmp(&end);
4826 4826
4827 // Handle non-flat strings. 4827 // Handle non-flat strings.
4828 __ bind(&not_a_flat_string); 4828 __ bind(&not_a_flat_string);
4829 __ and_(temp.reg(), kStringRepresentationMask); 4829 __ and_(temp.reg(), kStringRepresentationMask);
4830 __ cmp(temp.reg(), kConsStringTag); 4830 __ cmp(temp.reg(), kConsStringTag);
4831 __ j(not_equal, &slow_case); 4831 __ j(not_equal, &slow_case);
4832 4832
4833 // ConsString. 4833 // ConsString.
4834 // Check that the right hand side is the empty string (ie if this is really a
4835 // flat string in a cons string). If that is not the case we would rather go
4836 // to the runtime system now, to flatten the string.
4837 __ mov(temp.reg(), FieldOperand(object.reg(), ConsString::kSecondOffset));
4838 __ cmp(Operand(temp.reg()), Immediate(Handle<String>(Heap::empty_string())));
4839 __ j(not_equal, &slow_case);
4834 // Get the first of the two strings. 4840 // Get the first of the two strings.
4835 __ mov(object.reg(), FieldOperand(object.reg(), ConsString::kFirstOffset)); 4841 __ mov(object.reg(), FieldOperand(object.reg(), ConsString::kFirstOffset));
4836 __ jmp(&try_again_with_new_string); 4842 __ jmp(&try_again_with_new_string);
4837 4843
4838 __ bind(&slow_case); 4844 __ bind(&slow_case);
4839 // Move the undefined value into the result register, which will 4845 // Move the undefined value into the result register, which will
4840 // trigger the slow case. 4846 // trigger the slow case.
4841 __ Set(temp.reg(), Immediate(Factory::undefined_value())); 4847 __ Set(temp.reg(), Immediate(Factory::undefined_value()));
4842 4848
4843 __ bind(&end); 4849 __ bind(&end);
(...skipping 3282 matching lines...) Expand 10 before | Expand all | Expand 10 after
8126 8132
8127 int CompareStub::MinorKey() { 8133 int CompareStub::MinorKey() {
8128 // Encode the two parameters in a unique 16 bit value. 8134 // Encode the two parameters in a unique 16 bit value.
8129 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); 8135 ASSERT(static_cast<unsigned>(cc_) < (1 << 15));
8130 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); 8136 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0);
8131 } 8137 }
8132 8138
8133 #undef __ 8139 #undef __
8134 8140
8135 } } // namespace v8::internal 8141 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | src/x64/codegen-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698