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

Side by Side Diff: runtime/vm/intrinsifier_ia32.cc

Issue 1450663002: Intrinsify _StringBase._substringMatches to speedup indexOf/startsWith/endsWith under precompilatio… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « runtime/vm/intrinsifier_arm64.cc ('k') | runtime/vm/intrinsifier_mips.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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // The intrinsic code below is executed before a method has built its frame. 5 // The intrinsic code below is executed before a method has built its frame.
6 // The return address is on the stack and the arguments below it. 6 // The return address is on the stack and the arguments below it.
7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. 7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved.
8 // Each intrinsification method returns true if the corresponding 8 // Each intrinsification method returns true if the corresponding
9 // Dart method was intrinsified. 9 // Dart method was intrinsified.
10 10
(...skipping 1723 matching lines...) Expand 10 before | Expand all | Expand 10 after
1734 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); 1734 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump);
1735 ASSERT(kSmiTagShift == 1); 1735 ASSERT(kSmiTagShift == 1);
1736 __ movzxw(EAX, FieldAddress(EAX, EBX, TIMES_1, TwoByteString::data_offset())); 1736 __ movzxw(EAX, FieldAddress(EAX, EBX, TIMES_1, TwoByteString::data_offset()));
1737 __ SmiTag(EAX); 1737 __ SmiTag(EAX);
1738 __ ret(); 1738 __ ret();
1739 1739
1740 __ Bind(&fall_through); 1740 __ Bind(&fall_through);
1741 } 1741 }
1742 1742
1743 1743
1744 // bool _substringMatches(int start, String other)
1745 void Intrinsifier::StringBaseSubstringMatches(Assembler* assembler) {
1746 // For precompilation, not implemented on IA32.
1747 }
1748
1749
1744 void Intrinsifier::StringBaseCharAt(Assembler* assembler) { 1750 void Intrinsifier::StringBaseCharAt(Assembler* assembler) {
1745 Label fall_through, try_two_byte_string; 1751 Label fall_through, try_two_byte_string;
1746 __ movl(EBX, Address(ESP, + 1 * kWordSize)); // Index. 1752 __ movl(EBX, Address(ESP, + 1 * kWordSize)); // Index.
1747 __ movl(EAX, Address(ESP, + 2 * kWordSize)); // String. 1753 __ movl(EAX, Address(ESP, + 2 * kWordSize)); // String.
1748 __ testl(EBX, Immediate(kSmiTagMask)); 1754 __ testl(EBX, Immediate(kSmiTagMask));
1749 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); // Non-smi index. 1755 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); // Non-smi index.
1750 // Range check. 1756 // Range check.
1751 __ cmpl(EBX, FieldAddress(EAX, String::length_offset())); 1757 __ cmpl(EBX, FieldAddress(EAX, String::length_offset()));
1752 // Runtime throws exception. 1758 // Runtime throws exception.
1753 __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump); 1759 __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump);
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
2147 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { 2153 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) {
2148 __ LoadIsolate(EAX); 2154 __ LoadIsolate(EAX);
2149 __ movl(EAX, Address(EAX, Isolate::current_tag_offset())); 2155 __ movl(EAX, Address(EAX, Isolate::current_tag_offset()));
2150 __ ret(); 2156 __ ret();
2151 } 2157 }
2152 2158
2153 #undef __ 2159 #undef __
2154 } // namespace dart 2160 } // namespace dart
2155 2161
2156 #endif // defined TARGET_ARCH_IA32 2162 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_arm64.cc ('k') | runtime/vm/intrinsifier_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698