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

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

Issue 10877030: Fix inlining and intrinsification for moved Math methods. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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/intermediate_language.h ('k') | runtime/vm/intrinsifier.h » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #include "vm/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_allocator.h" 9 #include "vm/flow_graph_allocator.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 if (head != NULL) { 144 if (head != NULL) {
145 next_use_ = head; 145 next_use_ = head;
146 head->previous_use_ = this; 146 head->previous_use_ = this;
147 } 147 }
148 definition_->set_use_list(this); 148 definition_->set_use_list(this);
149 } 149 }
150 150
151 151
152 MethodRecognizer::Kind MethodRecognizer::RecognizeKind( 152 MethodRecognizer::Kind MethodRecognizer::RecognizeKind(
153 const Function& function) { 153 const Function& function) {
154 // Only core library methods can be recognized. 154 // Only core and math library methods can be recognized.
155 const Library& core_lib = Library::Handle(Library::CoreLibrary()); 155 const Library& core_lib = Library::Handle(Library::CoreLibrary());
156 const Library& core_impl_lib = Library::Handle(Library::CoreImplLibrary()); 156 const Library& core_impl_lib = Library::Handle(Library::CoreImplLibrary());
157 const Library& math_lib = Library::Handle(Library::MathLibrary());
157 const Class& function_class = Class::Handle(function.Owner()); 158 const Class& function_class = Class::Handle(function.Owner());
158 if ((function_class.library() != core_lib.raw()) && 159 if ((function_class.library() != core_lib.raw()) &&
159 (function_class.library() != core_impl_lib.raw())) { 160 (function_class.library() != core_impl_lib.raw()) &&
161 (function_class.library() != math_lib.raw())) {
160 return kUnknown; 162 return kUnknown;
161 } 163 }
162 const String& recognize_name = String::Handle(function.name()); 164 const String& recognize_name = String::Handle(function.name());
163 const String& recognize_class = String::Handle(function_class.Name()); 165 const String& recognize_class = String::Handle(function_class.Name());
164 String& test_function_name = String::Handle(); 166 String& test_function_name = String::Handle();
165 String& test_class_name = String::Handle(); 167 String& test_class_name = String::Handle();
166 #define RECOGNIZE_FUNCTION(class_name, function_name, enum_name) \ 168 #define RECOGNIZE_FUNCTION(class_name, function_name, enum_name) \
167 test_function_name = Symbols::New(#function_name); \ 169 test_function_name = Symbols::New(#function_name); \
168 test_class_name = Symbols::New(#class_name); \ 170 test_class_name = Symbols::New(#class_name); \
169 if (recognize_name.Equals(test_function_name) && \ 171 if (recognize_name.Equals(test_function_name) && \
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 fixed_parameter_count_(fixed_parameter_count) { 1524 fixed_parameter_count_(fixed_parameter_count) {
1523 for (intptr_t i = 0; i < definitions.length(); ++i) { 1525 for (intptr_t i = 0; i < definitions.length(); ++i) {
1524 values_.Add(UseDefinition(definitions[i])); 1526 values_.Add(UseDefinition(definitions[i]));
1525 } 1527 }
1526 } 1528 }
1527 1529
1528 1530
1529 #undef __ 1531 #undef __
1530 1532
1531 } // namespace dart 1533 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intrinsifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698