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

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

Issue 26682003: Cache number of type arguments in class object instead of recalculating it. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 | « runtime/vm/intrinsifier_arm.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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 void Intrinsifier::ImmutableList_getIndexed(Assembler* assembler) { 168 void Intrinsifier::ImmutableList_getIndexed(Assembler* assembler) {
169 return Array_getIndexed(assembler); 169 return Array_getIndexed(assembler);
170 } 170 }
171 171
172 172
173 static intptr_t ComputeObjectArrayTypeArgumentsOffset() { 173 static intptr_t ComputeObjectArrayTypeArgumentsOffset() {
174 const Library& core_lib = Library::Handle(Library::CoreLibrary()); 174 const Library& core_lib = Library::Handle(Library::CoreLibrary());
175 const Class& cls = Class::Handle( 175 const Class& cls = Class::Handle(
176 core_lib.LookupClassAllowPrivate(Symbols::_List())); 176 core_lib.LookupClassAllowPrivate(Symbols::_List()));
177 ASSERT(!cls.IsNull()); 177 ASSERT(!cls.IsNull());
178 ASSERT(cls.HasTypeArguments());
179 ASSERT(cls.NumTypeArguments() == 1); 178 ASSERT(cls.NumTypeArguments() == 1);
180 const intptr_t field_offset = cls.type_arguments_field_offset(); 179 const intptr_t field_offset = cls.type_arguments_field_offset();
181 ASSERT(field_offset != Class::kNoTypeArguments); 180 ASSERT(field_offset != Class::kNoTypeArguments);
182 return field_offset; 181 return field_offset;
183 } 182 }
184 183
185 184
186 // Intrinsify only for Smi value and index. Non-smi values need a store buffer 185 // Intrinsify only for Smi value and index. Non-smi values need a store buffer
187 // update. Array length is always a Smi. 186 // update. Array length is always a Smi.
188 void Intrinsifier::Array_setIndexed(Assembler* assembler) { 187 void Intrinsifier::Array_setIndexed(Assembler* assembler) {
(...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1733 __ Bind(&ok); 1732 __ Bind(&ok);
1734 __ ret(); 1733 __ ret();
1735 1734
1736 __ Bind(&fall_through); 1735 __ Bind(&fall_through);
1737 } 1736 }
1738 1737
1739 #undef __ 1738 #undef __
1740 } // namespace dart 1739 } // namespace dart
1741 1740
1742 #endif // defined TARGET_ARCH_IA32 1741 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_arm.cc ('k') | runtime/vm/intrinsifier_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698